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
This commit is contained in:
Kartik K. Agaram 2023-12-29 10:23:17 -08:00
parent aa590becd1
commit 61bd89a3fe
2 changed files with 2 additions and 0 deletions

View File

@ -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

View File

@ -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()