Rewrite file list lookahead scrolling (#1169)

This commit is contained in:
misteraddons
2026-04-29 01:15:16 -06:00
committed by GitHub
parent 9ffc7765e0
commit 798793acdc
4 changed files with 55 additions and 77 deletions

View File

@@ -7726,9 +7726,9 @@ void PrintDirectory(int expand)
if (expand)
{
int k = flist_iFirstEntry() + OsdGetSize() - 1;
if (flist_nDirEntries() && k == flist_iSelectedEntry() && k <= flist_nDirEntries()
if (flist_nDirEntries() && k == flist_iSelectedEntry() && k < flist_nDirEntries()
&& strlen(flist_DirItem(k)->altname) > 28 && !(!cfg.rbf_hide_datecode && flist_DirItem(k)->datecode[0])
&& flist_DirItem(k)->de.d_type != DT_DIR)
&& flist_DirItem(k)->de.d_type != DT_DIR && k < flist_nDirEntries() - 1)
{
//make room for last expanded line
flist_iFirstEntryInc();
@@ -7831,7 +7831,7 @@ void PrintDirectory(int expand)
OsdWriteOffset(i, s, sel, 0, 0, leftchar);
i++;
if (sel && len2)
if (sel && len2 && i < OsdGetSize())
{
len = strlen(flist_DirItem(k)->altname);
strcpy(s+1, flist_DirItem(k)->altname + len - len2);