about summary refs log tree commit diff stats
path: root/run.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-06-01 12:20:34 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-06-01 12:30:19 -0700
commitf1886391c56e530bb1bb362a450aa9ab6cb8485c (patch)
tree20ae5cacb614159267dd226d83db8cbcc799e34a /run.lua
parente568378ecb13a6d49d24a5b820a20f65cc9004dc (diff)
downloadtext.love-f1886391c56e530bb1bb362a450aa9ab6cb8485c.tar.gz
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 <app.lua:84>
    [C]: in function 'xpcall'
    app.lua:112: in function <app.lua:111>
    [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 <app.lua:22>
    [C]: in function 'xpcall'

  This is reproducible, and also across forks.
Diffstat (limited to 'run.lua')
-rw-r--r--run.lua5
1 files changed, 5 insertions, 0 deletions
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
ea ^
88378503 ^
e6b42204 ^
88378503 ^
e6b42204 ^
bc21fe0b ^
fa8d337d ^
88378503 ^
c22dbbea ^

88378503 ^
fa8d337d ^
88378503 ^

c22dbbea ^
88378503 ^
2e58ffd6 ^
3a3fe4ad ^
0138b000 ^











b7224ab4 ^
bc21fe0b ^

b7224ab4 ^
88378503 ^

b7224ab4 ^
88378503 ^




bc21fe0b ^
88378503 ^

bc21fe0b ^
88378503 ^
b7224ab4 ^
88378503 ^
c22dbbea ^
88378503 ^
b7224ab4 ^
9d7d99fe ^
























































2e58ffd6 ^
bc21fe0b ^

2e58ffd6 ^

a761d0e4 ^
bc21fe0b ^
a761d0e4 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137