From 61bd89a3fe72ad442f12c0b9259cdda36bd945e5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 29 Dec 2023 10:23:17 -0800 Subject: [PATCH] bugfix in output editor wrapping scenario: - run a script that renders text in different font sizes - hide the code, then run the script in a way that prints logs or causes an error - show the code - the output buffer shows logs in the right font size, but wrapped with a font size used in the script --- 0050-print_to_output | 1 + 0102-send_errors_to_output | 1 + 2 files changed, 2 insertions(+) diff --git a/0050-print_to_output b/0050-print_to_output index 27999ca..8925727 100644 --- a/0050-print_to_output +++ b/0050-print_to_output @@ -2,5 +2,6 @@ print_to_output = function(...) local line = table.concat(map({...}, tostring), ' ') table.insert(Current_pane.output_editor_state.lines, {data=line}) + love.graphics.setFont(Font) Text.redraw_all(Current_pane.output_editor_state) end \ No newline at end of file diff --git a/0102-send_errors_to_output b/0102-send_errors_to_output index fa71e29..c9393e1 100644 --- a/0102-send_errors_to_output +++ b/0102-send_errors_to_output @@ -3,6 +3,7 @@ send_errors_to_output = function(err) local error_with_callstack = cleaned_up_frame(tostring(err))..'\n'..cleaned_up_callstack(callstack) table.insert(Current_pane.output_editor_state.lines, {data=''}) Current_pane.output_editor_state.cursor1 = {line=#Current_pane.output_editor_state.lines, pos=1} + love.graphics.setFont(Font) Text.redraw_all(Current_pane.output_editor_state) Text.insert_text(Current_pane.output_editor_state, error_with_callstack) clear_handlers()