fix: bump file manager name limit

This commit is contained in:
2026-04-06 00:25:27 +02:00
parent 7ebb2bc2dc
commit 104f442551
3 changed files with 10 additions and 10 deletions
@@ -17,7 +17,7 @@ struct FileManagerState {
char history[16][256]; char history[16][256];
int history_pos; int history_pos;
int history_count; int history_count;
char entry_names[64][64]; char entry_names[64][128];
int entry_types[64]; // 0=file, 1=dir, 2=exec, 3=drive, 4=home, 5=apps, 6=app, 7=special_dir int entry_types[64]; // 0=file, 1=dir, 2=exec, 3=drive, 4=home, 5=apps, 6=app, 7=special_dir
int entry_sizes[64]; int entry_sizes[64];
int entry_count; int entry_count;
@@ -48,7 +48,7 @@ struct FileManagerState {
// Rename // Rename
bool rename_active; bool rename_active;
int rename_idx; int rename_idx;
char rename_buf[64]; char rename_buf[128];
int rename_cursor; int rename_cursor;
int rename_len; int rename_len;
@@ -141,7 +141,7 @@ void filemanager_read_dir(FileManagerState* fm) {
} }
if (match) raw += prefix_len; if (match) raw += prefix_len;
} }
montauk::strncpy(fm->entry_names[i], raw, 63); montauk::strncpy(fm->entry_names[i], raw, 128);
int len = montauk::slen(fm->entry_names[i]); int len = montauk::slen(fm->entry_names[i]);
// Detect directory // Detect directory
@@ -217,15 +217,15 @@ void filemanager_on_draw(Window* win, Framebuffer& fb) {
c.vline(cx, ty, system_font_height(), colors::ACCENT); c.vline(cx, ty, system_font_height(), colors::ACCENT);
} }
} else { } else {
char label[16]; char label[64];
int nlen = montauk::slen(fm->entry_names[i]); int nlen = montauk::slen(fm->entry_names[i]);
if (nlen > 9) { if (nlen > 60) {
for (int k = 0; k < 9; k++) label[k] = fm->entry_names[i][k]; for (int k = 0; k < 60; k++) label[k] = fm->entry_names[i][k];
label[9] = '.'; label[60] = '.';
label[10] = '.'; label[61] = '.';
label[11] = '\0'; label[62] = '\0';
} else { } else {
montauk::strncpy(label, fm->entry_names[i], 15); montauk::strncpy(label, fm->entry_names[i], 63);
} }
int tw = text_width(label); int tw = text_width(label);
int tx = cell_x + (FM_GRID_CELL_W - tw) / 2; int tx = cell_x + (FM_GRID_CELL_W - tw) / 2;