From dfc0cb772a21722a6ae9d21bf578f533c472cf02 Mon Sep 17 00:00:00 2001 From: Hirokazu Hata Date: Tue, 13 Dec 2016 16:44:39 +0900 Subject: [PATCH] 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 --- autoload/airline/builder.vim | 10 +++++----- autoload/airline/util.vim | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autoload/airline/builder.vim b/autoload/airline/builder.vim index 85afde79..d566a32f 100644 --- a/autoload/airline/builder.vim +++ b/autoload/airline/builder.vim @@ -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 diff --git a/autoload/airline/util.vim b/autoload/airline/util.vim index 72406aed..ef11cbec 100644 --- a/autoload/airline/util.vim +++ b/autoload/airline/util.vim @@ -82,7 +82,7 @@ endif " available. This way we avoid overwriting v:shell_error, which might " potentially disrupt other plugins. if has('nvim') - function! s:system_job_handler(job_id, data, event) + function! s:system_job_handler(job_id, data, event) dict if a:event == 'stdout' let self.buf .= join(a:data) endif