mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 08:56:00 +00:00
execute current query
This commit is contained in:
@@ -75,6 +75,18 @@
|
||||
return editor;
|
||||
}
|
||||
|
||||
export function getCurrentCommandText(): string {
|
||||
if (currentPart != null) return currentPart.text;
|
||||
if (!editor) return '';
|
||||
const selectedText = editor.getSelectedText();
|
||||
if (selectedText) return selectedText;
|
||||
if (editor.getHighlightActiveLine()) {
|
||||
const line = editor.getSelectionRange().start.row;
|
||||
return editor.session.getLine(line);
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
const requireEditorPlugins = () => {};
|
||||
requireEditorPlugins();
|
||||
|
||||
@@ -155,7 +167,18 @@
|
||||
|
||||
function changedCurrentQueryPart() {
|
||||
if (queryParts.length <= 1) return;
|
||||
const cursor = editor.getSelectionRange().start;
|
||||
const selectionRange = editor.getSelectionRange();
|
||||
|
||||
if (
|
||||
selectionRange.start.row != selectionRange.end.row ||
|
||||
selectionRange.start.column != selectionRange.end.column
|
||||
) {
|
||||
removeCurrentPartMarker();
|
||||
currentPart = null;
|
||||
return;
|
||||
}
|
||||
|
||||
const cursor = selectionRange.start;
|
||||
const part = queryParts.find(
|
||||
x =>
|
||||
((cursor.row == x.startLine && cursor.column >= x.startColumn) || cursor.row > x.startLine) &&
|
||||
|
||||
Reference in New Issue
Block a user