[vim] can't repeat insert mode changes after vA #2894

Closed
opened 2014-10-27 21:15:20 +01:00 by marijnh · 1 comment
marijnh commented 2014-10-27 21:15:20 +01:00 (Migrated from gitlab.com)

error is thrown because selectionEnd is undefined in enterInsertMode

To test this add

  eq('testhello\nmehello\npleahellose', cm.getValue());
  helpers.doKeys('<Esc>');
  cm.setCursor(0, 0);
  helpers.doKeys('.');
  eq('hellotesthello\nhellomehello\nhellopleahellose', cm.getValue());

at the end of A_visual_block test.

error is thrown because `selectionEnd` is undefined in [enterInsertMode](https://github.com/codemirror/CodeMirror/blob/4902d070c9ba400d2b312733861c32a51ec8cfd1/keymap/vim.js#L2068) To test this add ``` js eq('testhello\nmehello\npleahellose', cm.getValue()); helpers.doKeys('<Esc>'); cm.setCursor(0, 0); helpers.doKeys('.'); eq('hellotesthello\nhellomehello\nhellopleahellose', cm.getValue()); ``` at the end of [A_visual_block](https://github.com/codemirror/CodeMirror/blob/4902d070c9ba400d2b312733861c32a51ec8cfd1/test/vim_test.js#L1280) test.
marijnh commented 2014-11-03 01:00:29 +01:00 (Migrated from gitlab.com)

Sorry for taking so long to get to this. I added a quick fix 2b8106f to make vim fail more gracefully so that it doesn't hang when this happens, but doesn't address the root issue.

The correct end result should actually be

teshellothello
me hello hello
plehelloahellose

Which is not trivial to get right... I'm going to think more on this before attempting a real fix.

Sorry for taking so long to get to this. I added a quick fix 2b8106f to make vim fail more gracefully so that it doesn't hang when this happens, but doesn't address the root issue. The correct end result should actually be ``` teshellothello me hello hello plehelloahellose ``` Which is not trivial to get right... I'm going to think more on this before attempting a real fix.
marijnh (Migrated from gitlab.com) closed this issue 2022-07-19 10:38:36 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#2894
No description provided.