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