Implement ignorecase/wrapsearch settings.

This commit is contained in:
Florian Bruhin 2014-01-30 12:03:34 +01:00
parent 2f0a25f2b6
commit ee9d8e74be
2 changed files with 9 additions and 1 deletions

View File

@ -8,6 +8,7 @@ from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWebKitWidgets import QWebPage
import qutebrowser.commands
import qutebrowser.utils.config as config
from qutebrowser.commands.exceptions import (ArgumentCountError,
NoSuchCommandError)
from qutebrowser.utils.completion import CompletionModel
@ -59,8 +60,13 @@ class SearchParser(QObject):
if self.text != text:
self.do_search.emit('', 0)
self.text = text
self.flags = 0
if config.config.getboolean('general', 'ignorecase', fallback=True):
self.flags |= QWebPage.FindCaseSensitively
if config.config.getboolean('general', 'wrapsearch', fallback=True):
self.flags |= QWebPage.FindWrapsAroundDocument
if rev:
self.flags = QWebPage.FindBackward
self.flags |= QWebPage.FindBackward
self.do_search.emit(self.text, self.flags)
def nextsearch(self, count=1):

View File

@ -18,6 +18,8 @@ default_config = """
[general]
show_completion = true
space_scroll = 200
ignorecase = true
wrapsearch = true
[keybind]
o = open