mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-15 21:33:47 -05:00
map <cr> only if not already mapped
This commit is contained in:
@@ -421,7 +421,14 @@ fun! pencil#init(...) abort
|
||||
ino <buffer> : :<c-g>u
|
||||
ino <buffer> <c-u> <c-g>u<c-u>
|
||||
ino <buffer> <c-w> <c-g>u<c-w>
|
||||
|
||||
" map <cr> only if not already mapped
|
||||
if empty(maparg('<cr>', 'n'))
|
||||
ino <buffer> <cr> <c-g>u<cr>
|
||||
let b:pencil#cr_mapped = 1
|
||||
el
|
||||
let b:pencil#cr_mapped = 0
|
||||
en
|
||||
el
|
||||
sil! iu <buffer> .
|
||||
sil! iu <buffer> !
|
||||
@@ -431,8 +438,12 @@ fun! pencil#init(...) abort
|
||||
sil! iu <buffer> :
|
||||
sil! iu <buffer> <c-u>
|
||||
sil! iu <buffer> <c-w>
|
||||
|
||||
" unmap <cr> only if we mapped it ourselves
|
||||
if exists('b:pencil#cr_mapped') && b:pencil#cr_mapped
|
||||
sil! iu <buffer> <cr>
|
||||
en
|
||||
en
|
||||
endf
|
||||
|
||||
" attempt to find a non-zero textwidth, etc.
|
||||
|
||||
Reference in New Issue
Block a user