From 5ab19c3fae4bcb6b50911eaffd3bf2d10673be4e Mon Sep 17 00:00:00 2001 From: lana-k Date: Tue, 4 May 2021 16:33:37 +0200 Subject: [PATCH] show hint in codemirror on Ctrl+Space --- src/App.vue | 3 +++ src/views/Main/Editor/Tabs/Tab/SqlEditor/hint.js | 5 +++++ src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 08b4b2d..fc0d279 100644 --- a/src/App.vue +++ b/src/App.vue @@ -60,4 +60,7 @@ button, body { margin: 0; } +.CodeMirror-hints { + z-index: 999 !important; +} diff --git a/src/views/Main/Editor/Tabs/Tab/SqlEditor/hint.js b/src/views/Main/Editor/Tabs/Tab/SqlEditor/hint.js index e1e7d8a..50ae214 100644 --- a/src/views/Main/Editor/Tabs/Tab/SqlEditor/hint.js +++ b/src/views/Main/Editor/Tabs/Tab/SqlEditor/hint.js @@ -33,6 +33,10 @@ const hintOptions = { alignWithWord: false } +export function showHintOnDemand (editor) { + CM.showHint(editor, getHints, hintOptions) +} + export default function showHint (editor) { // Don't show autocomplete after a space or semicolon or in string literals const token = editor.getTokenAt(editor.getCursor()) @@ -41,5 +45,6 @@ export default function showHint (editor) { if (tokenType === 'string' || !ch || ch === ' ' || ch === ';') { return } + CM.showHint(editor, getHints, hintOptions) } diff --git a/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue b/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue index 01ea7e1..23721f4 100644 --- a/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue +++ b/src/views/Main/Editor/Tabs/Tab/SqlEditor/index.vue @@ -5,7 +5,7 @@