From 76d651b0de09139951152103b594fa46111f1a02 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 6 Jun 2026 03:18:47 -0400 Subject: [PATCH] fix(config_help): replace invalid --syntax flag with bat|ov pipeline ov does not support --syntax/--syntax-name. Use bat --color=always piped into ov --jump-target for syntax highlighting + line positioning. Fall back to ov alone (section nav via --section-delimiter) when bat is absent. --- functions/config_help.fish | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/functions/config_help.fish b/functions/config_help.fish index 5901028..6bdbdf2 100644 --- a/functions/config_help.fish +++ b/functions/config_help.fish @@ -47,23 +47,31 @@ function config_help --description 'Open the offline fish shell configuration ma end # ── Viewer fallback chain ──────────────────────────────────── - if type -q ov - ov --syntax --syntax-name markdown \ - --section-delimiter "^#" \ - --section-header \ - +"$start_line" "$doc_file" + # Best case: bat provides syntax color, ov provides paging + line jump. + # Section nav (,/.) is sacrificed when piping bat output because ANSI + # escape codes prevent ^# matching; use / to search instead. + if type -q ov; and type -q bat + bat --color=always --style=plain --language=markdown "$doc_file" \ + | ov --jump-target "$start_line" + # ov alone: full section navigation with ,/. keys; no code highlighting. + else if type -q ov + ov --section-delimiter "^#" \ + --section-header \ + --jump-target "$start_line" \ + "$doc_file" + + # bat alone: syntax highlighting with built-in paging; no line jump. else if type -q bat if test $start_line -gt 1 - # bat can't jump to a line in paging mode; show a hint instead set_color brblack - echo "note: bat pager active — use / to search for your section" >&2 + echo "note: bat pager — use / to search for your section" >&2 set_color normal end bat --language=markdown --paging=always "$doc_file" + # Pre-compiled man page (generated by CI after merge). else if test -f "$man_file" - # Pre-compiled man page as a pager-independent fallback man -l "$man_file" else if type -q less