From ae943a5fd22fa275b1456376185a4badf403969e Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 12 Feb 2026 15:34:13 -0800 Subject: [PATCH] Fix lint: ignore flatpak in biome, fix search cursor iterator usage --- biome.json | 3 ++- src-web/components/core/Editor/searchMatchCount.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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;