修正切换文件夹还显示原来的文件夹名字的bug

This commit is contained in:
anod 2022-08-04 13:41:42 +08:00
parent aec759cd01
commit f108c9ef06

View File

@ -156,7 +156,7 @@ Result browseFiles(const char *const basePath, char selected[512])
s32 oldCursorPos = 0; s32 oldCursorPos = 0;
while(1) while(1)
{ {
ee_printf(*dList->ptrs[cursorPos] == ENT_TYPE_FILE ? "\x1b[%lu;H\x1b[37m %.51s" : "\x1b[%lu;H\x1b[36m %.51s", oldCursorPos - windowPos, &dList->ptrs[oldCursorPos][1]); // Clear old cursor. ee_printf(*dList->ptrs[oldCursorPos] == ENT_TYPE_FILE ? "\x1b[%lu;H\x1b[37m %.51s" : "\x1b[%lu;H\x1b[36m %.51s", oldCursorPos - windowPos, &dList->ptrs[oldCursorPos][1]); // Clear old cursor.
ee_printf("\x1b[%lu;H\x1b[33m>%.51s", cursorPos - windowPos, &dList->ptrs[cursorPos][1]); // Draw cursor. ee_printf("\x1b[%lu;H\x1b[33m>%.51s", cursorPos - windowPos, &dList->ptrs[cursorPos][1]); // Draw cursor.
u32 kDown; u32 kDown;
@ -226,8 +226,7 @@ Result browseFiles(const char *const basePath, char selected[512])
} }
if((res = scanDir(curDir, dList, ".gba")) != RES_OK) break; if((res = scanDir(curDir, dList, ".gba")) != RES_OK) break;
cursorPos = 0; cursorPos = oldCursorPos = windowPos = 0;
windowPos = 0;
showDirList(dList, 0); showDirList(dList, 0);
} }
} }