mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-15 06:53:51 -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()
|
function! LightLineFugitive()
|
||||||
if exists("*fugitive#head")
|
if exists("*fugitive#head")
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? '⭠ '._ : ''
|
return _ !=# '' ? '⭠ '._ : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
@@ -597,7 +597,7 @@ endfunction
|
|||||||
function! LightLineFugitive()
|
function! LightLineFugitive()
|
||||||
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
|
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? '⭠ '._ : ''
|
return _ !=# '' ? '⭠ '._ : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
@@ -607,11 +607,11 @@ function! LightLineFileformat()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineFiletype()
|
function! LightLineFiletype()
|
||||||
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineFileencoding()
|
function! LightLineFileencoding()
|
||||||
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineMode()
|
function! LightLineMode()
|
||||||
@@ -692,7 +692,7 @@ function! LightLineFugitive()
|
|||||||
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||||
let mark = '' " edit here for cool mark
|
let mark = '' " edit here for cool mark
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? mark._ : ''
|
return _ !=# '' ? mark._ : ''
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
endtry
|
endtry
|
||||||
@@ -704,11 +704,11 @@ function! LightLineFileformat()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineFiletype()
|
function! LightLineFiletype()
|
||||||
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineFileencoding()
|
function! LightLineFileencoding()
|
||||||
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineMode()
|
function! LightLineMode()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
" Filename: autoload/lightline/tab.vim
|
" Filename: autoload/lightline/tab.vim
|
||||||
" Author: itchyny
|
" Author: itchyny
|
||||||
" License: MIT License
|
" License: MIT License
|
||||||
" Last Change: 2015/01/04 22:44:42.
|
" Last Change: 2016/05/07 22:31:02.
|
||||||
" =============================================================================
|
" =============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
@@ -12,7 +12,7 @@ function! lightline#tab#filename(n) abort
|
|||||||
let buflist = tabpagebuflist(a:n)
|
let buflist = tabpagebuflist(a:n)
|
||||||
let winnr = tabpagewinnr(a:n)
|
let winnr = tabpagewinnr(a:n)
|
||||||
let _ = expand('#'.buflist[winnr - 1].':t')
|
let _ = expand('#'.buflist[winnr - 1].':t')
|
||||||
return strlen(_) ? _ : '[No Name]'
|
return _ !=# '' ? _ : '[No Name]'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! lightline#tab#modified(n) abort
|
function! lightline#tab#modified(n) abort
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ nice.
|
|||||||
function! LightLineFugitive()
|
function! LightLineFugitive()
|
||||||
if exists('*fugitive#head')
|
if exists('*fugitive#head')
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? ''._ : ''
|
return _ !=# '' ? ''._ : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
@@ -312,7 +312,7 @@ look nice.
|
|||||||
function! LightLineFugitive()
|
function! LightLineFugitive()
|
||||||
if exists('*fugitive#head')
|
if exists('*fugitive#head')
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? '⭠ '._ : ''
|
return _ !=# '' ? '⭠ '._ : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
@@ -742,7 +742,7 @@ A nice example for |vim-powerline| font users:
|
|||||||
function! LightLineFugitive()
|
function! LightLineFugitive()
|
||||||
if &ft !~? 'vimfiler' && exists('*fugitive#head')
|
if &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? '⭠ '._ : ''
|
return _ !=# '' ? '⭠ '._ : ''
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
@@ -803,7 +803,7 @@ For users who uses lots of plugins:
|
|||||||
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
|
||||||
let mark = '' " edit here for cool mark
|
let mark = '' " edit here for cool mark
|
||||||
let _ = fugitive#head()
|
let _ = fugitive#head()
|
||||||
return strlen(_) ? mark._ : ''
|
return _ !=# '' ? mark._ : ''
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
endtry
|
endtry
|
||||||
@@ -815,11 +815,11 @@ For users who uses lots of plugins:
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineFiletype()
|
function! LightLineFiletype()
|
||||||
return winwidth(0) > 70 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
|
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineFileencoding()
|
function! LightLineFileencoding()
|
||||||
return winwidth(0) > 70 ? (strlen(&fenc) ? &fenc : &enc) : ''
|
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! LightLineMode()
|
function! LightLineMode()
|
||||||
|
|||||||
Reference in New Issue
Block a user