about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-05-16 21:36:44 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-05-16 21:36:44 -0700
commit741018db1f1ceca00b1a0b471c58115334db4502 (patch)
treed179e115a6088c4638d8a45f60eadcb9027a0970 /main.lua
parent5a4b8451ce01efca0f37d55c9668296136fbc3c5 (diff)
downloadlines.love-741018db1f1ceca00b1a0b471c58115334db4502.tar.gz
bugfix: up/down across drawings
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 2656477..6992a61 100644
--- a/main.lua
+++ b/main.lua
@@ -710,12 +710,14 @@ function keychord_pressed(chord)
 end
 
 function cursor_x(line, cursor_pos)
+  if type(line) == 'table' then return 0 end
   local line_before_cursor = line:sub(1, cursor_pos-1)
   local text_before_cursor = love.graphics.newText(love.graphics.getFont(), line_before_cursor)
   return text_before_cursor:getWidth()
 end
 
 function nearest_cursor_pos(line, x, hint)
+  if type(line) == 'table' then return hint end
   if x == 0 then
     return 1
   end
26 22:54:39 -0500 committer Drew DeVault <sir@cmpwn.com> 2018-02-26 22:54:39 -0500 Split UI library and widgets' href='/akspecs/aerc/commit/cmd/aerc/main.go?h=0.2.1&id=1418e1b9dc41d8f69bccb8de0fe0f1fb6835ce11'>1418e1b ^
aeb7005

8126d82 ^



8126d82 ^
10dd23f ^

5d0402a ^




fa04a1e ^
10dd23f ^


8126d82 ^





aeb7005
648ca98 ^



a21afda ^




1767e4f ^
a21afda ^

a0be5e8 ^

39c93d2 ^

60b351b ^
f406bf5 ^



b60999c ^
8126d82 ^
















f406bf5 ^
8126d82 ^
b60999c ^

f406bf5 ^
77a0f68 ^


1418e1b ^
60b351b ^
1418e1b ^

661e3ec ^

305446a ^
6394e38 ^
aeb7005
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