When AutoDetectLanguage is set, the same document can contain multiple
languages. In that case, Highlighter stores the language information
into the block's userdata, and changes the spellchecker language at
every change. So the suggestions were using whatever was the language
of the last block that was checked, which led to pretty random behaviour
for the user.
Fixed by using a QTextCursor to retrieve the cached language for the
word we're showing suggestions for.
Includes a separate commit for Loader:
honour Settings::defaultClient(), useful for unittests.