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

Доработка клавиш для выбора текущей строки подсказки #120

This commit is contained in:
salexdv 2021-05-17 23:11:14 +03:00
parent 11e15e5be2
commit 79abf7211c

View File

@ -1246,15 +1246,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
if (e.shiftKey)
shiftPressed = true;
if (Array.isArray(activeSuggestionAcceptors) && 0 <= activeSuggestionAcceptors.indexOf(e.browserEvent.key.toLowerCase())) {
element = document.querySelector('.monaco-list-row.focused');
if (element) {
editor.trigger('', 'acceptSelectedSuggestion');
}
}
});
editor.onKeyUp(e => {
@ -1473,6 +1465,22 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
document.onkeypress = function (e) {
let char = String.fromCharCode(e.keyCode);
if (Array.isArray(activeSuggestionAcceptors) && 0 <= activeSuggestionAcceptors.indexOf(char.toLowerCase())) {
let element = document.querySelector('.monaco-list-row.focused');
if (element) {
editor.trigger('', 'acceptSelectedSuggestion');
}
}
};
window.addEventListener('resize', function(event) {
resizeStatusBar();