diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /devtools/client/debugger/src/utils/editor/source-search.js | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/src/utils/editor/source-search.js')
-rw-r--r-- | devtools/client/debugger/src/utils/editor/source-search.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/devtools/client/debugger/src/utils/editor/source-search.js b/devtools/client/debugger/src/utils/editor/source-search.js index 92097377ba..2316cd2ccb 100644 --- a/devtools/client/debugger/src/utils/editor/source-search.js +++ b/devtools/client/debugger/src/utils/editor/source-search.js @@ -27,7 +27,7 @@ function SearchState() { * @memberof utils/source-search * @static */ -function getSearchState(cm, query) { +function getSearchState(cm) { const state = cm.state.search || (cm.state.search = new SearchState()); return state; } @@ -55,7 +55,7 @@ function searchOverlay(query, modifiers) { }); return { - token: function (stream, state) { + token(stream) { // set the last index to be the current stream position // this acts as an offset regexQuery.lastIndex = stream.pos; @@ -141,11 +141,11 @@ function doSearch( return cm.operation(function () { if (!query || isWhitespace(query)) { - clearSearch(cm, query); + clearSearch(cm); return null; } - const state = getSearchState(cm, query); + const state = getSearchState(cm); const isNewQuery = state.query !== query; state.query = query; @@ -179,7 +179,7 @@ export function searchSourceForHighlight( } cm.operation(function () { - const state = getSearchState(cm, query); + const state = getSearchState(cm); const isNewQuery = state.query !== query; state.query = query; @@ -207,7 +207,7 @@ function searchNext(ctx, rev, query, newQuery, modifiers) { const { cm } = ctx; let nextMatch; cm.operation(function () { - const state = getSearchState(cm, query); + const state = getSearchState(cm); const pos = getCursorPos(newQuery, rev, state); if (!state.query) { @@ -261,8 +261,8 @@ function findNextOnLine(ctx, rev, query, newQuery, modifiers, line, ch) { * @memberof utils/source-search * @static */ -export function removeOverlay(ctx, query) { - const state = getSearchState(ctx.cm, query); +export function removeOverlay(ctx) { + const state = getSearchState(ctx.cm); ctx.cm.removeOverlay(state.overlay); const { line, ch } = ctx.cm.getCursor(); ctx.cm.doc.setSelection({ line, ch }, { line, ch }, { scroll: false }); @@ -274,8 +274,8 @@ export function removeOverlay(ctx, query) { * @memberof utils/source-search * @static */ -export function clearSearch(cm, query) { - const state = getSearchState(cm, query); +export function clearSearch(cm) { + const state = getSearchState(cm); state.results = []; @@ -293,7 +293,7 @@ export function clearSearch(cm, query) { * @static */ export function find(ctx, query, keepSelection, modifiers, focusFirstResult) { - clearSearch(ctx.cm, query); + clearSearch(ctx.cm); return doSearch( ctx, false, |