From f9931d792abe48842a6b8518cc2d12c5e1d466d3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Nov 2016 11:14:09 +0530 Subject: [PATCH] Edit Book: Spell check dialog: Ensure that the new current word is highlighted after changing a word. --- src/calibre/gui2/tweak_book/spell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/tweak_book/spell.py b/src/calibre/gui2/tweak_book/spell.py index f73325fc88..03f4088e60 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -1137,6 +1137,8 @@ class SpellCheck(Dialog): self.word_replaced.emit(changed_files) w = self.words_model.replace_word(w, new_word) row = self.words_model.row_for_word(w) + if row == -1: + row = self.words_view.currentIndex().row() if row > -1: self.words_view.highlight_row(row)