also keep scroll state stable when additional edits come in late, https://github.com/microsoft/vscode/issues/94173
This commit is contained in:
parent
6298d2f0d0
commit
c4f02d6a64
1 changed files with 2 additions and 0 deletions
|
@ -327,10 +327,12 @@ export class SuggestController implements IEditorContribution {
|
|||
if (didType) {
|
||||
this.editor.pushUndoStop();
|
||||
}
|
||||
const scrollState = StableEditorScrollState.capture(this.editor);
|
||||
this.editor.executeEdits(
|
||||
'suggestController.additionalTextEdits.async',
|
||||
item.completion.additionalTextEdits.map(edit => EditOperation.replace(Range.lift(edit.range), edit.text))
|
||||
);
|
||||
scrollState.restoreRelativeVerticalPositionOfCursor(this.editor);
|
||||
if (didType || !(oldFlags & InsertFlags.NoAfterUndoStop)) {
|
||||
this.editor.pushUndoStop();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue