diff --git a/biome.json b/biome.json index 13111ead..2a9cd936 100644 --- a/biome.json +++ b/biome.json @@ -47,7 +47,8 @@ "!src-web/vite.config.ts", "!src-web/routeTree.gen.ts", "!packages/plugin-runtime-types/lib", - "!**/bindings" + "!**/bindings", + "!flatpak" ] } } diff --git a/src-web/components/core/Editor/searchMatchCount.ts b/src-web/components/core/Editor/searchMatchCount.ts index 9f4e8aff..79b0937a 100644 --- a/src-web/components/core/Editor/searchMatchCount.ts +++ b/src-web/components/core/Editor/searchMatchCount.ts @@ -51,9 +51,10 @@ export function searchMatchCount(): Extension { let currentIndex = 0; const MAX_COUNT = 9999; const cursor = query.getCursor(state); - while (!cursor.next().done) { + for (let result = cursor.next(); !result.done; result = cursor.next()) { count++; - if (cursor.value.from <= selection.from && cursor.value.to >= selection.to) { + const match = result.value; + if (match.from <= selection.from && match.to >= selection.to) { currentIndex = count; } if (count > MAX_COUNT) break;