From a2566bf82159de40dfcea28ba547ee3649ab3fcb Mon Sep 17 00:00:00 2001 From: mortang2410 Date: Tue, 9 Oct 2018 12:33:59 -0700 Subject: [PATCH] preserved old variable --- README.md | 2 +- plugin/bclose.vim | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de582ab..3a5fdcd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ The reason for adding it here is to be able to add it to an existing Janus bundl ## Bindings -BClose binds `bd` to `:Bclose` unless `g:bclose_no_plugin_maps` exists and is `true`. +BClose binds `bd` to `:Bclose` unless `g:bclose_no_plugin_maps` or `g:no_plugin_maps` is set to `true`. ## Contributing diff --git a/plugin/bclose.vim b/plugin/bclose.vim index d0f5277..232763f 100644 --- a/plugin/bclose.vim +++ b/plugin/bclose.vim @@ -70,6 +70,11 @@ function! s:Bclose(bang, buffer) execute wcurrent.'wincmd w' endfunction command! -bang -complete=buffer -nargs=? Bclose call Bclose('', '') -if !exists ("g:bclose_no_plugin_maps") || !g:bclose_no_plugin_maps - nnoremap bd :Bclose + +if exists ("g:bclose_no_plugin_maps") && g:bclose_no_plugin_maps + "do nothing +elseif exists ("g:no_plugin_maps") && g:no_plugin_maps + "do nothing +else + nnoremap bd :Bclose endif