Commit 18adf24
authored
In text editor, fix behaviour of Home and End keys (#836)
## Usage and product changes
The behaviour of Home and End keys are now in line with most other text
editors, moving to the start/end of the line (rather than the file)
unless Ctrl (Cmd on MacOS) is additionally pressed.
## Implementation
We had some confusing terminology in the `Command` class - `MOVE_HOME`
and `MOVE_END` intuitively sounded like they should correspond to a
keyboard's Home and End keys, but this resulted in incorrect behaviour.
We've renamed them to `MOVE_CONTENT_START` and `MOVE_CONTENT_END`, and
these are now correctly only triggered by Ctrl+Home and Ctrl+End
respectively. Home and End take you to the start/end of a line. If Shift
is additionally pressed in any case, trigger selection.1 parent 60aea7b commit 18adf24
2 files changed
+22
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| 193 | + | |
| 194 | + | |
191 | 195 | | |
192 | 196 | | |
193 | 197 | | |
| |||
212 | 216 | | |
213 | 217 | | |
214 | 218 | | |
215 | | - | |
216 | | - | |
| 219 | + | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| |||
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
229 | | - | |
230 | | - | |
| 233 | + | |
| 234 | + | |
231 | 235 | | |
232 | 236 | | |
233 | 237 | | |
| |||
288 | 292 | | |
289 | 293 | | |
290 | 294 | | |
291 | | - | |
292 | | - | |
| 295 | + | |
| 296 | + | |
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
| 56 | + | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
143 | | - | |
| 142 | + | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments