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)

This commit is contained in:
Kovid Goyal 2017-03-09 09:03:16 +05:30
parent 333ab06fbd
commit 0d01bf5573

View File

@ -8,6 +8,7 @@ __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
import cPickle, os, sys import cPickle, os, sys
from collections import defaultdict, OrderedDict from collections import defaultdict, OrderedDict
from itertools import chain
from threading import Thread from threading import Thread
from functools import partial from functools import partial
@ -1093,7 +1094,7 @@ class SpellCheck(Dialog):
suggestions = dictionaries.suggestions(*w) suggestions = dictionaries.suggestions(*w)
self.suggested_list.clear() self.suggested_list.clear()
word_suggested = False word_suggested = False
for i, s in enumerate(suggestions): for i, s in enumerate(chain(suggestions, (current_word,))):
item = QListWidgetItem(s, self.suggested_list) item = QListWidgetItem(s, self.suggested_list)
if i == 0: if i == 0:
self.suggested_list.setCurrentItem(item) self.suggested_list.setCurrentItem(item)