mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-17 16:03:41 -05:00
update the example configurations: instead of using strlen, compare to empty string
This commit is contained in:
14
README.md
14
README.md
@@ -521,7 +521,7 @@ Oops! We forgot the cool mark for the branch component! (work with the patched f
|
||||
function! LightLineFugitive()
|
||||
if exists("*fugitive#head")
|
||||
let _ = fugitive#head()
|
||||
return strlen(_) ? '⭠ '._ : ''
|
||||
return _ !=# '' ? '⭠ '._ : ''
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
@@ -597,7 +597,7 @@ endfunction
|
||||
function! LightLineFugitive()
|
||||
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
|
||||
let _ = fugitive#head()
|
||||
return strlen(_) ? '⭠ '._ : ''
|
||||
return _ !=# '' ? '⭠ '._ : ''
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
@@ -607,11 +607,11 @@ function! LightLineFileformat()
|
||||
endfunction
|
||||
|
||||
function! LightLineFiletype()
|
||||
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
||||
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileencoding()
|
||||
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
||||
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineMode()
|
||||
@@ -692,7 +692,7 @@ function! LightLineFugitive()
|
||||
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||
let mark = '' " edit here for cool mark
|
||||
let _ = fugitive#head()
|
||||
return strlen(_) ? mark._ : ''
|
||||
return _ !=# '' ? mark._ : ''
|
||||
endif
|
||||
catch
|
||||
endtry
|
||||
@@ -704,11 +704,11 @@ function! LightLineFileformat()
|
||||
endfunction
|
||||
|
||||
function! LightLineFiletype()
|
||||
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
||||
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineFileencoding()
|
||||
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
||||
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||
endfunction
|
||||
|
||||
function! LightLineMode()
|
||||
|
||||
Reference in New Issue
Block a user