fix vscode api inputEditor
This commit is contained in:
@@ -272,9 +272,9 @@
|
|||||||
(print "Enter ${prompt}, then save and close this editor.")
|
(print "Enter ${prompt}, then save and close this editor.")
|
||||||
(let [&mut :Disposable closeEvent null]
|
(let [&mut :Disposable closeEvent null]
|
||||||
(set closeEvent
|
(set closeEvent
|
||||||
(Vscode.workspace.onDidCloseTextDocument
|
(Vscode.window.onDidChangeVisibleTextEditors
|
||||||
->closedDoc
|
->visibleEditors
|
||||||
(when (= closedDoc.fileName doc.fileName)
|
(unless (contains visibleEditors editor)
|
||||||
(closeEvent.dispose)
|
(closeEvent.dispose)
|
||||||
(awaitLet [_ (showTextDocument previousEditor.document)]
|
(awaitLet [_ (showTextDocument previousEditor.document)]
|
||||||
(if editor.document.isDirty (let [error "Input editor for $prompt was closed without saving."] (warningMessage error) (reject error)) (resolve (editor.document.getText))))))))))))
|
(if editor.document.isDirty (let [error "Input editor for $prompt was closed without saving."] (warningMessage error) (reject error)) (resolve (editor.document.getText))))))))))))
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
(defCommand context kiss.evalAndPrint "Evaluate and print a kiss expression's value" "C-; C-e" []
|
(defCommand context kiss.evalAndPrint "Evaluate and print a kiss expression's value" "C-; C-e" []
|
||||||
(let [st (selectedText)]
|
(let [st (selectedText)]
|
||||||
(withValueOrInputEditor st "kiss.evalAndPrint" "// A kiss expression to evaluate"
|
(withValueOrInputEditor st "kiss.evalAndPrint" "A kiss expression to evaluate"
|
||||||
(infoMessage (Std.string (evalString st))))))
|
(infoMessage (Std.string (evalString st))))))
|
||||||
|
|
||||||
(defCommand context kiss.newKissClass "Create a new kiss class" "C-; C-c" []
|
(defCommand context kiss.newKissClass "Create a new kiss class" "C-; C-c" []
|
||||||
|
|||||||
Reference in New Issue
Block a user