From 3b7f15bbbfa6b1f216fa9fd397687b217a77552a Mon Sep 17 00:00:00 2001 From: salexdv Date: Wed, 14 Sep 2022 12:29:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B2=D1=8B=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D1=82=D0=B0=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B6=D0=B0=D1=82=D1=8B=D0=BC=20CTRL=20#290?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/editor.js b/src/editor.js index c7b26ce..415c53c 100644 --- a/src/editor.js +++ b/src/editor.js @@ -1726,8 +1726,12 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit let target = editor.getModel().getWordAtPosition(position); - if (target) - setSelection(position.lineNumber, target.startColumn, position.lineNumber, target.endColumn) + if (target) { + let current_selection = editor.getSelection(); + let target_selection = new monaco.Range(position.lineNumber, target.startColumn, position.lineNumber, target.endColumn); + if (!current_selection.containsRange(target_selection)) + setSelection(position.lineNumber, target.startColumn, position.lineNumber, target.endColumn) + } }