about summary refs log tree commit diff stats
path: root/json.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-23 22:31:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-23 22:51:52 -0700
commit8d5ac5da75b853e833c7ad5f18ce468eebc2aa0b (patch)
treeb64b7a6d9abc8fa3559a5a36829f1c73c1af7b06 /json.lua
parentb3251b23b5af380a1c5eb4bb3d2699acb934879b (diff)
downloadview.love-8d5ac5da75b853e833c7ad5f18ce468eebc2aa0b.tar.gz
keep one screen line of overlap on pagedown
I'm now extracting the concern of computing
line.screen_line_starting_pos out of Text.draw. Earlier
I had to make sure I ran through the whole line to compute
screen_line_starting_pos, but that had the side-effect of updating
Screen_bottom1.pos as well with lines that had never been rendered.

In this process I hit my first bug due to an accidental global. It
doesn't show up in the patch because I accidentally deleted a local
declaration. (I thought I didn't need screen_line_starting_pos anymore,
deleted everywhere, then brought it back everywhere from the bottom of
the function up, but forgot to put back the very first occurrence.)

The amount of yoyoing this caused between App.draw and Text.draw, I very
much have spaghetti on my hands.

Accidental globals are _terrible_ in a program with tests. Cross test
contamination X-(
Diffstat (limited to 'json.lua')
0 files changed, 0 insertions, 0 deletions
'>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