From 0d01bf55739b1a4df22e06ebb41861ada47ac482 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Mar 2017 09:03:16 +0530 Subject: [PATCH] Edit Book: Spell Check dialog: Always add the original word as one of the spelling corrections, so that small edits to the word can be made easily. Fixes #1667914 [Suggesting always the assumed misspelled word in the spellchecker](https://bugs.launchpad.net/calibre/+bug/1667914) --- src/calibre/gui2/tweak_book/spell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/spell.py b/src/calibre/gui2/tweak_book/spell.py index dfa6610c27..37dc5e3c6b 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -8,6 +8,7 @@ __copyright__ = '2014, Kovid Goyal ' import cPickle, os, sys from collections import defaultdict, OrderedDict +from itertools import chain from threading import Thread from functools import partial @@ -1093,7 +1094,7 @@ class SpellCheck(Dialog): suggestions = dictionaries.suggestions(*w) self.suggested_list.clear() word_suggested = False - for i, s in enumerate(suggestions): + for i, s in enumerate(chain(suggestions, (current_word,))): item = QListWidgetItem(s, self.suggested_list) if i == 0: self.suggested_list.setCurrentItem(item)