summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-10-23 17:29:33 +1100
committerDylan Araps <dylan.araps@gmail.com>2018-10-23 17:29:33 +1100
commit0c43aafb04c599abadec085721abe1c835f8de5a (patch)
tree5f34a0fca754f5314a24f981e389d34248425297
parent4557bb8cd5af8c954af3df92ebeb169c1d65af6b (diff)
faster resize if available
-rwxr-xr-xfff5
1 files changed, 2 insertions, 3 deletions
diff --git a/fff b/fff
index 684c201..57ed6ed 100755
--- a/fff
+++ b/fff
@@ -4,8 +4,7 @@
refresh() {
printf '\e[?7l\e[?25l\e[2J\e[H'
- shopt -s checkwinsize; (:;:)
- ((LINES==0)) && read -r LINES _ < <(stty size)
+ (:;:); ((LINES==0)) && read -r LINES _ < <(stty size)
((m=LINES-3,j=l>m/2?l>=c-m/2?c+1:l+m/2+1:m,k=k>=0?j-m>=0?j-m:k:k,l=l>c?k:l))
}
@@ -117,7 +116,7 @@ key() {
}
main() {
- shopt -s nocaseglob nullglob
+ shopt -s nocaseglob nullglob checkwinsize
mkdir -p ~/.cache/fff/bin/
[[ -d "$1" ]] && path "$1"; refresh; get_dir; f_print