You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pasting in visual mode, the last character in the selection (the character under the cursor) is not replaced. To reproduce, enter into visual mode, make a selection, press yank, make the same selection again, and then paste.
I tried to dig into this a bit and noticed that, when yanking, there is a one character offset added to either the head or the anchor (see makeCmSelection, L3116 to L3119). This doesn't happen when pasting. I came up with a naive solution by adding 1 to selectionEnd.ch after L2597:
var selectionEnd = selectedArea[1];
// Added the following two lines
selectionEnd.ch += 1;
cm.setSelection(selectionStart, selectionEnd)
var selectedText = cm.getSelection();
It would be great to get this behavior fixed so that it mimics vim :) Thanks so much!
The text was updated successfully, but these errors were encountered:
When pasting in visual mode, the last character in the selection (the character under the cursor) is not replaced. To reproduce, enter into visual mode, make a selection, press yank, make the same selection again, and then paste.
I tried to dig into this a bit and noticed that, when yanking, there is a one character offset added to either the head or the anchor (see
makeCmSelection
, L3116 to L3119). This doesn't happen when pasting. I came up with a naive solution by adding1
toselectionEnd.ch
after L2597:It would be great to get this behavior fixed so that it mimics vim :) Thanks so much!
The text was updated successfully, but these errors were encountered: