Skip to content

Instantly share code, notes, and snippets.

@chrisbra
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbra/ff7162fbcec28cd795f6 to your computer and use it in GitHub Desktop.
Save chrisbra/ff7162fbcec28cd795f6 to your computer and use it in GitHub Desktop.
vim-airline crypt
diff --git a/autoload/airline.vim b/autoload/airline.vim
index ef74298..0b66c7d 100644
--- a/autoload/airline.vim
+++ b/autoload/airline.vim
@@ -161,7 +161,7 @@ function! airline#check_mode(winnr)
call add(l:mode, 'paste')
endif
- if g:airline_detect_crypt && !empty(&key)
+ if g:airline_detect_crypt && exists("+key") && !empty(&key)
call add(l:mode, 'crypt')
endif
diff --git a/autoload/airline/parts.vim b/autoload/airline/parts.vim
index bc5ba95..45761bd 100644
--- a/autoload/airline/parts.vim
+++ b/autoload/airline/parts.vim
@@ -55,7 +55,7 @@ function! airline#parts#mode()
endfunction
function! airline#parts#crypt()
- return g:airline_detect_crypt && !empty(&key) ? g:airline_symbols.crypt : ''
+ return g:airline_detect_crypt && exists("+key") && !empty(&key) ? g:airline_symbols.crypt : ''
endfunction
function! airline#parts#paste()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment