Misc improvements

This commit is contained in:
Krzosa Karol
2026-01-15 20:24:12 +01:00
parent f33c9873d0
commit db06c783a9
3 changed files with 7 additions and 2 deletions

View File

@@ -1530,7 +1530,6 @@ void ReopenBuffer(Buffer *buffer) {
Scratch scratch;
if (buffer->is_dir) {
ResetBuffer(buffer);
RawAppendf(buffer, "..\n");
for (FileIter it = IterateFiles(scratch, buffer->name); IsValid(it); Advance(&it)) {
RawAppendf(buffer, "%S\n", it.filename);
}

View File

@@ -774,7 +774,7 @@ BSet Open(Window *window, String path, ResolveOpenMeta meta, bool set_active = t
SetFuzzy(view);
Buffer *buffer = GetBuffer(view->active_buffer);
ResetBuffer(buffer);
RawAppendf(buffer, "\n..\n");
RawAppendf(buffer, "\n");
for (FileIter it = IterateFiles(scratch, o.path); IsValid(it); Advance(&it)) {
RawAppendf(buffer, "%S\n", it.filename);
}

View File

@@ -812,6 +812,12 @@ int main(int argc, char **argv)
WorkDir = GetWorkingDir(Perm);
{
String sdl_config_path = SDL_GetPrefPath("krzosa", "text_editor");
if (sdl_config_path.len && sdl_config_path.data[sdl_config_path.len - 1] == '\\') {
sdl_config_path = Chop(sdl_config_path, 1); // chop '/'
}
if (sdl_config_path.len && sdl_config_path.data[sdl_config_path.len - 1] == '/') {
sdl_config_path = Chop(sdl_config_path, 1); // chop '/'
}
ConfigDir = NormalizePath(Perm, sdl_config_path);
SDL_free(sdl_config_path.data);
}