Try to use the fish_indent that corresponds to the fish binary

Users may install two versions of fish and configure their terminal to run
the one that is second in $PATH.  This is not really what I'd do but it
seems reasonable.  We should not need $PATH for this.

Fixes #10770
This commit is contained in:
Johannes Altmanninger
2024-10-10 05:12:10 +02:00
parent 88e749e4ce
commit edaf011ab1
4 changed files with 14 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
set -l editor (__fish_anyeditor)
or return 1
set -l indented_lines (commandline -b | fish_indent --only-indent)
set -l indented_lines (commandline -b | __fish_indent --only-indent)
string join -- \n $indented_lines >$f
set -l offset (commandline --cursor)
# compute cursor line/column
@@ -91,7 +91,7 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
$editor
set -l raw_lines (command cat $f)
set -l unindented_lines (string join -- \n $raw_lines | fish_indent --only-unindent)
set -l unindented_lines (string join -- \n $raw_lines | __fish_indent --only-unindent)
# Here we're checking the exit status of the editor.
if test $status -eq 0 -a -s $f