1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2025-02-19 19:10:09 +02:00

Функция для сохранения/восстановления состояния

This commit is contained in:
salexdv 2021-05-28 11:25:04 +03:00
parent 6137c2ad76
commit abcbba43e0

View File

@ -1293,6 +1293,24 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
saveViewState = function () {
return JSON.stringify(editor.saveViewState());
}
restoreViewState = function (state) {
try {
editor.restoreViewState(JSON.parse(state));
return true;
}
catch (e) {
return { errorDescription: e.message };
}
}
editor = undefined;
// Register languages