From 88925eda09954b067b7ecea30ab498def263217d Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Tue, 19 Nov 2024 23:27:27 +0000 Subject: [PATCH] Fix PDF search not highlighting the first character on a page --- src/pdf/pdf-find-controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pdf/pdf-find-controller.js b/src/pdf/pdf-find-controller.js index 6e40b9ba..57228952 100644 --- a/src/pdf/pdf-find-controller.js +++ b/src/pdf/pdf-find-controller.js @@ -864,7 +864,10 @@ class PDFFindController { total++; } if (total >= matchPos && start === null) { - start = i + 1; + start = i; + if (i !== 0) { + start++; + } } if (total >= matchPos + matchLen) { end = i;