From 982a286f7b460af4b15fa62a6012309878cd5f82 Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Tue, 19 Nov 2013 12:24:42 +0100
Subject: [PATCH] Begin searching from current page

---
 web/pdf_find_controller.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/pdf_find_controller.js b/web/pdf_find_controller.js
index 4778a565e..26c953140 100644
--- a/web/pdf_find_controller.js
+++ b/web/pdf_find_controller.js
@@ -203,8 +203,8 @@ var PDFFindController = {
   },
 
   nextMatch: function() {
-    var pages = this.pdfPageSource.pages;
     var previous = this.state.findPrevious;
+    var currentPageIndex = this.pdfPageSource.page - 1;
     var numPages = this.pdfPageSource.pages.length;
 
     this.active = true;
@@ -213,7 +213,7 @@ var PDFFindController = {
       // Need to recalculate the matches, reset everything.
       this.dirtyMatch = false;
       this.selected.pageIdx = this.selected.matchIdx = -1;
-      this.offset.pageIdx = previous ? numPages - 1 : 0;
+      this.offset.pageIdx = currentPageIndex;
       this.offset.matchIdx = null;
       this.hadMatch = false;
       this.resumeCallback = null;