Merge pull request #264 from christianrondeau/check-before-imap-cr

Prevent imap of `<CR>` if already mapped
This commit is contained in:
EinfachToll 2016-12-06 08:42:28 +01:00 committed by GitHub
commit bb75ec6deb

View File

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