MCPcopy
hub / github.com/witheve/Eve / onPromptKeyUp

Function onPromptKeyUp

src/codemirror.js:10577–10600  ·  view source on GitHub ↗
(e, query, close)

Source from the content-addressed store, hash-verified

10575 }
10576 }
10577 function onPromptKeyUp(e, query, close) {
10578 var keyName = CodeMirror.keyName(e), up;
10579 if (keyName == 'Up' || keyName == 'Down') {
10580 up = keyName == 'Up' ? true : false;
10581 query = vimGlobalState.searchHistoryController.nextMatch(query, up) || '';
10582 close(query);
10583 } else {
10584 if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift')
10585 vimGlobalState.searchHistoryController.reset();
10586 }
10587 var parsedQuery;
10588 try {
10589 parsedQuery = updateSearchQuery(cm, query,
10590 true /** ignoreCase */, true /** smartCase */);
10591 } catch (e) {
10592 // Swallow bad regexes for incremental search.
10593 }
10594 if (parsedQuery) {
10595 cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);
10596 } else {
10597 clearSearchHighlight(cm);
10598 cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
10599 }
10600 }
10601 function onPromptKeyDown(e, query, close) {
10602 var keyName = CodeMirror.keyName(e);
10603 if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' ||

Callers

nothing calls this directly

Calls 6

updateSearchQueryFunction · 0.85
findNextFunction · 0.85
clearSearchHighlightFunction · 0.85
scrollIntoViewMethod · 0.80
scrollToMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected