fix showCorrespondingFile

This commit is contained in:
2022-03-23 14:53:10 -06:00
parent ae45fb3e74
commit 1073ae618a
3 changed files with 7 additions and 4 deletions

View File

@@ -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"))

View File

@@ -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

View File

@@ -49,4 +49,4 @@ class ${className} {}
"${base}.${correspondingExt}"))
(function showCorrespondingFile [&opt _]
(showTextDocument (Uri.file (correspondingFile activeTextEditor.document.fileName))))
(showTextDocument (Uri.file (correspondingFile .fileName .document activeTextEditor))))