MCPcopy Create free account
hub / github.com/continuedev/continue / handleHistoryNavigation

Function handleHistoryNavigation

extensions/cli/src/ui/UserInput.tsx:527–552  ·  view source on GitHub ↗
(key: any)

Source from the content-addressed store, hash-verified

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) {

Callers 1

UserInputFunction · 0.85

Calls 4

navigateUpMethod · 0.80
setTextMethod · 0.80
setCursorMethod · 0.80
navigateDownMethod · 0.80

Tested by

no test coverage detected