From 1073ae618aa19e1544462de6e3c0e587e45d8272 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 23 Mar 2022 14:53:10 -0600 Subject: [PATCH] fix showCorrespondingFile --- projects/kiss-vscode/config/KissConfig.kiss | 7 +++++-- projects/kiss-vscode/src/Util.kiss | 2 +- projects/kiss-vscode/src/commands/KissTools.kiss | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/kiss-vscode/config/KissConfig.kiss b/projects/kiss-vscode/config/KissConfig.kiss index 0f759f20..26e73e50 100644 --- a/projects/kiss-vscode/config/KissConfig.kiss +++ b/projects/kiss-vscode/config/KissConfig.kiss @@ -76,9 +76,12 @@ (var &mut :String selectedTextBeforeShortcut null) (var &mut :Disposable keyListener null) -(function :Void closeShortcutPanel [] +(function :Void cancelOrFinishShortcutPanel [] (set documentBeforeShortcut null) (set selectedTextBeforeShortcut null) + (closeShortcutPanel)) + +(function :Void closeShortcutPanel [] (when shortcutPanel (keyListener.dispose) (shortcutPanel.dispose) @@ -165,7 +168,7 @@ (set shortcutHandler.cancelKey "Escape") (set shortcutHandler.onSelectPrefixMap showShortcutPanel) (set shortcutHandler.onSelectItem runChosenCommand) - (set shortcutHandler.onFinishOrCancel closeShortcutPanel) + (set shortcutHandler.onFinishOrCancel cancelOrFinishShortcutPanel) (set shortcutHandler.onBadKey ->:Void [key map] (warningMessage "$key is not mapped to a shortcut in $map")) (set shortcutHandler.onBadShortcut ->:Void [key otherKey] (warningMessage "$key conflicts with $otherKey")) diff --git a/projects/kiss-vscode/src/Util.kiss b/projects/kiss-vscode/src/Util.kiss index 0bd5e0b6..c00f05b5 100644 --- a/projects/kiss-vscode/src/Util.kiss +++ b/projects/kiss-vscode/src/Util.kiss @@ -114,7 +114,7 @@ (openFile dirOrFile))))))) // This has to be a macro so it can return from tryLoadConfig -// TODO this macro should use gensyms +// TODO this macro should use gensym (defMacro trySpawnSync [command args options onError] `(let [command ,command args ,args diff --git a/projects/kiss-vscode/src/commands/KissTools.kiss b/projects/kiss-vscode/src/commands/KissTools.kiss index 6e7a6263..54317e0a 100644 --- a/projects/kiss-vscode/src/commands/KissTools.kiss +++ b/projects/kiss-vscode/src/commands/KissTools.kiss @@ -49,4 +49,4 @@ class ${className} {} "${base}.${correspondingExt}")) (function showCorrespondingFile [&opt _] - (showTextDocument (Uri.file (correspondingFile activeTextEditor.document.fileName)))) \ No newline at end of file + (showTextDocument (Uri.file (correspondingFile .fileName .document activeTextEditor)))) \ No newline at end of file