Prevent imap of <CR> if already mapped

This commit is contained in:
Christian Rondeau 2016-12-05 18:17:38 -05:00
parent 0966031234
commit 3b96f8ffeb

View File

@ -564,14 +564,15 @@ function! s:CR(normal, just_mrkr) "{{{
call vimwiki#lst#kbd_cr(a:normal, a:just_mrkr)
endfunction "}}}
if maparg('<CR>', 'i') !~? '<Esc>:VimwikiReturn'
if !hasmapto('VimwikiReturn', 'i')
if maparg('<CR>', 'i') !~? '<Esc>:VimwikiReturn'
inoremap <silent><buffer> <CR> <Esc>:VimwikiReturn 1 5<CR>
endif
if maparg('<S-CR>', 'i') !~? '<Esc>:VimwikiReturn'
endif
if maparg('<S-CR>', 'i') !~? '<Esc>:VimwikiReturn'
inoremap <silent><buffer> <S-CR> <Esc>:VimwikiReturn 2 2<CR>
endif
endif
"Table mappings
if g:vimwiki_table_mappings
inoremap <expr> <buffer> <Tab> vimwiki#tbl#kbd_tab()