Edit Book: When jumping to next occurrence of a word, take language into account

This commit is contained in:
Kovid Goyal 2016-05-24 10:27:38 +05:30
parent 03c2c5ea89
commit a39fed6350

View File

@ -391,6 +391,8 @@ class TextEdit(PlainTextEdit):
c.setPosition(c.anchor() + idx)
c.setPosition(c.position() + string_length(word), c.KeepAnchor)
if self.smarts.verify_for_spellcheck(c, self.highlighter):
locale = self.spellcheck_locale_for_cursor(c)
if not lang or (locale and lang == locale.langcode):
self.setTextCursor(c)
if center_on_cursor:
self.centerCursor()