Skip to content

Conversation

djjcast
Copy link

@djjcast djjcast commented Dec 12, 2015

Here's a potential fix for issue #13. To test the fix, edit a file with the following contents:

foo
foo
foo
foo
foo
foo
foo

Then search/foo<CR>, record a macro ggqqciwbar<Esc>nq, and execute the macro a few times 4@q. The important part of the macro that's being tested is the <Esc>n sequence, which vim-rsi remaps.

Closes tpope#13

The CursorHoldI event isn't triggered during macro execution, even when
updatetime is set to zero. We can use this 'feature' to create mappings
on the CursorHoldI event only when the user manually enters Insert mode.
@tpope
Copy link
Owner

tpope commented Dec 13, 2015

I think anything this dicey should probably just be made into a separate, general purpose plugin, no? RSI continues to provide <M-b> and the like but drops the escape code shenanigans, and the new plugin delegates all 26 letters or so.

@djjcast
Copy link
Author

djjcast commented Dec 13, 2015

Sure, I can see this being a separate plugin. Feel free to use and refactor the code however you think is best.

Yeah, it's a dicey hack but seems to work consistently. I'm not sure why we have to use cnoremap <buffer><nowait> <Esc> <C-c> instead of cnoremap <buffer><nowait> <Esc> <Esc>; the latter mapping causes <Esc> to always behave like the x flag is set in cpoptions for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants