()
| 291 | return cursor |
| 292 | } |
| 293 | function downOrHistoryDown() { |
| 294 | if (disableCursorMovementForUpDownKeys) { |
| 295 | onHistoryDown?.() |
| 296 | return cursor |
| 297 | } |
| 298 | // Try to move by wrapped lines first |
| 299 | const cursorDown = cursor.down() |
| 300 | if (!cursorDown.equals(cursor)) { |
| 301 | return cursorDown |
| 302 | } |
| 303 | |
| 304 | // If we can't move by wrapped lines and this is multiline input, |
| 305 | // try to move by logical lines (to handle paragraph boundaries) |
| 306 | if (multiline) { |
| 307 | const cursorDownLogical = cursor.downLogicalLine() |
| 308 | if (!cursorDownLogical.equals(cursor)) { |
| 309 | return cursorDownLogical |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | // Can't move down at all - trigger history navigation |
| 314 | onHistoryDown?.() |
| 315 | return cursor |
| 316 | } |
| 317 | |
| 318 | function mapKey(key: Key): InputMapper { |
| 319 | switch (true) { |
no test coverage detected