mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
Add dict to function refferencing self
This is no explicit problem in Vim, however Neovim diverged in this behaviour from Vim and requires the dict attribute to be present before accessing the self attribute. See neovim/neovim#5763
This commit is contained in:
committed by
Christian Brabandt
parent
7cb5c24151
commit
dfc0cb772a
@@ -5,20 +5,20 @@ scriptencoding utf-8
|
||||
|
||||
let s:prototype = {}
|
||||
|
||||
function! s:prototype.split(...)
|
||||
function! s:prototype.split(...) dict
|
||||
call add(self._sections, ['|', a:0 ? a:1 : '%='])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section_spaced(group, contents)
|
||||
function! s:prototype.add_section_spaced(group, contents) dict
|
||||
let spc = empty(a:contents) ? '' : g:airline_symbols.space
|
||||
call self.add_section(a:group, spc.a:contents.spc)
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section(group, contents)
|
||||
function! s:prototype.add_section(group, contents) dict
|
||||
call add(self._sections, [a:group, a:contents])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_raw(text)
|
||||
function! s:prototype.add_raw(text) dict
|
||||
call add(self._sections, ['', a:text])
|
||||
endfunction
|
||||
|
||||
@@ -34,7 +34,7 @@ function! s:get_prev_group(sections, i)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:prototype.build()
|
||||
function! s:prototype.build() dict
|
||||
let side = 1
|
||||
let line = ''
|
||||
let i = 0
|
||||
|
||||
Reference in New Issue
Block a user