mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
vim-dirvish: Fixed bugs and added better include guards
Fixes issue #2142. These changes primarily focused on making the include guards more robust and simplify how the path for w:airline_section_c was generated. Credits goes to @kazukazuinaina for improving on my original implementation.
This commit is contained in:
@@ -445,7 +445,7 @@ function! airline#extensions#load()
|
||||
endfor
|
||||
endif
|
||||
|
||||
if exists(':Dirvish')
|
||||
if exists(':Dirvish') && get(g:, 'airline#extensions#dirvish#enabled', 1)
|
||||
call airline#extensions#dirvish#init(s:ext)
|
||||
call add(s:loaded_ext, 'dirvish')
|
||||
endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
if !exists(':Dirvish')
|
||||
if !get(g:, 'loaded_dirvish', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -22,10 +22,7 @@ function! airline#extensions#dirvish#apply(...) abort
|
||||
\ ? '%{airline#extensions#branch#get_head()}'
|
||||
\ : ''
|
||||
|
||||
let w:airline_section_c =
|
||||
\ '%{join(split((execute("lcd"))))}'
|
||||
\ . s:spc
|
||||
\ . get(w:, 'airline_section_c', g:airline_section_c)
|
||||
let w:airline_section_c = '%{b:dirvish._dir}'
|
||||
|
||||
let w:airline_section_x = ''
|
||||
let w:airline_section_y = ''
|
||||
|
||||
Reference in New Issue
Block a user