Fix next/prev letter jump when directories start with _

* Fix next/prev letter jump when directories start with _

* Only skip '_' on directories during SCANO_CORES
This commit is contained in:
zakk4223
2025-11-04 00:54:37 -05:00
committed by GitHub
parent 96726e4bb3
commit cef0ce5e51

View File

@@ -1907,11 +1907,18 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons
//advances through directories, and then advances through files
//
int found = -1;
char curChar = toupper(DirItem[iSelectedEntry].altname[0]);
char curdType = DirItem[iSelectedEntry].de.d_type;
char curChar = DirItem[iSelectedEntry].altname[0];
if ((curChar == '_') && (curdType == DT_DIR) && (options & SCANO_CORES))
curChar = DirItem[iSelectedEntry].altname[1];
curChar = toupper(curChar);
for (int i = iSelectedEntry+1; i < flist_nDirEntries(); i++)
{
if (toupper(DirItem[i].altname[0]) != curChar || DirItem[i].de.d_type != curdType)
char tryChar = DirItem[i].altname[0];
if ((tryChar == '_') && (DirItem[i].de.d_type == DT_DIR) && (options & SCANO_CORES))
tryChar = DirItem[i].altname[1];
if (toupper(tryChar) != curChar || DirItem[i].de.d_type != curdType)
{
found = i;
break;
@@ -1933,12 +1940,18 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons
int found = -1;
bool sawChange = false;
char curChar = toupper(DirItem[iSelectedEntry].altname[0]);
char curdType = DirItem[iSelectedEntry].de.d_type;
bool sawChange = false;
char curChar = DirItem[iSelectedEntry].altname[0];
if ((curChar == '_') && (curdType == DT_DIR) && (options & SCANO_CORES))
curChar = DirItem[iSelectedEntry].altname[1];
curChar = toupper(curChar);
for (int i = iSelectedEntry-1; i >= 0; i--)
{
if (toupper(DirItem[i].altname[0]) != curChar || DirItem[i].de.d_type != curdType)
char tryChar = DirItem[i].altname[0];
if ((tryChar == '_') && (DirItem[i].de.d_type == DT_DIR) && (options & SCANO_CORES))
tryChar = DirItem[i].altname[1];
if (toupper(tryChar) != curChar || DirItem[i].de.d_type != curdType)
{
if (sawChange)
{
@@ -1946,7 +1959,10 @@ int ScanDirectory(char* path, int mode, const char *extension, int options, cons
break;
}
sawChange = true;
curChar = toupper(DirItem[i].altname[0]);
curChar = DirItem[i].altname[0];
if (curChar == '_')
curChar = DirItem[i].altname[1];
curChar = toupper(curChar);
}
}
if (found >= 0)