ReloadFont when variables change

This commit is contained in:
Krzosa Karol
2025-12-31 15:25:00 +01:00
parent a40797abb2
commit 59081eb4bd
7 changed files with 12 additions and 53 deletions

View File

@@ -895,7 +895,7 @@ API void RedoEdit(Buffer *buffer, Array<Caret> *carets) {
if (buffer->redo_stack.len > 0) {
HistoryEntry *next = GetLast(buffer->redo_stack);
if (next->time - entry.time <= UndoMergeTimeWindow) {
if (next->time - entry.time <= UndoMergeTime) {
RedoEdit(buffer, carets);
}
}
@@ -921,7 +921,7 @@ API void UndoEdit(Buffer *buffer, Array<Caret> *carets) {
if (buffer->undo_stack.len > 0) {
HistoryEntry *next = GetLast(buffer->undo_stack);
if (entry.time - next->time <= UndoMergeTimeWindow) {
if (entry.time - next->time <= UndoMergeTime) {
UndoEdit(buffer, carets);
}
}

View File

@@ -1328,6 +1328,12 @@ void Set(String16 string) {
return;
}
} ElseInvalidCodepath();
if (name8 == "FontSize" || name8 == "Font") {
ReloadFont(Font, (U32)FontSize);
}
return;
}

View File

@@ -160,6 +160,6 @@ RegisterVariable(Int, IndentSize, 4);
RegisterVariable(Int, FontSize, 15);
RegisterVariable(String, Font, "");
RegisterVariable(String, VCVarsall, "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat");
RegisterVariable(Float, UndoMergeTimeWindow, 0.3);
RegisterVariable(Float, JumpHistoryMergeTimeWindow, 0.3);
RegisterVariable(Float, UndoMergeTime, 0.3);
RegisterVariable(Float, JumpHistoryMergeTime, 0.3);
RegisterVariable(String, InternetBrowser, "firefox");

View File

@@ -278,7 +278,7 @@ void JumpBack(Window *window) {
if (window->goto_history.len) {
GotoCrumb *next = GetLast(window->goto_history);
if (c.view_id == next->view_id && c.time - next->time <= JumpHistoryMergeTimeWindow) {
if (c.view_id == next->view_id && c.time - next->time <= JumpHistoryMergeTime) {
JumpBack(window);
}
}
@@ -298,7 +298,7 @@ void JumpForward(Window *window) {
if (window->goto_redo.len) {
GotoCrumb *next = GetLast(window->goto_redo);
if (c.view_id == next->view_id && next->time - c.time <= JumpHistoryMergeTimeWindow) {
if (c.view_id == next->view_id && next->time - c.time <= JumpHistoryMergeTime) {
JumpForward(window);
}
}