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

Признак CTRL/ALT/SHIFT в событии BEFORE_HOVER closes #98

This commit is contained in:
salexdv 2021-05-11 11:48:32 +03:00
parent d85fce88f8
commit 19c2532391
3 changed files with 29 additions and 12 deletions

View File

@ -4737,7 +4737,10 @@ class bslHelper {
word: this.model.getWordAtPosition(this.position),
token: token,
line: this.lineNumber,
column: this.column
column: this.column,
altKey: altPressed,
ctrlKey: ctrlPressed,
shiftKey: shiftPressed
}
sendEvent('EVENT_BEFORE_HOVER', params);
}

View File

@ -445,9 +445,9 @@ define([], function () {
},
hoverProvider: {
provideHover: function (model, position) {
if (!ctrlPressed) {
let bsl = new bslHelper(model, position);
bsl.onProvideHover();
let bsl = new bslHelper(model, position);
bsl.onProvideHover();
if (!ctrlPressed) {
return bsl.getHover();
}
else {
@ -498,9 +498,9 @@ define([], function () {
},
hoverProvider: {
provideHover: function (model, position) {
if (!ctrlPressed) {
let bsl = new bslHelper(model, position);
bsl.onProvideHover();
let bsl = new bslHelper(model, position);
bsl.onProvideHover();
if (!ctrlPressed) {
return bsl.getCustomHover();
}
else {
@ -544,9 +544,9 @@ define([], function () {
},
hoverProvider: {
provideHover: function (model, position) {
if (!ctrlPressed) {
let bsl = new bslHelper(model, position);
bsl.onProvideHover();
let bsl = new bslHelper(model, position);
bsl.onProvideHover();
if (!ctrlPressed) {
return bsl.getCustomHover();
}
else {

View File

@ -26,6 +26,8 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
generateBeforeSignatureEvent = false;
statusBarWidget = null;
ctrlPressed = false;
altPressed = false;
shiftPressed = false;
reserMark = function() {
@ -1061,14 +1063,26 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
if (e.ctrlKey)
ctrlPressed = true;
ctrlPressed = true;
if (e.altKey)
altPressed = true;
if (e.shiftKey)
shiftPressed = true;
});
editor.onKeyUp(e => {
if (e.ctrlKey)
ctrlPressed = false;
ctrlPressed = false;
if (e.altKey)
altPressed = false;
if (e.shiftKey)
shiftPressed = false;
});