fix(plugin-sql-editor): CB-1474 CB-1464 save cursor position

This commit is contained in:
Wroud
2021-12-13 13:18:41 +03:00
parent a1dae4fbfb
commit abe78de99f
2 changed files with 7 additions and 1 deletions
@@ -54,7 +54,7 @@ export const TableGrid = observer<Props>(function TableGrid({
DatabaseEditAction
);
if (editor?.isEdited()) {
if (editor?.isEdited() && model.source.executionContext?.context) {
const result = await commonDialogService.open(ConfirmationDialog, {
title: 'data_viewer_result_edited_title',
message: 'data_viewer_result_edited_message',
@@ -282,8 +282,14 @@ export class SqlEditorController implements IInitializableController, IDestructi
};
setQuery(query: string): void {
const editorPosition = this.editor?.getCursor();
this.state.query = query;
this.parser.setScript(query);
if (editorPosition && this.editor) {
this.editor.setCursor(editorPosition);
}
}
private async executeQueryAction(