()
| 267 | } |
| 268 | |
| 269 | function upOrHistoryUp() { |
| 270 | if (disableCursorMovementForUpDownKeys) { |
| 271 | onHistoryUp?.() |
| 272 | return cursor |
| 273 | } |
| 274 | // Try to move by wrapped lines first |
| 275 | const cursorUp = cursor.up() |
| 276 | if (!cursorUp.equals(cursor)) { |
| 277 | return cursorUp |
| 278 | } |
| 279 | |
| 280 | // If we can't move by wrapped lines and this is multiline input, |
| 281 | // try to move by logical lines (to handle paragraph boundaries) |
| 282 | if (multiline) { |
| 283 | const cursorUpLogical = cursor.upLogicalLine() |
| 284 | if (!cursorUpLogical.equals(cursor)) { |
| 285 | return cursorUpLogical |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // Can't move up at all - trigger history navigation |
| 290 | onHistoryUp?.() |
| 291 | return cursor |
| 292 | } |
| 293 | function downOrHistoryDown() { |
| 294 | if (disableCursorMovementForUpDownKeys) { |
| 295 | onHistoryDown?.() |
no test coverage detected