Merge pull request #2083 from chrox/fix_2060

fix #2060 by handling blank search pattern
pull/2085/head
Qingping Hou 8 years ago committed by GitHub
commit fe6aaca47d

@ -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

@ -1090,6 +1090,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