From 138d70fd4c93759a444c0c9fcc885a0c2202f9d5 Mon Sep 17 00:00:00 2001 From: truffle Date: Sun, 10 May 2026 14:10:54 +0000 Subject: [PATCH] fix(zsh): drop redundant awk pipeline in language completion `bat --list-languages` already emits each entry in `name:matchers` form, which is the format `_describe` consumes directly. The previous awk script split each line on `:` and re-emitted `$1:$2`, which is byte-identical to the input. Verified with `diff <(bat --list-languages) <(bat --list-languages | awk -F: '{ printf("%s:%s\\n", $1, $2) }')` against the current syntax set. --- assets/completions/bat.zsh.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/completions/bat.zsh.in b/assets/completions/bat.zsh.in index 3991b996..efdb185e 100644 --- a/assets/completions/bat.zsh.in +++ b/assets/completions/bat.zsh.in @@ -90,12 +90,12 @@ _{{PROJECT_EXECUTABLE}}_main() { languages) local IFS=$'\n' local -a languages - # Only offer language names as completion values. The second column - # of `--list-languages` mixes plain extensions with globs (`*.rs`), - # absolute paths (`/etc/profile`), and full filenames - # (`Containerfile`); none of those parse as `-l` arguments. See + # `--list-languages` emits one `name:matchers` line per language, + # which `_describe` parses as `value:description`. Only the + # language name is offered as the completion value; the matchers + # show up as the menu description. See # https://github.com/sharkdp/bat/issues/3735. - languages=( ${(f)"$({{PROJECT_EXECUTABLE}} --color=never --decorations=never --list-languages | awk -F: '{ printf("%s:%s\n", $1, $2) }')"} ) + languages=( ${(f)"$({{PROJECT_EXECUTABLE}} --color=never --decorations=never --list-languages)"} ) _describe 'language' languages && ret=0 ;;