fix #2060 by handling blank search pattern

pull/2083/head
chrox 8 years ago
parent 22d0dbfb4f
commit 5bbcae954e

@ -75,6 +75,8 @@ function ReaderSearch:onShowSearchDialog(text)
end
function ReaderSearch:search(pattern, origin)
DEBUG("search pattern", pattern)
if pattern == nil or pattern == '' then return end
local direction = self.direction
local case = self.case_insensitive
local page = self.view.state.page

@ -1087,6 +1087,7 @@ local function all_matches(boxes, pattern, caseInsensitive)
local function match(i, j)
local pindex = 1
local matched_indices = {}
if #plist == 0 then return end
while true do
if #boxes[i] < j then
j = j - #boxes[i]

Loading…
Cancel
Save