Menu

#196 Visual highlight broken after running mapped colon command

Major
open
nobody
None
5
2019-06-19
2019-06-19
larshson
No

If mapping a colon command and running it on a visual selection, the visual selection highlighting is broken until doing a manual colon command.
Example: map ,, to :><cr>
Select a bunch of lines with visual line selection and run ,,
This map will indent the visual selection, however after this the visual selection highlighting is broken.</cr>

Just running :<enter> will fix the broken selection, but it is irritating enough.</enter>

More, perhaps irrelevant details:
The example above is a pretty bad one because why not just type '>>' on the selection, but it was an example i could think of. The reason for noticing this is that i did a hacky implementation of another colon command in jVI core for toggling commenting on one or several lines. I mapped this colon command, like above, and noticed the weird behavior, first thinking it had to do with my code.

I searched for other ways of implementing the toggle-comment, for example by trying to call MainMenuAction$ToggleCommentAction from the nbvi code, but I didn't get it to work. This way it would have been language independent also. Any tips on that account?

Discussion


Log in to post a comment.

MongoDB Logo MongoDB