Remove jump history, Make sure these windows are visible one at a time
This commit is contained in:
@@ -163,5 +163,4 @@ RegisterVariable(String, ConfigFont, "/home/krz/text_editor/package/CascadiaMono
|
||||
RegisterVariable(String, ConfigVCVarsall, "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat");
|
||||
RegisterVariable(Float, ConfigUndoMergeTimeWindow, 0.3);
|
||||
RegisterVariable(Float, ConfigJumpHistoryMergeTimeWindow, 0.3);
|
||||
RegisterVariable(Int, ConfigJumpHistorySize, 4096);
|
||||
RegisterVariable(String, ConfigInternetBrowser, "firefox");
|
||||
|
||||
@@ -592,14 +592,6 @@ void Update(Event event) {
|
||||
}
|
||||
}
|
||||
it->skip_checkpoint = false;
|
||||
|
||||
|
||||
if (it->goto_history.len > ConfigJumpHistorySize) {
|
||||
RemoveByIndex(&it->goto_history, 0);
|
||||
}
|
||||
if (it->goto_redo.len > ConfigJumpHistorySize) {
|
||||
RemoveByIndex(&it->goto_redo, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (it->sync_visibility_with_focus) {
|
||||
@@ -618,6 +610,20 @@ void Update(Event event) {
|
||||
window = GetWindow(ActiveWindowID);
|
||||
}
|
||||
|
||||
// Behavior where these windows cannot be visible at the same time
|
||||
{
|
||||
WindowID id[] = {BuildWindowID, CommandWindowID, SearchWindowID};
|
||||
for (int i = 0; i < Lengthof(id); i += 1) {
|
||||
if (ActiveWindowID == id[i]) {
|
||||
for (int j = 0; j < Lengthof(id); j += 1) {
|
||||
if (i == j) continue;
|
||||
Window *window = GetWindow(id[j]);
|
||||
window->visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ActiveWindowID != LastActiveLayoutWindowID) {
|
||||
if (window->layout) {
|
||||
LastActiveLayoutWindowID = ActiveWindowID;
|
||||
|
||||
@@ -149,8 +149,8 @@ void LayoutWindows(int16_t wx, int16_t wy) {
|
||||
ProfileFunction();
|
||||
Rect2I screen_rect = RectI0Size(wx, wy);
|
||||
|
||||
CommandWindowLayout(&screen_rect, wx, wy);
|
||||
StatusWindowLayout(&screen_rect, wx, wy);
|
||||
CommandWindowLayout(&screen_rect, wx, wy);
|
||||
DebugWindowLayout(&screen_rect, wx, wy);
|
||||
SearchWindowLayout(&screen_rect, wx, wy);
|
||||
BuildWindowLayout(&screen_rect, wx, wy);
|
||||
|
||||
@@ -28,9 +28,11 @@ void BuildWindowLayout(Rect2I *rect, Int wx, Int wy) {
|
||||
}
|
||||
|
||||
void Command_ShowBuildWindow() {
|
||||
if (ActiveWindowID != BuildWindowID) {
|
||||
return;
|
||||
}
|
||||
BSet main = GetBSet(BuildWindowID);
|
||||
main.window->visible = true;
|
||||
if (ActiveWindowID != BuildWindowID) {
|
||||
main.window->visible = true;
|
||||
NextActiveWindowID = BuildWindowID;
|
||||
} else {
|
||||
main.window->visible = false;
|
||||
}
|
||||
} RegisterCommand(Command_ShowBuildWindow, "ctrl-grave");
|
||||
@@ -19,10 +19,6 @@ void SearchWindowInit() {
|
||||
}
|
||||
|
||||
void SearchWindowLayout(Rect2I *rect, Int wx, Int wy) {
|
||||
Window *command_window = GetWindow(CommandWindowID);
|
||||
if (command_window->visible) {
|
||||
return;
|
||||
}
|
||||
Window *n = GetWindow(SearchWindowID);
|
||||
Rect2I copy_rect = *rect;
|
||||
if (!n->visible) {
|
||||
|
||||
@@ -17,10 +17,6 @@ void StatusWindowInit() {
|
||||
}
|
||||
|
||||
void StatusWindowLayout(Rect2I *rect, Int wx, Int wy) {
|
||||
Window *command_window = GetWindow(CommandWindowID);
|
||||
if (command_window->visible) {
|
||||
return;
|
||||
}
|
||||
Window *n = GetWindow(StatusBarWindowID);
|
||||
Rect2I copy_rect = *rect;
|
||||
if (!n->visible) {
|
||||
@@ -33,10 +29,6 @@ void StatusWindowLayout(Rect2I *rect, Int wx, Int wy) {
|
||||
void StatusWindowUpdate() {
|
||||
ProfileFunction();
|
||||
Window *status_bar_window = GetWindow(StatusBarWindowID, NULL);
|
||||
if (status_bar_window == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
Scratch scratch;
|
||||
BSet main = GetBSet(LastActiveLayoutWindowID);
|
||||
BSet title = GetBSet(status_bar_window);
|
||||
@@ -73,8 +65,8 @@ void StatusWindowUpdate() {
|
||||
return;
|
||||
}
|
||||
|
||||
Caret caret = main.view->carets[0];
|
||||
XY xy = PosToXY(main.buffer, GetFront(caret));
|
||||
Caret caret = main.view->carets[0];
|
||||
XY xy = PosToXY(main.buffer, GetFront(caret));
|
||||
|
||||
// add separator at the end of buffer
|
||||
if (!found_separator) {
|
||||
|
||||
Reference in New Issue
Block a user