about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--source_text_tests.lua7
-rw-r--r--text_tests2
-rw-r--r--text_tests.lua7
3 files changed, 9 insertions, 7 deletions
diff --git a/source_text_tests.lua b/source_text_tests.lua
index 7ed4caa..12fb9c6 100644
--- a/source_text_tests.lua
+++ b/source_text_tests.lua
@@ -319,7 +319,7 @@ function test_click_on_empty_line()
   check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
 end
 
-function test_click_below_all_lines()
+function test_click_below_final_line_of_file()
   -- display one line
   App.screen.init{width=50, height=80}
   Editor_state = edit.initialize_test_state()
@@ -331,8 +331,9 @@ function test_click_below_all_lines()
   -- click below first line
   edit.draw(Editor_state)
   edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+50, 1)
-  -- cursor doesn't move
-  check_eq(Editor_state.cursor1.line, 1, 'cursor')
+  -- cursor goes to bottom
+  check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
+  check_eq(Editor_state.cursor1.pos, 4, 'cursor:pos')
   -- selection remains empty
   check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
 end
diff --git a/text_tests b/text_tests
index 2a31131..85d9de9 100644
--- a/text_tests
+++ b/text_tests
@@ -23,7 +23,7 @@ click on wrapping line rendered from partway at top of screen
 click past end of wrapping line
 click past end of wrapping line containing non ascii
 click past end of word wrapping line
-click below final line does nothing
+click below final line of file
 
 # cursor movement
 move left
diff --git a/text_tests.lua b/text_tests.lua
index 7168daf..55a9e85 100644
--- a/text_tests.lua
+++ b/text_tests.lua
@@ -319,7 +319,7 @@ function test_click_on_empty_line()
   check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
 end
 
-function test_click_below_all_lines()
+function test_click_below_final_line_of_file()
   -- display one line
   App.screen.init{width=50, height=80}
   Editor_state = edit.initialize_test_state()
@@ -331,8 +331,9 @@ function test_click_below_all_lines()
   -- click below first line
   edit.draw(Editor_state)
   edit.run_after_mouse_click(Editor_state, Editor_state.left+8,Editor_state.top+50, 1)
-  -- cursor doesn't move
-  check_eq(Editor_state.cursor1.line, 1, 'cursor')
+  -- cursor goes to bottom
+  check_eq(Editor_state.cursor1.line, 1, 'cursor:line')
+  check_eq(Editor_state.cursor1.pos, 4, 'cursor:pos')
   -- selection remains empty
   check_nil(Editor_state.selection1.line, 'selection is empty to avoid perturbing future edits')
 end
17:13:47 -0800 committer Kartik Agaram <vc@akkartik.com> 2019-01-10 17:13:47 -0800 4918' href='/akkartik/mu/commit/subx/068read-line.subx?h=hlt&id=89bcb56717c86af44ce64f6e432d79836ae23a96'>89bcb567 ^
aff782c4 ^








7a22a219 ^
bddd7e3a ^
1639687b ^
615a7e95 ^
7a22a219 ^
aff782c4 ^









7a22a219 ^
615a7e95 ^
aff782c4 ^
aff782c4 ^









7a22a219 ^
aff782c4 ^







0b91d25c ^
7a22a219 ^




aff782c4 ^
























38ef68b2 ^
a4df80db ^
38ef68b2 ^
a4df80db ^



aff782c4 ^
aff782c4 ^
0b91d25c ^
aff782c4 ^




38ef68b2 ^

aff782c4 ^
38ef68b2 ^
aff782c4 ^




38ef68b2 ^
aff782c4 ^

f0705578 ^
38ef68b2 ^
aff782c4 ^
f0705578 ^
aff782c4 ^




bddd7e3a ^
a4df80db ^
















38ef68b2 ^
a4df80db ^
38ef68b2 ^
a4df80db ^











38ef68b2 ^

a4df80db ^
38ef68b2 ^
a4df80db ^




38ef68b2 ^
a4df80db ^
bddd7e3a ^
ddd2e989 ^
38ef68b2 ^
a4df80db ^
ddd2e989 ^
a4df80db ^



aff782c4 ^

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