mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
plugin: handle sandbox mode gracefully
When the sandbox is active (e.g. while debugging something), certains commands and expressions are not allowed (see :h sandbox) and may cause nasty exceptions to be thrown. So try to catch E48 and handle it gracefully
This commit is contained in:
@@ -180,7 +180,12 @@ function! airline#util#doautocmd(event)
|
||||
" airline disabled
|
||||
return
|
||||
endif
|
||||
exe printf("silent doautocmd %s User %s", s:nomodeline, a:event)
|
||||
try
|
||||
exe printf("silent doautocmd %s User %s", s:nomodeline, a:event)
|
||||
catch /^Vim\%((\a\+)\)\=:E48:/
|
||||
" Catch: Sandbox mode
|
||||
" no-op
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! airline#util#themes(match)
|
||||
|
||||
Reference in New Issue
Block a user