1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-12-04 10:24:50 +02:00

Merge branch 'salexdv:develop' into develop

This commit is contained in:
Sergey Starykh 2021-05-13 12:16:28 +03:00
commit 7a3efbcc21
3 changed files with 56 additions and 42 deletions

View File

@ -118,6 +118,7 @@
| `removeBookmark` | Удаление закладки из строки с указанным номером |
| `goNextBookmark` | Переход к следующей закладке |
| `goPreviousBookmark` | Переход к предыдущей закладке |
| `getBookmarks` | Возвращает массив с номерами строк, в которых установлены закладки |
## События, генерируемые редактором для 1С:Предприятия
| Событие | Описание |

View File

@ -1,5 +1,11 @@
define(['vs/editor/editor.main'], function () {
getSortedBookmarks = function () {
return new Map([...bookmarks.entries()].sort((a, b) => a[0] - b[0]));
}
getBookmarksDecorations = function () {
let bm_decorations = [];
@ -49,7 +55,7 @@ define(['vs/editor/editor.main'], function () {
goNextBookmark = function () {
let sorted_bookmarks = new Map([...bookmarks.entries()].sort());
let sorted_bookmarks = getSortedBookmarks();
if (sorted_bookmarks.size - 1 <= currentBookmark)
currentBookmark = -1;
@ -61,7 +67,7 @@ define(['vs/editor/editor.main'], function () {
goPreviousBookmark = function () {
let sorted_bookmarks = new Map([...bookmarks.entries()].sort());
let sorted_bookmarks = getSortedBookmarks();
currentBookmark--;

View File

@ -1050,6 +1050,13 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
getBookmarks = function () {
let sorted_bookmarks = getSortedBookmarks();
return Array.from(sorted_bookmarks.keys());
}
editor = undefined;
// Register languages
@ -1288,6 +1295,10 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
bookmarks.set(line, prev_bookmark);
bookmarks.delete(line - 1);
}
}
let line_check = getLineCount();
while (line < line_check) {
@ -1309,10 +1320,6 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
}
}
function checkBookmarksAfterRemoveLine(contentChangeEvent) {
if (contentChangeEvent.changes.length) {
@ -1331,6 +1338,12 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
bookmarks.delete(l);
}
prev_bookmark.range.startLineNumber = line;
prev_bookmark.range.endLineNumber = line;
bookmarks.set(line, prev_bookmark);
}
let line_check = range.endLineNumber;
let diff = range.endLineNumber - line;
@ -1349,12 +1362,6 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
prev_bookmark.range.startLineNumber = line;
prev_bookmark.range.endLineNumber = line;
bookmarks.set(line, prev_bookmark);
}
}
}