Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make alt-L output respect multi-line prompts
Fixes #718
- Loading branch information
Showing
1 changed file
with
23 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |