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