Do not error out, if a netrw variable is not defined
This should not happen, however being a bit more error tolerant shouldn't hurt, so let's just fall back to 'normal' for the g:netrw_sort_direction in case it is not defined (which should be the default anyhow). fixes #1492
This commit is contained in:
parent
9eb51f48f4
commit
e16ff7cc88
@ -29,6 +29,6 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! airline#extensions#netrw#sortstring()
|
function! airline#extensions#netrw#sortstring()
|
||||||
let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-'
|
let order = (get(g:, 'netrw_sort_direction', 'n') =~ 'n') ? '+' : '-'
|
||||||
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
|
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
x
Reference in New Issue
Block a user