fix activeTextEditor in VSCode commands
This commit is contained in:
@@ -137,16 +137,20 @@
|
|||||||
// The keyListener handler needs to have access to the Disposible object to dispose itself, hence this let/set
|
// The keyListener handler needs to have access to the Disposible object to dispose itself, hence this let/set
|
||||||
(let [&mut keyListener null]
|
(let [&mut keyListener null]
|
||||||
(set keyListener (shortcutPanel.webview.onDidReceiveMessage
|
(set keyListener (shortcutPanel.webview.onDidReceiveMessage
|
||||||
->key (if (prefixMap.exists key)
|
->:Void key
|
||||||
{(keyListener.dispose)
|
(if (prefixMap.exists key)
|
||||||
|
{
|
||||||
|
(keyListener.dispose)
|
||||||
(case (dictGet prefixMap key)
|
(case (dictGet prefixMap key)
|
||||||
((Prefix innerMap)
|
((Prefix innerMap)
|
||||||
(showShortcutPanel innerMap))
|
(showShortcutPanel innerMap))
|
||||||
((Final command)
|
((Final command)
|
||||||
(shortcutPanel.dispose)
|
(shortcutPanel.dispose)
|
||||||
(Vscode.window.showTextDocument documentBeforeShortcut)
|
(awaitLet [_ (Vscode.window.showTextDocument documentBeforeShortcut)]
|
||||||
(_runCommand command selectedTextBeforeShortcut)))}
|
(_runCommand command selectedTextBeforeShortcut))))
|
||||||
{(warningMessage "$key is not mapped to a shortcut in this context")(return)}))))
|
}
|
||||||
|
|
||||||
|
(warningMessage "$key is not mapped to a shortcut in this context")))))
|
||||||
(set shortcutPanel.webview.html (shortcutPanelHtml prefixMap))
|
(set shortcutPanel.webview.html (shortcutPanelHtml prefixMap))
|
||||||
(shortcutPanel.webview.postMessage (object command "focus")))
|
(shortcutPanel.webview.postMessage (object command "focus")))
|
||||||
|
|
||||||
|
@@ -8,13 +8,10 @@
|
|||||||
|
|
||||||
// Return [sourceFile outputFile]
|
// Return [sourceFile outputFile]
|
||||||
(function :Array<String> splitFileContents []
|
(function :Array<String> splitFileContents []
|
||||||
(infoMessage (activeTextEditor.document.getText)) [])
|
|
||||||
/*
|
|
||||||
(let [fileText (activeTextEditor.document.getText)
|
(let [fileText (activeTextEditor.document.getText)
|
||||||
fileStream (kiss.Stream.fromString fileText)
|
fileStream (kiss.Stream.fromString fileText)
|
||||||
&mut sourceText ""
|
&mut sourceText ""
|
||||||
&mut outputText ""]
|
&mut outputText ""]
|
||||||
(infoMessage fileText)
|
|
||||||
(loop
|
(loop
|
||||||
(case (fileStream.takeUntilAndDrop blockStartEnd)
|
(case (fileStream.takeUntilAndDrop blockStartEnd)
|
||||||
((Some _)
|
((Some _)
|
||||||
@@ -29,22 +26,13 @@
|
|||||||
(None
|
(None
|
||||||
(break))))
|
(break))))
|
||||||
[sourceText outputText]))
|
[sourceText outputText]))
|
||||||
*/
|
|
||||||
|
|
||||||
(function exportKtxt2Files [&opt _]
|
(function exportKtxt2Files [&opt _]
|
||||||
(unless activeTextEditor
|
(infoMessage _)
|
||||||
(infoMessage "FUQQQQ"))
|
(let [[sourceText outputText] (splitFileContents)
|
||||||
(infoMessage activeTextEditor.document.fileName)
|
|
||||||
(infoMessage (activeTextEditor.document.getText))
|
|
||||||
(splitFileContents))
|
|
||||||
/*
|
|
||||||
(let [[sourceText outputText] (splitFileContents)]
|
|
||||||
(infoMessage sourceText)
|
|
||||||
(infoMessage outputText)))/*
|
|
||||||
ktxt2Filename (haxe.io.Path.withoutDirectory activeTextEditor.document.fileName)
|
ktxt2Filename (haxe.io.Path.withoutDirectory activeTextEditor.document.fileName)
|
||||||
[baseFilename sourceExt outputExt ktxt2Ext] (ktxt2Filename.split ".")
|
[baseFilename sourceExt outputExt ktxt2Ext] (ktxt2Filename.split ".")
|
||||||
sourceFilename "${baseFilename}.${sourceExt}"
|
sourceFilename "${baseFilename}.${sourceExt}"
|
||||||
outputFilename "${baseFilename}.${outputExt}"]
|
outputFilename "${baseFilename}.${outputExt}"]
|
||||||
(infoMessage "${sourceFilename}: $sourceText")
|
(infoMessage "${sourceFilename}: $sourceText")
|
||||||
(infoMessage "${outputFilename}: $outputText")))
|
(infoMessage "${outputFilename}: $outputText")))
|
||||||
*/
|
|
Reference in New Issue
Block a user