dylanaraps / fff

📁 A simple file manager written in bash.
MIT License
4.09k stars 173 forks source link

Fix marked_files out of bounds #174

Closed arsiarola closed 3 years ago

arsiarola commented 3 years ago

If at start the parent directory contains only hidden files, and hidden option is turned off. And we move to the parent directory we will get: fff: line 293: marked_files: bad array subscript

Found out this was due to $previous_index being 0 and we do -1 off of it. So $scroll and $scroll_start would end up being -1 also. Quick fix, store $previous_index starting from 0 rather than 1 just like $scroll variable. And don't minus 1 from it.