diff --git a/src/backup/todo.txt b/src/backup/todo.txt index b6a5cb5..cb42935 100644 --- a/src/backup/todo.txt +++ b/src/backup/todo.txt @@ -1,15 +1,16 @@ - What precise workflow do I need for me to be viable to use this? - From a user (novice) point of view, how does it look like? +Use session 2 +- Add ctrl-tab to go back to last buffer +- I can't change browser currently, maybe syntax like :Set InternetBrowser "firefox" +- BUILD annoying: Console or use the other window / the window which is already being used + Debug session: - Should highlight main buffer when clicking on status? - Report errorf - use coroutine dialogs - Replace in render layer also -Use session 1: -- OpenCommand in command window freezes the app -- :Rename command that will ask the user - New UI Session - Cleanup String16/String with Open and EvalCommands after lua refactor - Uneditable buffers ? diff --git a/src/text_editor/buffer.cpp b/src/text_editor/buffer.cpp index 6a21f23..de1becb 100644 --- a/src/text_editor/buffer.cpp +++ b/src/text_editor/buffer.cpp @@ -1573,8 +1573,8 @@ void SaveBuffer(Buffer *buffer) { if (success) { buffer->file_mod_time = GetFileModTime(buffer->name); - buffer->dirty = false; - buffer->temp = false; + buffer->dirty = false; + buffer->temp = false; } else { ReportWarningf("Failed to save file with name: %S", buffer->name); } diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index 39e09f2..470fe71 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -401,14 +401,25 @@ BSet ExecBuild(String cmd) { BSet main = GetBSet(LastActiveLayoutWindowID); NextActiveWindowID = main.window->id; View *view = WindowOpenBufferView(main.window, BuildBuffer->name); + SelectRange(view, Range{}); ResetBuffer(BuildBuffer); - Exec(view->id, true, cmd, WorkDir); + Exec(view->id, false, cmd, WorkDir); // NOTE: IN CASE WE MOVE THIS TO CONSOLE WINDOW, MAKE SURE TO SWITCH HERE the scrolling main.window->active_goto_list = view->id; main.window->goto_list_pos = 0; return main; } +void Command_SaveAll() { + For(Buffers) { + // NOTE: file_mod_time is only set when buffer got read or written to disk already so should be saved + if (it->file_mod_time) { + SaveBuffer(it); + } + } +} RegisterCommand(Command_SaveAll, "ctrl-shift-s"); + void Command_Build() { + Command_SaveAll(); #if OS_WINDOWS ExecBuild("build.bat"); #else @@ -446,6 +457,11 @@ ResolvedOpen ResolveOpen(Allocator scratch, String path, String meta) { // Shell { + if (StartsWith(path, "!!")) { + result.kind = OpenKind_BackgroundExec; + result.path = Skip(path, 2); + return result; + } if (StartsWith(path, "!")) { result.kind = OpenKind_Exec; result.path = Skip(path, 1); @@ -614,14 +630,6 @@ void Command_Save() { SaveBuffer(active.buffer); } RegisterCommand(Command_Save, "ctrl-s"); -void Command_SaveAll() { - For(Buffers) { - if (it->file_mod_time) { - SaveBuffer(it); - } - } -} RegisterCommand(Command_SaveAll, "ctrl-shift-s"); - void Command_Reopen() { BSet main = GetBSet(LastActiveLayoutWindowID); ReopenBuffer(main.buffer); diff --git a/src/text_editor/window_status.cpp b/src/text_editor/window_status.cpp index 81e4f4c..5898911 100644 --- a/src/text_editor/window_status.cpp +++ b/src/text_editor/window_status.cpp @@ -79,7 +79,7 @@ void StatusWindowUpdate() { // add separator at the end of buffer if (!found_separator) { SelectRange(title.view, GetBufferEndAsRange(title.buffer)); - ReplaceEx(scratch, title.view, u" | :Prev :Next"); + ReplaceEx(scratch, title.view, u" | :Prev :Next :Close"); } // replace data up to separator with filename and stuff