mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 01:25:38 -05:00
Merge from vscode 1ce89e2cb720d69c496c2815c4696ee4fd4429a6 (#6779)
* Merge from vscode 1ce89e2cb720d69c496c2815c4696ee4fd4429a6 * redisable accounts because of issues
This commit is contained in:
@@ -33,7 +33,7 @@ import { ISelection, Selection } from 'vs/editor/common/core/selection';
|
||||
import { InternalEditorAction } from 'vs/editor/common/editorAction';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { EndOfLinePreference, IIdentifiedSingleEditOperation, IModelDecoration, IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';
|
||||
import { EndOfLinePreference, IIdentifiedSingleEditOperation, IModelDecoration, IModelDecorationOptions, IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel, ICursorStateComputer } from 'vs/editor/common/model';
|
||||
import { ClassName } from 'vs/editor/common/model/intervalTree';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
|
||||
import { IModelContentChangedEvent, IModelDecorationsChangedEvent, IModelLanguageChangedEvent, IModelLanguageConfigurationChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/model/textModelEvents';
|
||||
@@ -980,7 +980,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
return true;
|
||||
}
|
||||
|
||||
public executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: Selection[]): boolean {
|
||||
public executeEdits(source: string, edits: IIdentifiedSingleEditOperation[], endCursorState?: ICursorStateComputer | Selection[]): boolean {
|
||||
if (!this._modelData) {
|
||||
return false;
|
||||
}
|
||||
@@ -989,14 +989,16 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
return false;
|
||||
}
|
||||
|
||||
this._modelData.model.pushEditOperations(this._modelData.cursor.getSelections(), edits, () => {
|
||||
return endCursorState ? endCursorState : null;
|
||||
});
|
||||
|
||||
if (endCursorState) {
|
||||
this._modelData.cursor.setSelections(source, endCursorState);
|
||||
let cursorStateComputer: ICursorStateComputer;
|
||||
if (!endCursorState) {
|
||||
cursorStateComputer = () => null;
|
||||
} else if (Array.isArray(endCursorState)) {
|
||||
cursorStateComputer = () => endCursorState;
|
||||
} else {
|
||||
cursorStateComputer = endCursorState;
|
||||
}
|
||||
|
||||
this._modelData.cursor.executeEdits(source, edits, cursorStateComputer);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user