diff --git a/build.bat b/build.bat index aa5f8b9..ed3ba72 100755 --- a/build.bat +++ b/build.bat @@ -21,9 +21,5 @@ set flags=/EHsc- /MD /Zi /FC /nologo /WX /W3 /wd4200 /wd4334 /diagnostics:column set libs=%sdllib%/SDL3-static.lib %sdllib%/SDL_uclibc.lib kernel32.lib gdi32.lib user32.lib Imm32.lib ole32.lib Shell32.lib OleAut32.lib Cfgmgr32.lib Setupapi.lib Advapi32.lib version.lib winmm.lib cl %flags% ../src/text_editor/text_editor.cpp -Fe:te.exe -I%sdl%/include -I../src/external/glad -I../src/ %libs% -link /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:MSVCRTD -copy te.exe ..\data\te.exe -copy te.pdb ..\data\te.pdb -echo written ..\data\te.exe - popd rem /fsanitize=address diff --git a/build.sh b/build.sh index 39f42fe..364f229 100755 --- a/build.sh +++ b/build.sh @@ -9,6 +9,5 @@ FLAGS="-Wall -Wno-missing-braces -Wno-writable-strings -nostdlib++ -fsanitize=ad I="-I../src/external/SDL/include -I../src/external/lua/src -I../src/external/glad" clang -o te $FLAGS ../src/text_editor/text_editor.cpp $I -lSDL3 -lm -lbacktrace -cp te ../data/te # -v -Wl,--verbose \ No newline at end of file diff --git a/data/shell.html b/data/shell.html deleted file mode 100644 index bfc741a..0000000 --- a/data/shell.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - Emscripten-Generated Code - - - - - - {{{ SCRIPT }}} - - \ No newline at end of file diff --git a/src/text_editor/buffer.cpp b/src/text_editor/buffer.cpp index 0f36919..2742bc0 100644 --- a/src/text_editor/buffer.cpp +++ b/src/text_editor/buffer.cpp @@ -895,7 +895,7 @@ API void RedoEdit(Buffer *buffer, Array *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 *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); } } diff --git a/src/text_editor/commands.cpp b/src/text_editor/commands.cpp index ec7e553..aa5485e 100644 --- a/src/text_editor/commands.cpp +++ b/src/text_editor/commands.cpp @@ -1328,6 +1328,12 @@ void Set(String16 string) { return; } } ElseInvalidCodepath(); + + + if (name8 == "FontSize" || name8 == "Font") { + ReloadFont(Font, (U32)FontSize); + } + return; } diff --git a/src/text_editor/globals.cpp b/src/text_editor/globals.cpp index 47dca80..5f637f7 100644 --- a/src/text_editor/globals.cpp +++ b/src/text_editor/globals.cpp @@ -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"); diff --git a/src/text_editor/window.cpp b/src/text_editor/window.cpp index a6e8fe0..764ebc8 100644 --- a/src/text_editor/window.cpp +++ b/src/text_editor/window.cpp @@ -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); } }