diff options
author | Owen Richardson <owen.a.richardson@gmail.com> | 2015-11-13 06:06:35 +0000 |
---|---|---|
committer | Kurtis Rader <krader@skepticism.us> | 2016-03-18 15:53:29 -0700 |
commit | 9f0417b587ac6cec7343e287c12886adc459e01c (patch) | |
tree | 99526e8571a54815adc98932c6a09bb4e4b8cfeb /share/functions | |
parent | 03460a3928e7545ebef736b1c0be94e79734c725 (diff) |
make alt-L output respect multi-line prompts
Fixes #718
Diffstat (limited to 'share/functions')
-rw-r--r-- | share/functions/__fish_list_current_token.fish | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/share/functions/__fish_list_current_token.fish b/share/functions/__fish_list_current_token.fish index a88978cc..0a0f2dab 100644 --- a/share/functions/__fish_list_current_token.fish +++ b/share/functions/__fish_list_current_token.fish @@ -1,22 +1,26 @@ - -# -# This function is bound to Alt-L, it is used to list the contents of -# the directory under the cursor -# +# This function is typically bound to Alt-L, it is used to list the contents +# of the directory under the cursor. 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 val (eval echo (commandline -t)) - printf "\n" - if test -d $val - ls $val - else - set dir (dirname $val) - if test $dir != . -a -d $dir - ls $dir - else - ls - end - end - commandline -f repaint -end + set val (eval echo (commandline -t)) + printf "\n" + if test -d $val + ls $val + else + set dir (dirname $val) + if test $dir != . -a -d $dir + ls $dir + else + ls + end + end + set -l line_count (count (fish_prompt)) + if test $line_count -gt 1 + for x in (seq 2 $line_count) + printf "\n" + end + end + + commandline -f repaint +end |