From 73cc12047e7eb8162c1f1a2f19be77bb821be85a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 3 Jun 2022 08:11:18 -0700 Subject: select text using mouse drag Doesn't yet highlight while dragging. --- text.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'text.lua') diff --git a/text.lua b/text.lua index 3c3bb9d..a2e22ab 100644 --- a/text.lua +++ b/text.lua @@ -499,7 +499,7 @@ function test_move_cursor_using_mouse() Screen_bottom1 = {} App.draw() -- populate line.y for each line in Lines local screen_left_margin = 25 -- pixels - App.run_after_mousepress(screen_left_margin+8,Margin_top+5, '1') + App.run_after_mouserelease(screen_left_margin+8,Margin_top+5, '1') check_eq(Cursor1.line, 1, 'F - test_move_cursor_using_mouse/cursor:line') check_eq(Cursor1.pos, 2, 'F - test_move_cursor_using_mouse/cursor:pos') end @@ -1039,7 +1039,7 @@ function test_position_cursor_on_recently_edited_wrapping_line() App.screen.check(y, 'stu', 'F - test_position_cursor_on_recently_edited_wrapping_line/baseline2/screen:3') -- try to move the cursor earlier in the third screen line by clicking the mouse local screen_left_margin = 25 -- pixels - App.run_after_mousepress(screen_left_margin+8,Margin_top+Line_height*2+5, '1') + App.run_after_mouserelease(screen_left_margin+8,Margin_top+Line_height*2+5, '1') -- cursor should move check_eq(Cursor1.line, 1, 'F - test_move_cursor_using_mouse/cursor:line') check_eq(Cursor1.pos, 26, 'F - test_move_cursor_using_mouse/cursor:pos') @@ -1980,6 +1980,10 @@ function Text.to1(pos2) return result end +function Text.eq1(a, b) + return a.line == b.line and a.pos == b.pos +end + function Text.lt1(a, b) if a.line < b.line then return true -- cgit 1.4.1-2-gfad0 lass='right' method='get' action='/danisanti/profani-tty/log/themes/bios'>
path: root/themes/bios
blob: ad582d7e9450685b2a0ca706cddcc3a4118455db (plain) (blame)
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