SelectNextOccurrence icon indicating copy to clipboard operation
SelectNextOccurrence copied to clipboard

Undo behavior differs with multiple cursors

Open mihe opened this issue 7 years ago • 3 comments

Installed product versions

  • Visual Studio: 15.6.4
  • This extension: 1.2.17

Description

If you write a word or sentence in VS normally, and press Undo, it deletes that entire word/sentence (not entirely sure what they base the grouping on).

However, if you write the same thing with multiple cursors, and press Undo, you instead only delete the last character you wrote. The difference in behavior here is somewhat jarring.

mihe avatar Apr 24 '18 14:04 mihe

I did some initial investigation into this issue, and I believe it'll require using the IOleUndoManager from within CommandTarget::ProcessSelections for the relevant commands. I'm not sure if there's any utilities to recreate the existing behavior used for text grouping, but I suspect you'll have to recreate it manually.

SK83RJOSH avatar Apr 24 '18 15:04 SK83RJOSH

Ah yes this behaviour differs. There is also a possibility to go Sublime-style here I think, and implement a timer to commit an undo-context combined with regular commit-chars. I'll see if I can come up with something

2mas avatar Apr 26 '18 06:04 2mas

Still under investigation, I have not come up with anything really useful yet but if you have any ideas, a pull request i always welcome.

The undo-management branch contains a startingpoint using the view's associated IOleUndoManager, the UndoUnit's Do-action just deletes a char at the moment, which wont work in reality ofcourse.

2mas avatar May 09 '18 09:05 2mas

Closing this as it's been here for five years and I see no way of fixing it at the moment

2mas avatar Mar 13 '23 12:03 2mas