From 923131a5b6512620f57979132535a6833c8d780b Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 24 Jan 2026 14:22:05 +0100 Subject: [PATCH] Fix remedy crash on f9 and scratch content reset to normal --- src/text_editor/globals.cpp | 5 ++++- src/text_editor/plugin_remedybg.cpp | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/text_editor/globals.cpp b/src/text_editor/globals.cpp index 6db6edd..c3a23da 100644 --- a/src/text_editor/globals.cpp +++ b/src/text_editor/globals.cpp @@ -10,7 +10,9 @@ bool SearchCaseSensitive = false; bool SearchWordBoundary = false; bool BreakOnError = false; Int ErrorCount; -// String16 InitialScratchContent; +#if 1 +String16 InitialScratchContent; +#else String16 InitialScratchContent = uR"==(0 1 2 @@ -18,6 +20,7 @@ String16 InitialScratchContent = uR"==(0 4 5 6)=="; +#endif Allocator SysAllocator = {SystemAllocatorProc}; String ConfigDir; diff --git a/src/text_editor/plugin_remedybg.cpp b/src/text_editor/plugin_remedybg.cpp index 714faf3..7062454 100644 --- a/src/text_editor/plugin_remedybg.cpp +++ b/src/text_editor/plugin_remedybg.cpp @@ -2263,7 +2263,8 @@ void CO_StopDebugging(mco_coro *co) { } RegisterCoroutineCommand(CO_StopDebugging, "shift-f5", "Stop debugging"); void CO_AddBreakpoint(mco_coro *co) { - if (!RDBG_InitConnection(co)) { + bool conn = RDBG_InitConnection(co); + if (!conn) { return; } @@ -2291,7 +2292,7 @@ void CO_SelfAttachDebugger(mco_coro *co) { MemoryZero(RDBG_Ctx.last_error, sizeof(RDBG_Ctx.last_error)); return; } -} RegisterCoroutineCommand(CO_SelfAttachDebugger, "f9", "Spawn and self attach the debugger to the text editor"); +} RegisterCoroutineCommand(CO_SelfAttachDebugger, "", "Spawn and self attach the debugger to the text editor"); void QuitDebugger() { if (RDBG_Ctx.command_pipe_handle == NULL) {