(key: any)
| 525 | }; |
| 526 | |
| 527 | const handleHistoryNavigation = (key: any): boolean => { |
| 528 | if (!showSlashCommands && !showFileSearch) { |
| 529 | if (key.upArrow) { |
| 530 | const historyEntry = inputHistory.navigateUp(inputText); |
| 531 | if (historyEntry !== null) { |
| 532 | textBuffer.setText(historyEntry); |
| 533 | textBuffer.setCursor(historyEntry.length); |
| 534 | setInputText(historyEntry); |
| 535 | setCursorPosition(historyEntry.length); |
| 536 | } |
| 537 | return true; |
| 538 | } |
| 539 | |
| 540 | if (key.downArrow) { |
| 541 | const historyEntry = inputHistory.navigateDown(); |
| 542 | if (historyEntry !== null) { |
| 543 | textBuffer.setText(historyEntry); |
| 544 | textBuffer.setCursor(historyEntry.length); |
| 545 | setInputText(historyEntry); |
| 546 | setCursorPosition(historyEntry.length); |
| 547 | } |
| 548 | return true; |
| 549 | } |
| 550 | } |
| 551 | return false; |
| 552 | }; |
| 553 | |
| 554 | const handleEnterKey = (key: any): boolean => { |
| 555 | if (key.return && !key.shift) { |
no test coverage detected