fix alt L

This commit is contained in:
Mylloon 2024-11-17 17:41:49 +01:00
parent 11c434c50c
commit c3980af266
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,17 +1,28 @@
# This function is typically bound to Alt-L, it is used to list the contents # This function is typically bound to Alt-L, it is used to list the contents
# of the directory under the cursor. # of the directory under the cursor.
# Temporary function as of now it's not bundled in the latest fish release
# https://github.com/fish-shell/fish-shell/commit/9158395d10cfa584a988ba093cf7a93a70b48578
function __fish_echo --description 'run the given command after the current commandline and redraw the prompt'
set -l line (commandline --line)
string >&2 repeat -N \n --count=(math (commandline | count) - $line + 1)
$argv >&2
string >&2 repeat -N \n --count=(math (count (fish_prompt)) - 1)
string >&2 repeat -N \n --count=(math $line - 1)
commandline -f repaint
end
function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory" function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory"
set -l val (commandline -t | string replace -r '^~' "$HOME") set -l val (commandline -t | string replace -r '^~' "$HOME")
set -l cmd set -l cmd
if test -d $val if test -d $val
set cmd eza --icons $val set cmd eza $val
else else
set -l dir (dirname -- $val) set -l dir (dirname -- $val)
if test $dir != . -a -d $dir if test $dir != . -a -d $dir
set cmd eza --icons $dir set cmd eza $dir
else else
set cmd eza --icons set cmd eza
end end
end end
__fish_echo $cmd __fish_echo $cmd