mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(plugin-sql-editor): CB-1474 CB-1464 save cursor position
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user