Skip to content

Commit

Permalink
Define mappings with <nowait> if available, closes #299
Browse files Browse the repository at this point in the history
  • Loading branch information
majutsushi committed Oct 21, 2016
1 parent 040e840 commit a1f416e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion autoload/tagbar.vim
Expand Up @@ -1010,6 +1010,11 @@ function! s:MapKeys() abort
\ ['help', 'ToggleHelp()'],
\ ]

let map_options = ' <script> <silent> <buffer> '
if v:version > 703 || (v:version == 703 && has('patch1261'))
let map_options .= ' <nowait> '
endif

for [map, func] in maps
let def = get(g:, 'tagbar_map_' . map)
if type(def) == type("")
Expand All @@ -1018,7 +1023,7 @@ function! s:MapKeys() abort
let keys = def
endif
for key in keys
execute 'nnoremap <script> <silent> <buffer> ' . key .
execute 'nnoremap' . map_options . key .
\ ' :call <SID>' . func . '<CR>'
endfor
unlet def
Expand Down

0 comments on commit a1f416e

Please sign in to comment.