mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix spelling correction suggestions not being shown when using the context menu key with the cursor at the end of the word
This commit is contained in:
parent
d155c08642
commit
316201354c
@ -563,7 +563,7 @@ class TextEdit(PlainTextEdit):
|
|||||||
formats = self.highlighter.parse_single_block(c.block())[0]
|
formats = self.highlighter.parse_single_block(c.block())[0]
|
||||||
pos = c.positionInBlock()
|
pos = c.positionInBlock()
|
||||||
for r in formats:
|
for r in formats:
|
||||||
if r.start <= pos < r.start + r.length and r.format.property(SPELL_PROPERTY):
|
if r.start <= pos <= r.start + r.length and r.format.property(SPELL_PROPERTY):
|
||||||
return r.format.property(SPELL_LOCALE_PROPERTY)
|
return r.format.property(SPELL_LOCALE_PROPERTY)
|
||||||
|
|
||||||
def recheck_word(self, word, locale):
|
def recheck_word(self, word, locale):
|
||||||
@ -583,7 +583,7 @@ class TextEdit(PlainTextEdit):
|
|||||||
return
|
return
|
||||||
pos = cursor.positionInBlock()
|
pos = cursor.positionInBlock()
|
||||||
for r in cursor.block().layout().additionalFormats():
|
for r in cursor.block().layout().additionalFormats():
|
||||||
if r.start <= pos < r.start + r.length and r.format.property(SYNTAX_PROPERTY):
|
if r.start <= pos <= r.start + r.length and r.format.property(SYNTAX_PROPERTY):
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def syntax_format_for_cursor(self, cursor):
|
def syntax_format_for_cursor(self, cursor):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user