mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
fish_indent did something surprising.
This commit is contained in:
parent
e3187b2361
commit
fb3c839a15
1 changed files with 89 additions and 90 deletions
|
@ -45,23 +45,22 @@ function history --shadow-builtin --description "display or manipulate interacti
|
||||||
switch $cmd
|
switch $cmd
|
||||||
case search
|
case search
|
||||||
if set -q argv[1]
|
if set -q argv[1]
|
||||||
or begin
|
or test -n $time_args
|
||||||
test -n $time_args
|
|
||||||
and contains $search_mode none
|
and contains $search_mode none
|
||||||
set -l pager less
|
set -l pager less
|
||||||
set -q PAGER
|
set -q PAGER
|
||||||
and set pager $PAGER
|
and set pager $PAGER
|
||||||
builtin history $time_args | eval $pager
|
builtin history $time_args | eval $pager
|
||||||
else
|
else
|
||||||
builtin history $time_args $argv
|
builtin history $time_args $argv
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
case delete
|
case delete
|
||||||
# Interactively delete history
|
# Interactively delete history
|
||||||
set -l found_items ""
|
set -l found_items ""
|
||||||
switch $search_mode
|
switch $search_mode
|
||||||
case prefix:
|
case prefix:
|
||||||
set found_items (builtin history --search --prefix $prefix_args)
|
set found_items (builtin history --search --prefix $prefix_args)
|
||||||
case contains
|
case contains
|
||||||
|
@ -71,10 +70,10 @@ switch $search_mode
|
||||||
# Save changes after deleting item.
|
# Save changes after deleting item.
|
||||||
builtin history --save
|
builtin history --save
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
set found_items_count (count $found_items)
|
set found_items_count (count $found_items)
|
||||||
if test $found_items_count -gt 0
|
if test $found_items_count -gt 0
|
||||||
echo "[0] cancel"
|
echo "[0] cancel"
|
||||||
echo "[1] all"
|
echo "[1] all"
|
||||||
echo
|
echo
|
||||||
|
@ -122,21 +121,21 @@ if test $found_items_count -gt 0
|
||||||
end
|
end
|
||||||
# Save changes after deleting item(s).
|
# Save changes after deleting item(s).
|
||||||
builtin history --save
|
builtin history --save
|
||||||
end
|
end
|
||||||
case save
|
case save
|
||||||
# Save changes to history file.
|
# Save changes to history file.
|
||||||
builtin history $argv
|
builtin history $argv
|
||||||
case merge
|
case merge
|
||||||
builtin history --merge
|
builtin history --merge
|
||||||
case help
|
case help
|
||||||
builtin history --help
|
builtin history --help
|
||||||
case clear
|
case clear
|
||||||
# Erase the entire history.
|
# Erase the entire history.
|
||||||
echo "Are you sure you want to clear history ? (y/n)"
|
echo "Are you sure you want to clear history ? (y/n)"
|
||||||
read ch
|
read ch
|
||||||
if test $ch = "y"
|
if test $ch = "y"
|
||||||
builtin history $argv
|
builtin history $argv
|
||||||
echo "History cleared!"
|
echo "History cleared!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue