From ac951427af09efa0cad03a7b04a1a849d341ca92 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 15 Dec 2024 17:27:00 +0100 Subject: [PATCH] Fix alt-l on multiline tokens This would invoke test with extra arguments. --- share/functions/__fish_complete_list.fish | 2 +- share/functions/__fish_complete_lpr_option.fish | 2 +- share/functions/__fish_list_current_token.fish | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/share/functions/__fish_complete_list.fish b/share/functions/__fish_complete_list.fish index 78e563224..2d55c535e 100644 --- a/share/functions/__fish_complete_list.fish +++ b/share/functions/__fish_complete_list.fish @@ -13,7 +13,7 @@ where: or set -l iprefix "" set -q prefix[1] or set -l prefix "" - set -l pat (commandline -t) + set -l pat "$(commandline -t)" #set -l pat $argv[5] switch $pat case "*$div*" diff --git a/share/functions/__fish_complete_lpr_option.fish b/share/functions/__fish_complete_lpr_option.fish index 8d558c83c..97499fe64 100644 --- a/share/functions/__fish_complete_lpr_option.fish +++ b/share/functions/__fish_complete_lpr_option.fish @@ -1,5 +1,5 @@ function __fish_complete_lpr_option --description 'Complete lpr option' - set -l optstr (commandline -t) + set -l optstr "$(commandline -t)" switch $optstr case '*=*' string split -m1 = -- "$optstr" | read -l opt val diff --git a/share/functions/__fish_list_current_token.fish b/share/functions/__fish_list_current_token.fish index 5ecac9fec..b6add51de 100644 --- a/share/functions/__fish_list_current_token.fish +++ b/share/functions/__fish_list_current_token.fish @@ -2,7 +2,7 @@ # of the directory under the cursor. function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory" - set -l val (commandline -t | string replace -r '^~' "$HOME") + set -l val "$(commandline -t | string replace -r '^~' "$HOME")" set -l cmd if test -d $val set cmd ls $val