Misc changes

This commit is contained in:
krzosa
2025-12-29 16:22:51 +01:00
parent c5afe78b91
commit ab8558ef43
4 changed files with 25 additions and 16 deletions

View File

@@ -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 ?

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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