From ae46cc025b38a2e17535f2ce990f4a72d5c598af Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sat, 5 Apr 2014 19:08:54 +1300 Subject: [PATCH] Better mapping init, closes #203 If someone already has a function that includes "JumpToTag" in its name then the current method of detecting whether mappings should be initialized would fail. Use a buffer-local variable instead. --- autoload/tagbar.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 90b6935..7e3efcb 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -957,6 +957,8 @@ function! s:MapKeys() abort endfor unlet def endfor + + let b:tagbar_mapped_keys = 1 endfunction " s:CreateAutocommands() {{{2 @@ -1820,7 +1822,7 @@ function! s:InitWindow(autoclose) abort let cpoptions_save = &cpoptions set cpoptions&vim - if !hasmapto('JumpToTag', 'n') + if !exists('b:tagbar_mapped_keys') call s:MapKeys() endif