From 4a6e64a7cd94fd20581504bb2d8631ea8d5bb8df Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 30 Jul 2026 12:18:59 +0200 Subject: [PATCH] paint: console fixes --- paint/sources/ui/tab_console.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paint/sources/ui/tab_console.c b/paint/sources/ui/tab_console.c index fc73cae5..4fcf8597 100644 --- a/paint/sources/ui/tab_console.c +++ b/paint/sources/ui/tab_console.c @@ -17,8 +17,9 @@ void tab_console_draw_export_on_file_picked(char *path) { void tab_console_run_done(char *s) { console_log(tr("Script updated.")); - if (starts_with(s, "```c")) { - s = substring(s, 5, string_length(s) - 4); + i32 i = string_index_of(s, "```c"); + if (i >= 0) { + s = substring(s, i + 5, string_length(s) - 4); } tab_scripts_get();