Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 6dd0c9d

Browse files
committed
fix: Mutate queries array
1 parent 64078b0 commit 6dd0c9d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/common/foreground.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,15 @@ function injectFrame(
117117
}
118118

119119
function queriesFromExpansions(ts: TextSource, n: number): string[] {
120-
const queries: string[] = [ts.text()];
120+
let queries: string[] = [ts.text()];
121121

122122
let stopLeft = false;
123123
let stopRight = false;
124124
for (let i = 0; i < n; i++) {
125125
if (!stopRight) {
126126
const rex = ts.expandNext(ExpandMode.word);
127-
console.log(rex);
128127
if (rex !== null) {
129-
queries.concat(getTexts(rex));
128+
queries = queries.concat(getTexts(rex));
130129
} else {
131130
stopRight = true;
132131
}
@@ -135,7 +134,7 @@ function queriesFromExpansions(ts: TextSource, n: number): string[] {
135134
if (!stopLeft) {
136135
const lex = ts.expandPrev(ExpandMode.word);
137136
if (lex !== null) {
138-
queries.concat(getTexts(lex));
137+
queries = queries.concat(getTexts(lex));
139138
ts = lex;
140139
} else {
141140
stopLeft = true;
@@ -145,7 +144,7 @@ function queriesFromExpansions(ts: TextSource, n: number): string[] {
145144
if (!stopRight) {
146145
const rex = ts.expandNext(ExpandMode.word);
147146
if (rex !== null) {
148-
queries.concat(getTexts(rex));
147+
queries = queries.concat(getTexts(rex));
149148
ts = rex;
150149
}
151150
}

0 commit comments

Comments
 (0)