ReloadFont when variables change
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1328,6 +1328,12 @@ void Set(String16 string) {
|
||||
return;
|
||||
}
|
||||
} ElseInvalidCodepath();
|
||||
|
||||
|
||||
if (name8 == "FontSize" || name8 == "Font") {
|
||||
ReloadFont(Font, (U32)FontSize);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user