mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-16 23:43:42 -05:00
call fugitive#head only once
This commit is contained in:
12
README.md
12
README.md
@@ -483,7 +483,11 @@ endfunction
|
||||
Oops! We forgot the cool mark for the branch component! (work with the patched font for vim-powerline)
|
||||
```vim
|
||||
function! MyFugitive()
|
||||
return exists('*fugitive#head') && strlen(fugitive#head()) ? '⭠ '.fugitive#head() : ''
|
||||
if exists("*fugitive#head")
|
||||
let _ = fugitive#head()
|
||||
return strlen(_) ? '⭠ '._ : ''
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
```
|
||||

|
||||
@@ -543,7 +547,11 @@ function! MyFilename()
|
||||
endfunction
|
||||
|
||||
function! MyFugitive()
|
||||
return &ft !~? 'vimfiler\|gundo' && exists('*fugitive#head') && strlen(fugitive#head()) ? '⭠ '.fugitive#head() : ''
|
||||
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
|
||||
let _ = fugitive#head()
|
||||
return strlen(_) ? '⭠ '._ : ''
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! MyFileformat()
|
||||
|
||||
Reference in New Issue
Block a user