From ddc4f7bf6da14a84fa04495af69f6dc93be17f63 Mon Sep 17 00:00:00 2001 From: tormozit <11896251+tormozit@users.noreply.github.com> Date: Fri, 4 Nov 2022 16:36:07 +0300 Subject: [PATCH 1/2] Update editor.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Асинхронное выполнение setOption() не совместимо со старым API и рождает много скрытых проблем https://github.com/salexdv/bsl_console/issues/297 --- src/editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor.js b/src/editor.js index 73f1447..1cd40b0 100644 --- a/src/editor.js +++ b/src/editor.js @@ -1121,7 +1121,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit setOption = function (optionName, optionValue) { - setTimeout(() => { + // setTimeout(() => { // Асинхронное выполнение не совместимо со старым API и рождает много скрытых проблем https://github.com/salexdv/bsl_console/issues/297 editor[optionName] = optionValue; editor_options[optionName] = optionValue; @@ -1138,7 +1138,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit if (optionName == 'generateSuggestActivationEvent') startStopSuggestActivationObserver(); - }, 10); + // }, 10); } From 5066cddacc7c13d5bcf847a5eeb8ea6748643945 Mon Sep 17 00:00:00 2001 From: tormozit <11896251+tormozit@users.noreply.github.com> Date: Fri, 4 Nov 2022 17:44:47 +0300 Subject: [PATCH 2/2] Update editor.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправлена потеря первой декорации https://github.com/salexdv/bsl_console/issues/296#issuecomment-1303625104 --- src/editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/editor.js b/src/editor.js index 1cd40b0..f9f21d2 100644 --- a/src/editor.js +++ b/src/editor.js @@ -1818,8 +1818,9 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit // #region non-public functions function getLineNumber(originalLineNumber) { - if (originalLineNumber < lineNumbersDedocrations.length) - return lineNumbersDedocrations[originalLineNumber] + ' ' + originalLineNumber; + // Исправлена потеря первой декорации https://github.com/salexdv/bsl_console/issues/296#issuecomment-1303625104 + if (originalLineNumber <= lineNumbersDedocrations.length) + return lineNumbersDedocrations[originalLineNumber - 1] + ' ' + originalLineNumber; return originalLineNumber;