MCPcopy
hub / github.com/philc/vimium / onInput

Method onInput

pages/vomnibar_page.js:364–382  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

362 }
363
364 onInput() {
365 this.seenTabToOpenCompletionList = false;
366 this.cancelCompletions();
367
368 // For custom search engines, we suppress the leading prefix (e.g. the "w" of "w query terms")
369 // within the vomnibar input.
370 if (!this.isUserSearchEngineActive() && this.getUserSearchEngineForQuery() != null) {
371 this.activeUserSearchEngine = this.getUserSearchEngineForQuery();
372 const queryTerms = this.input.value.trim().split(/\s+/);
373 this.input.value = queryTerms.slice(1).join(" ");
374 }
375
376 // If the user types, then don't reset any previous text, and reset the selection.
377 if (this.previousInputValue != null) {
378 this.previousInputValue = null;
379 this.selection = -1;
380 }
381 this.update();
382 }
383
384 // Returns the UserSearchEngine for the given query. Returns null if the query does not begin with
385 // a keyword from one of the user's search engines.

Callers 1

Calls 4

cancelCompletionsMethod · 0.95
updateMethod · 0.95

Tested by

no test coverage detected