mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
...
This commit is contained in:
parent
f58a115f5e
commit
6ee7e7af46
@ -430,7 +430,7 @@ class TextEdit(PlainTextEdit):
|
|||||||
block = c.block()
|
block = c.block()
|
||||||
while block.isValid():
|
while block.isValid():
|
||||||
for r in block.layout().additionalFormats():
|
for r in block.layout().additionalFormats():
|
||||||
if r.format.property(SPELL_PROPERTY).toBool():
|
if r.format.property(SPELL_PROPERTY):
|
||||||
if not from_cursor or block.position() + r.start + r.length > c.position():
|
if not from_cursor or block.position() + r.start + r.length > c.position():
|
||||||
c.setPosition(block.position() + r.start)
|
c.setPosition(block.position() + r.start)
|
||||||
c.setPosition(c.position() + r.length, c.KeepAnchor)
|
c.setPosition(c.position() + r.length, c.KeepAnchor)
|
||||||
|
@ -426,11 +426,11 @@ class Editor(QMainWindow):
|
|||||||
c = self.editor.cursorForPosition(pos)
|
c = self.editor.cursorForPosition(pos)
|
||||||
origc = QTextCursor(c)
|
origc = QTextCursor(c)
|
||||||
r = origr = self.editor.syntax_range_for_cursor(c)
|
r = origr = self.editor.syntax_range_for_cursor(c)
|
||||||
if (r is None or not r.format.property(SPELL_PROPERTY).toBool()) and c.positionInBlock() > 0:
|
if (r is None or not r.format.property(SPELL_PROPERTY)) and c.positionInBlock() > 0:
|
||||||
c.setPosition(c.position() - 1)
|
c.setPosition(c.position() - 1)
|
||||||
r = self.editor.syntax_range_for_cursor(c)
|
r = self.editor.syntax_range_for_cursor(c)
|
||||||
|
|
||||||
if r is not None and r.format.property(SPELL_PROPERTY).toBool():
|
if r is not None and r.format.property(SPELL_PROPERTY):
|
||||||
word = self.editor.text_for_range(c.block(), r)
|
word = self.editor.text_for_range(c.block(), r)
|
||||||
locale = self.editor.spellcheck_locale_for_cursor(c)
|
locale = self.editor.spellcheck_locale_for_cursor(c)
|
||||||
orig_pos = c.position()
|
orig_pos = c.position()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user