summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordylan <dylan.araps@gmail.com>2021-06-11 08:15:53 +0000
committerGitHub <noreply@github.com>2021-06-11 08:15:53 +0000
commit82aa107dadae8235ce30791f00f12ac0c46b731c (patch)
treea0d5771a6a4d6a4d636b25c86503362a9270eafd
parent5045c4ab91f559a3735619dacf604e37632160cf (diff)
parent944c7dc6879d5ef4a1696cbbe3ac5a6f2030cc0e (diff)
Merge pull request #174 from arsiarola/previous_index-fix
Fix marked_files out of bounds
-rwxr-xr-xfff4
1 files changed, 2 insertions, 2 deletions
diff --git a/fff b/fff
index cee2cc9..85f2ecc 100755
--- a/fff
+++ b/fff
@@ -196,12 +196,12 @@ read_dir() {
for item in "$PWD"/*; do
if [[ -d $item ]]; then
dirs+=("$item")
- ((item_index++))
# Find the position of the child directory in the
# parent directory list.
[[ $item == "$OLDPWD" ]] &&
((previous_index=item_index))
+ ((item_index++))
else
files+=("$item")
fi
@@ -313,7 +313,7 @@ draw_dir() {
# When going up the directory tree, place the cursor on the position
# of the previous directory.
((find_previous == 1)) && {
- ((scroll_start=previous_index-1))
+ ((scroll_start=previous_index))
((scroll=scroll_start))
# Clear the directory history. We're here now.