KissConfig refactor quickPickItem

This commit is contained in:
2021-04-02 12:55:16 -06:00
parent 35848dd130
commit fc695e88da

View File

@@ -73,17 +73,18 @@
(awaitLet [kissStr (inputBox)] (awaitLet [kissStr (inputBox)]
(infoMessage (Std.string (evalString kissStr))))) (infoMessage (Std.string (evalString kissStr)))))
(defun :Void runCommand [&opt command] (defun quickPickItem [label]
(if command
{(set lastCommand command) ((dictGet commands command) (selectedText))}
(let [commandList
(for description (commands.keys)
(object (object
label description label label
description null description null
detail null detail null
picked null picked null
alwaysShow null))] alwaysShow null))
(defun :Void runCommand [&opt command]
(if command
{(set lastCommand command) ((dictGet commands command) (selectedText))}
(let [commandList (map (commands.keys) quickPickItem)]
(awaitLet [chosenCommand (quickPick commandList)] (awaitLet [chosenCommand (quickPick commandList)]
(when chosenCommand (when chosenCommand
(set lastCommand chosenCommand.label) (set lastCommand chosenCommand.label)