Misc improvements
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user