From 493cbeb84c9146341790ef563434d47f3b4e0fa5 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 13 Jul 2023 18:05:55 +0200 Subject: [PATCH] completions/git: Trim with the regex This gives us another few percent. It's not *technically* the same because `trim` would remove a run of quotes, but that would be wrong anyway. --- share/completions/git.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index b887e8556..ea4d0da5c 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -196,7 +196,7 @@ function __fish_git_files if set -ql untracked # Fast path for untracked files - it is extremely easy to get a lot of these, # so we handle them first - set -l files (string match -rg '^\? (.*)' -- $stats | string trim -c \") + set -l files (string match -rg '^\? "?(.*)"?' -- $stats) set stats (string match -rv '^\? ' -- $stats) printf "$rel%s\n" $files\t$untracked_desc if set -ql colon[1]