From 12d83112eace571cfa3a7faf00a4054fd3935f3d Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 6 Jun 2026 03:40:43 -0400 Subject: [PATCH] fix(config_help): use string split -m 1 to extract line number and text string split -f does not accept ranges like '2-'; split on the first colon only with -m 1 to correctly separate the grep line number from the heading text without erroring on every heading line. --- functions/config_help.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/config_help.fish b/functions/config_help.fish index 814a6a9..ff90028 100644 --- a/functions/config_help.fish +++ b/functions/config_help.fish @@ -42,8 +42,9 @@ function config_help --description 'Open the offline fish shell configuration ma set -l norm_kw (string lower -- $argv[1] | string replace -ra '[^a-z0-9]' '') set -l found "" for entry in (grep -n "^#" "$doc_file") - set -l lnum (string split -f 1 ':' -- $entry) - set -l text (string split -f 2- ':' -- $entry) + set -l parts (string split -m 1 ':' -- $entry) + set -l lnum $parts[1] + set -l text $parts[2] set -l norm_text (string lower -- $text | string replace -ra '[^a-z0-9]' '') if string match -q "*$norm_kw*" $norm_text set found $lnum