Fixed #486: Relax the map guard

This commit is contained in:
Karl Yngve Lervåg 2016-06-28 15:13:51 +02:00
parent bea8939a94
commit 7234c5a64f

View File

@ -339,8 +339,7 @@ function! s:init_mappings() " {{{1
if !get(g:,'vimtex_mappings_enabled', 1) | return | endif if !get(g:,'vimtex_mappings_enabled', 1) | return | endif
function! s:map(mode, lhs, rhs, ...) function! s:map(mode, lhs, rhs, ...)
if !hasmapto(a:rhs, a:mode) if (a:0 > 0) || (maparg(a:lhs, a:mode) ==# '')
\ && (a:0 > 0 || maparg(a:lhs, a:mode) ==# '')
silent execute a:mode . 'map <silent><buffer>' a:lhs a:rhs silent execute a:mode . 'map <silent><buffer>' a:lhs a:rhs
endif endif
endfunction endfunction