mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-04 19:53:37 +02:00
Edit Book: Fix inline spell check context menu not working when triggered by context menu key or a right clicking at the right edge of the word.
This commit is contained in:
parent
da29398a26
commit
b616b15dd3
1 changed files with 4 additions and 0 deletions
|
|
@ -396,6 +396,10 @@ def show_context_menu(self, pos):
|
|||
a = m.addAction
|
||||
c = self.editor.cursorForPosition(pos)
|
||||
r = self.editor.syntax_range_for_cursor(c)
|
||||
if (r is None or not r.format.property(SPELL_PROPERTY).toBool()) and c.positionInBlock() > 0:
|
||||
c.setPosition(c.position() - 1)
|
||||
r = self.editor.syntax_range_for_cursor(c)
|
||||
|
||||
if r is not None and r.format.property(SPELL_PROPERTY).toBool():
|
||||
word = self.editor.text_for_range(c.block(), r)
|
||||
locale = self.editor.spellcheck_locale_for_cursor(c)
|
||||
|
|
|
|||
Loading…
Reference in a new issue