about summary refs log tree commit diff stats
path: root/source_select.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2024-06-11 06:58:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2024-06-11 07:02:46 -0700
commitf2299cb422d0fc07a1b01f0c31f88e9ae5ab168f (patch)
tree1216103a49bdba04dbcad0f35f14ee3128e51a9c /source_select.lua
parent19615eade0106ad5a3a988b3f1f257367aceb7ec (diff)
downloadview.love-f2299cb422d0fc07a1b01f0c31f88e9ae5ab168f.tar.gz
stop caching screen_bottom1
I'm not sure this is very useful. I had an initial idea to stop using
screen_bottom1 in final_text_loc_on_screen, by starting from screen_top1
rather than screen_bottom1. But that changes the direction in which we
scan for the text line in situations where there is somehow no text on
screen (something that should never happen but I have zero confidence in
that).

Still, it doesn't seem like a bad thing to drastically reduce the
lifetime of some derived state.

Really what I need to do is throw this whole UX out and allow the cursor
to be on a drawing as a whole. So up arrow or left arrow below a drawing
would focus the whole drawing in a red border, and another up arrow and
left arrow would skip the drawing and continue upward. I think that
change to the UX will eliminate a whole class of special cases in the
code.
Diffstat (limited to 'source_select.lua')
-rw-r--r--source_select.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/source_select.lua b/source_select.lua
index 6e21c7b..78d18db 100644
--- a/source_select.lua
+++ b/source_select.lua
@@ -79,7 +79,8 @@ function Text.mouse_pos(State)
       end
     end
   end
-  return State.screen_bottom1.line, Text.pos_at_end_of_screen_line(State, State.screen_bottom1)
+  local screen_bottom1 = Text.screen_bottom1(State)
+  return screen_bottom1.line, Text.pos_at_end_of_screen_line(State, screen_bottom1)
 end
 
 function Text.cut_selection(State)
e>
b0bf5321 ^
23d3a022 ^
78c50205 ^
c442a5ad ^
b0bf5321 ^



78c50205 ^
b0bf5321 ^


7fd01071 ^
23d3a022 ^
acce384b ^
23d3a022 ^
c442a5ad ^
ad2604e8 ^

b0bf5321 ^

6c96a437 ^
b0bf5321 ^


c442a5ad ^
ad2604e8 ^
b0bf5321 ^
ad2604e8 ^
b0bf5321 ^
9a81d746 ^
b0bf5321 ^


4b424bb2 ^

4a943d4e ^










4b424bb2 ^
23d3a022 ^
b0bf5321 ^
4a943d4e ^










b0bf5321 ^
e41e8e09 ^
78c50205 ^
23d3a022 ^
b0bf5321 ^

17401c38 ^

23d3a022 ^
17401c38 ^

4a943d4e ^











b0bf5321 ^
4a943d4e ^










b0bf5321 ^
4a943d4e ^










d9630e06 ^

78c50205 ^
d9630e06 ^

23d3a022 ^
4a943d4e ^













b0bf5321 ^














78c50205 ^
b0bf5321 ^
23d3a022 ^
b56c564c ^
23d3a022 ^
b56c564c ^


b0bf5321 ^
b56c564c ^
b0bf5321 ^
b0bf5321 ^

aa3d29a5 ^
65151923 ^



4a943d4e ^























23d3a022 ^
65151923 ^






2b250717 ^
65151923 ^

23d3a022 ^

65151923 ^









23d3a022 ^
65151923 ^


23d3a022 ^
909adb27 ^
65151923 ^



65151923 ^
aa3d29a5 ^



























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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288