Skip to content

Commit

Permalink
Give up on mapping if a <buffer> <CR> map exists
Browse files Browse the repository at this point in the history
If we can't see the existing global map, we can't use it to define a new
one.

References: #131
  • Loading branch information
tpope committed Mar 25, 2022
1 parent 8faf48b commit e6d11b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/endwise.vim
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ imap <script> <Plug>(endwise-append) <SID>(endwise-append)
imap <script> <Plug>DiscretionaryEnd <SID>(endwise-append)
function! s:DefineMap() abort
if exists('g:endwise_no_mappings') || maparg('<CR>','i') =~# '[eE]ndwise\|<Plug>DiscretionaryEnd'
if exists('g:endwise_no_mappings') || maparg('<CR>','i') =~# '[eE]ndwise\|<Plug>DiscretionaryEnd' || get(maparg('<CR>', 'i', 0, 1), 'buffer')
return
endif
if get(maparg('<CR>', 'i', 0, 1), 'expr')
Expand Down

2 comments on commit e6d11b2

@grr
Copy link

@grr grr commented on e6d11b2 Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this change, the mapping no longer works if the delimitmate plugin is installed.

@tpope
Copy link
Owner Author

@tpope tpope commented on e6d11b2 Apr 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't reproduce, even with let g:delimitMate_expand_cr = 1. If you can provide instructions for reproducing, open an issue.

Please sign in to comment.