Merge pull request #3726 from PmcFizz/patch-1

opt example
This commit is contained in:
Henning Dieterichs 2023-03-08 11:22:41 +01:00 committed by GitHub
commit fe18f2e950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ editor.addCommand(
monaco.KeyCode.Tab, monaco.KeyCode.Tab,
function () { function () {
// services available in `ctx` // services available in `ctx`
alert("my command is executing!"); console.log("my command is executing!");
}, },
"myCondition1 && myCondition2" "myCondition1 && myCondition2"
); );
@ -36,7 +36,7 @@ editor.addCommand(
myCondition1.set(true); myCondition1.set(true);
setTimeout(function () { setTimeout(function () {
alert("now enabling also myCondition2, try pressing Tab!"); console.log("now enabling also myCondition2, try pressing Tab!");
// @ts-ignore // @ts-ignore
myCondition2.set(true); myCondition2.set(true);
// you can use myCondition2.reset() to go back to the default // you can use myCondition2.reset() to go back to the default