From f1886391c56e530bb1bb362a450aa9ab6cb8485c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 1 Jun 2023 12:20:34 -0700 Subject: some temporary logging to catch a bug The bug has been spotted twice: 1. In snap.love, I selected text in one node, then another, and hit: Error: text.lua:789: attempt to compare nil with number stack traceback: text.lua:789: in function 'lt1' select.lua:19: in function 'clip_selection' text.lua:32: in function 'draw' edit.lua:117: in function 'draw' [string "REPL"]:21: in function 'draw' main.lua:152: in function 'draw' app.lua:102: in function [C]: in function 'xpcall' app.lua:112: in function [C]: in function 'xpcall' Couldn't reproduce. 2. In text.love, inscript selected all text in a small buffer and then clicked outside the text. And got: Error: text.lua:784: attempt to compare nil with number Traceback [love "callbacks.lua"]:228: in function 'handler' text.lua:784: in function 'lt1' select.lua:19: in function 'clip_selection' text.lua:27: in function 'draw' edit.lua:117: in function 'draw' run.lua:136: in function 'draw' main.lua:148: in function 'draw' app.lua:42: in function [C]: in function 'xpcall' This is reproducible, and also across forks. --- run.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'run.lua') diff --git a/run.lua b/run.lua index d029bed..5f35a0b 100644 --- a/run.lua +++ b/run.lua @@ -48,6 +48,11 @@ function run.initialize(arg) end end +function print_and_log(s) + print(s) + log(3, s) +end + function run.load_settings() love.graphics.setFont(love.graphics.newFont(Settings.font_height)) -- determine default dimensions and flags -- cgit 1.4.1-2-gfad0