From db06c783a97abf2e80d42b3e12d7ed6d2b2127bf Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Thu, 15 Jan 2026 20:24:12 +0100 Subject: [PATCH] Misc improvements --- src/text_editor/buffer.cpp | 1 - src/text_editor/commands.cpp | 2 +- src/text_editor/text_editor.cpp | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/text_editor/buffer.cpp b/src/text_editor/buffer.cpp index 16e7198..9ec854a 100644 --- a/src/text_editor/buffer.cpp +++ b/src/text_editor/buffer.cpp @@ -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); } diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index 507e9f6..05f07c4 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -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); } diff --git a/src/text_editor/text_editor.cpp b/src/text_editor/text_editor.cpp index 97326c0..71fabdf 100644 --- a/src/text_editor/text_editor.cpp +++ b/src/text_editor/text_editor.cpp @@ -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); }