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

Method navigateSearchUp

src/lib/searchHistory.js:88–100  ·  view source on GitHub ↗

* Navigate up in search history (terminal-like) * @param {string} currentValue Current input value * @returns {string} Previous history item or current value

(currentValue)

Source from the content-addressed store, hash-verified

86 * @returns {string} Previous history item or current value
87 */
88 navigateSearchUp(currentValue) {
89 if (this.history.length === 0) return currentValue;
90
91 // Store current value if we're at the beginning
92 if (this.searchIndex === -1) {
93 this.tempSearchValue = currentValue;
94 this.searchIndex = this.history.length - 1;
95 } else if (this.searchIndex > 0) {
96 this.searchIndex--;
97 }
98
99 return this.history[this.searchIndex] || currentValue;
100 }
101
102 /**
103 * Navigate down in search history (terminal-like)

Callers 1

setupHistoryNavigationFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected