1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-28 08:48:48 +02:00

Доработка позиционирования при установке выделения #291

This commit is contained in:
salexdv 2022-09-12 20:24:04 +03:00
parent 79f4917fa5
commit 1337db4d96

View File

@ -432,7 +432,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
if (endLineNumber <= getLineCount()) {
let range = new monaco.Range(startLineNumber, startColumn, endLineNumber, endColumn);
editor.setSelection(range);
editor.revealLineInCenterIfOutsideViewport(startLineNumber);
editor.revealPositionInCenterIfOutsideViewport(range.getEndPosition());
return true;
}
else
@ -446,7 +446,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
let endPosition = editor.getModel().getPositionAt(end - 1);
let range = new monaco.Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column);
editor.setSelection(range);
editor.revealPositionInCenterIfOutsideViewport(startPosition);
editor.revealPositionInCenterIfOutsideViewport(endPosition);
return true;