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

Function handleFileSearchNavigation

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

Source from the content-addressed store, hash-verified

500 };
501
502 const handleFileSearchNavigation = (key: any): boolean => {
503 if (key.upArrow) {
504 setSelectedFileIndex((prev) =>
505 prev > 0 ? prev - 1 : Math.max(0, Math.min(currentFiles.length - 1, 9)),
506 );
507 return true;
508 }
509
510 if (key.downArrow) {
511 setSelectedFileIndex((prev) =>
512 prev < Math.min(currentFiles.length - 1, 9) ? prev + 1 : 0,
513 );
514 return true;
515 }
516
517 if ((key.return && !key.shift) || key.tab) {
518 if (currentFiles.length > 0 && selectedFileIndex < currentFiles.length) {
519 selectFile(currentFiles[selectedFileIndex].path);
520 }
521 return true;
522 }
523
524 return false;
525 };
526
527 const handleHistoryNavigation = (key: any): boolean => {
528 if (!showSlashCommands && !showFileSearch) {

Callers 1

UserInputFunction · 0.85

Calls 1

selectFileFunction · 0.85

Tested by

no test coverage detected