MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / navigateSearchDown

Method navigateSearchDown

src/lib/searchHistory.js:107–121  ·  view source on GitHub ↗

* Navigate down in search history (terminal-like) * @param {string} currentValue Current input value * @returns {string} Next history item or original value

(currentValue)

Source from the content-addressed store, hash-verified

105 * @returns {string} Next history item or original value
106 */
107 navigateSearchDown(currentValue) {
108 if (this.history.length === 0 || this.searchIndex === -1) {
109 return currentValue;
110 }
111
112 this.searchIndex++;
113
114 // If we've gone past the end, return to original value
115 if (this.searchIndex >= this.history.length) {
116 this.searchIndex = -1;
117 return this.tempSearchValue;
118 }
119
120 return this.history[this.searchIndex];
121 }
122
123 /**
124 * Navigate up in replace history (terminal-like)

Callers 1

setupHistoryNavigationFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected