From 45a3f4f1d62b02297660659180f8d1ccaa58dc82 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 13 Oct 2025 16:37:56 +0200 Subject: [PATCH] fish_config prompt {choose,save}: remove dead code Introduced by dd0d45f88fa (fish_config prompt: remove dead code, 2025-09-28). --- share/functions/fish_config.fish | 33 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/share/functions/fish_config.fish b/share/functions/fish_config.fish index eda47d83d..2892b7d44 100644 --- a/share/functions/fish_config.fish +++ b/share/functions/fish_config.fish @@ -125,13 +125,11 @@ function fish_config --description "Launch fish's web based configuration" end set -l found false - for f in $prompt_dir/$argv[1].fish - if test -f $f - __fish_config_prompt_choose - source $f - set found true - break - end + set -l f $prompt_dir/$argv[1].fish + if set -q f[1] && test -f $f + __fish_config_prompt_choose + source $f + set found true end if not $found if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null @@ -160,18 +158,17 @@ function fish_config --description "Launch fish's web based configuration" set -l have if set -q argv[1] - for f in $prompt_dir/$argv[1].fish - if test -f $f - set have $f - # Set the functions to empty so we empty the file - # if necessary. - function fish_prompt - end - function fish_right_prompt - end - source $f - or return 2 + set -l f $prompt_dir/$argv[1].fish + if set -q f[1] && test -f $f + set have $f + # Set the functions to empty so we empty the file + # if necessary. + function fish_prompt end + function fish_right_prompt + end + source $f + or return 2 end if not set -q have[1] if status list-files tools/web_config/sample_prompts/$argv[1].fish &>/dev/null