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:
Christian Brabandt 2017-06-19 15:56:17 +02:00
parent 9eb51f48f4
commit e16ff7cc88
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -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