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
In the process of working on a Vim plugin for VSCode I've run into a number of areas where I need a little bit of API help. Apologies if any of my suggestions already exist!
Vim's undo/redo history diverges from VSCode's almost immediately, since multiple changes in Vim can be considered a single undo step. This is very important just about everywhere in Vim, and is especially important in things like macros which combine multiple actions into a single step.
It was not always like that. I changed it due to feedback from extension writers - #4313
I have a feeling that neither way makes everyone happy (i.e. some prefer to have undo stops before and after their edits, and some prefer not to), and we need additional options to textEditor.edit
That being said, you could try to workaround it. From your example about macros, why not make all the edits caused by a macro in a single textEditor.edit call...
That being said, you could try to workaround it. From your example about macros, why not make all the edits caused by a macro in a single textEditor.edit call...
If I understand right, that's not possible, because a macro could insert and delete in overlapping regions, which is something the TextEditorEdit doesn't support.
Indeed, the TextEditor.edit can handle multiple edits, but their semantic is that they are "parallel" (all applied at once), not "sequential" (applied in strict order with side-effects to the ones following).
Activity
alexdima commentedon Jun 28, 2016
The edits coming in from the extension host (i.e.
textEditor.edit) eventually reach https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/commonCodeEditor.ts#L599It pushes an undo stop before and after the edit.
It was not always like that. I changed it due to feedback from extension writers - #4313
I have a feeling that neither way makes everyone happy (i.e. some prefer to have undo stops before and after their edits, and some prefer not to), and we need additional options to
textEditor.editThat being said, you could try to workaround it. From your example about macros, why not make all the edits caused by a macro in a single
textEditor.editcall...johnfn commentedon Jun 30, 2016
alexandrudima
If I understand right, that's not possible, because a macro could insert and delete in overlapping regions, which is something the TextEditorEdit doesn't support.
alexdima commentedon Jul 8, 2016
Indeed, the
TextEditor.editcan handle multiple edits, but their semantic is that they are "parallel" (all applied at once), not "sequential" (applied in strict order with side-effects to the ones following).Fixes microsoft#8096: Add `options` to TextEditor.edit that allows to…