ReaderSearch: delay adding to location stack until we change page
Search may highlight matches on the current page, and if there are no others in the book, we would stay there and resume reading; but we would get a spurious previous location (ie. in Book map) that we would not expect keeping, and we may accidently go back to previous location, losing our reading position. Avoid this by only adding current page to location stack when actually leaving the current page. Because of complications with other reading modes, this is currently only enabled for CRE document when in page mode.
This commit is contained in:
1 parent
03d16270d9
commit
001e90db1e
2 files changed
+25
-2
No files matched your search
@@ -712,6 +712,10 @@ function ReaderLink:addCurrentLocationToStack(loc)
|
||||
table.insert(self.location_stack, location)
|
||||
end
|
||||
|
||||
function ReaderLink:popFromLocationStack()
|
||||
return table.remove(self.location_stack)
|
||||
end
|
||||
|
||||
function ReaderLink:onClearLocationStack(show_notification)
|
||||
self.location_stack = {}
|
||||
self:onClearForwardLocationStack()
|
||||
|
||||
Reference in new issue
Block a user