mirror of https://github.com/dylanaraps/shfm.git
Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
dylan | 696318e947 | |
dylan | 9a968b2c48 | |
dylan | 25d4f809d7 | |
Nathan Sketch | 01ae386143 | |
Nathan Sketch | 1bbd788ee0 | |
Nathan Sketch | 7b21d545b3 | |
Nathan Sketch | ec27f90096 | |
Dylan Araps | 8920178753 | |
dylan | b8efa71b97 | |
dylan | e9fbd754ce | |
Crestwave | 6849998609 | |
Gregory Chamberlain | 2a70030c02 |
22
shfm
22
shfm
|
@ -121,7 +121,7 @@ hist_search() {
|
|||
|
||||
for file do
|
||||
case ${PWD%%/}/$file in
|
||||
"$old_pwd") y=$j y2=$((j > bottom ? mid : j)) cur=$file
|
||||
"$old_pwd") y=$j y2=$((j >= bottom ? mid : j)) cur=$file
|
||||
esac
|
||||
|
||||
j=$((j + 1))
|
||||
|
@ -136,9 +136,8 @@ list_print() {
|
|||
end=$((bottom + 1))
|
||||
mid=$((bottom / 4 < 5 ? 1 : bottom / 4))
|
||||
|
||||
case $1$# in
|
||||
'*1') set -- empty ;;
|
||||
'.[!.]*1') set -- 'no hidden files'
|
||||
case $# in
|
||||
1) [ -e "$1" ] || [ "$1" = 'no results' ] || set -- empty
|
||||
esac
|
||||
|
||||
case $hist in
|
||||
|
@ -195,7 +194,7 @@ status_line() {
|
|||
*) printf %s "$ltype"
|
||||
esac
|
||||
|
||||
esc SGR
|
||||
esc SGR 0 0
|
||||
esc DECRC
|
||||
}
|
||||
|
||||
|
@ -237,11 +236,11 @@ line_print() {
|
|||
|
||||
line_format() {
|
||||
file_escape "$1"
|
||||
esc EL0
|
||||
[ -d "$1" ] && esc SGR 1 31
|
||||
printf %s "$safe"
|
||||
[ -d "$1" ] && printf /
|
||||
esc SGR
|
||||
esc SGR 0 0
|
||||
esc EL0
|
||||
printf '\r'
|
||||
}
|
||||
|
||||
|
@ -326,13 +325,14 @@ main() {
|
|||
G?)
|
||||
y=$#
|
||||
y2=$(($# < bottom ? $# : bottom))
|
||||
line_print "$y" "$@"
|
||||
redraw "$@"
|
||||
;;
|
||||
|
||||
.?)
|
||||
case ${hidden:=1} in
|
||||
1) hidden=0; set -- .[!.]* ;;
|
||||
*) hidden=1; set -- * ;;
|
||||
1) hidden=0; set -- .* ;;
|
||||
0) hidden=1; set -- *
|
||||
esac
|
||||
|
||||
y=1 y2=1 cur=$1
|
||||
|
@ -358,9 +358,11 @@ main() {
|
|||
/?)
|
||||
prompt / r
|
||||
|
||||
# word splitting and globbing intentional
|
||||
IFS=
|
||||
# globbing intentional, word splitting is disabled.
|
||||
# shellcheck disable=2086
|
||||
set -- $ans*
|
||||
unset IFS
|
||||
|
||||
case $1$# in
|
||||
"$ans*1") set -- 'no results'
|
||||
|
|
Loading…
Reference in New Issue