From 11f0ace9b6bf7cf618a42de7e37d9608d2d86d99 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 7 Nov 2023 18:01:54 +1100 Subject: Make shell-script-candidates completer run in the background Read output from the script as it comes and update the candidate list progressively. Disable updating of the list when a completion has been explicitely selected. --- test/shell/prompt-shell-script-candidates/cmd | 2 +- test/shell/prompt-shell-script-candidates/rc | 1 + test/shell/prompt-shell-script-candidates/script | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/shell/prompt-shell-script-candidates/script (limited to 'test/shell') diff --git a/test/shell/prompt-shell-script-candidates/cmd b/test/shell/prompt-shell-script-candidates/cmd index 7cc38390..8b137891 100644 --- a/test/shell/prompt-shell-script-candidates/cmd +++ b/test/shell/prompt-shell-script-candidates/cmd @@ -1 +1 @@ -:foob + diff --git a/test/shell/prompt-shell-script-candidates/rc b/test/shell/prompt-shell-script-candidates/rc index 6aaaf259..82e4e62e 100644 --- a/test/shell/prompt-shell-script-candidates/rc +++ b/test/shell/prompt-shell-script-candidates/rc @@ -1,3 +1,4 @@ +set-option global autocomplete prompt define-command foo %{ prompt -shell-script-candidates %{ printf 'foo\nbar\nhaz\n' } ': ' %{exec i %val{text} } } diff --git a/test/shell/prompt-shell-script-candidates/script b/test/shell/prompt-shell-script-candidates/script new file mode 100644 index 00000000..231c8725 --- /dev/null +++ b/test/shell/prompt-shell-script-candidates/script @@ -0,0 +1,7 @@ +ui_out -ignore 7 +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ ":foob" ] }' +ui_out -ignore 4 +ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [false] }' +ui_out -ignore 3 +ui_out '{ "jsonrpc": "2.0", "method": "menu_show", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "bar" }]], { "line": 0, "column": 0 }, { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "white", "underline": "default", "attributes": [] }, "prompt"] }' +ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "" ] }' -- cgit v1.2.3