summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2018-10-09 14:46:47 -0400
committerTuowen Zhao <ztuowen@gmail.com>2018-10-09 14:46:47 -0400
commit075160b86c64045e661209ad7906559068b44104 (patch)
treea910a6eef6163d39859395bb0b416b2b184db9ac /lib
parent5ece6ef2f07c58672a9c965dbbbb62a42386fb2d (diff)
parent3c9942c4884089b290ef750468b29419ca0de271 (diff)
downloadzsh-075160b86c64045e661209ad7906559068b44104.tar.gz
zsh-075160b86c64045e661209ad7906559068b44104.tar.bz2
zsh-075160b86c64045e661209ad7906559068b44104.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'lib')
-rw-r--r--lib/history.zsh8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/history.zsh b/lib/history.zsh
index 62e02648b..d8bbd41c4 100644
--- a/lib/history.zsh
+++ b/lib/history.zsh
@@ -1,7 +1,6 @@
## History wrapper
function omz_history {
- # Delete the history file if `-c' argument provided.
- # This won't affect the `history' command output until the next login.
+ local clear list
zparseopts -E c=clear l=list
if [[ -n "$clear" ]]; then
@@ -12,9 +11,8 @@ function omz_history {
# if -l provided, run as if calling `fc' directly
builtin fc "$@"
else
- # otherwise, call `fc -l 1` to show all available
- # history (and pass additional parameters)
- builtin fc "$@" -l 1
+ # unless a number is provided, show all history events (starting from 1)
+ [[ ${@[-1]} = *[0-9]* ]] && builtin fc -l "$@" || builtin fc -l "$@" 1
fi
}