imap_mappings: do not swallow leader outside math

This commit is contained in:
Enno Nagel 2015-11-12 19:38:37 +01:00
parent b9ddd1df7b
commit ee523987ba

View File

@ -49,7 +49,7 @@ function! vimtex#imaps#add_map(map) " {{{1
" Apply wrapper " Apply wrapper
if l:wrapper !=# '' && exists('*' . l:wrapper) if l:wrapper !=# '' && exists('*' . l:wrapper)
let l:rhs = call(l:wrapper, [l:lhs, l:rhs]) let l:rhs = call(l:wrapper, [l:leader . l:lhs, l:rhs])
endif endif
" Add mapping " Add mapping
@ -63,7 +63,7 @@ endfunction
" "
function! s:wrap_math(lhs, rhs) " {{{1 function! s:wrap_math(lhs, rhs) " {{{1
return '<c-r>=<sid>is_math() ? ' . string(a:rhs) return '<c-r>=<sid>is_math() ? ' . string(a:rhs)
\ . ' : ' . string(a:lhs) . '<cr>' \ . ' : ' . string(a:lhs) . '<cr>'
endfunction endfunction
" }}}1 " }}}1