Commit 19937b68 authored by twanvl's avatar twanvl

fixed spelling correction popup when there is no extra dictionary

parent c7429980
...@@ -519,10 +519,11 @@ String spellcheck_word_at(const String& str, size_t start) { ...@@ -519,10 +519,11 @@ String spellcheck_word_at(const String& str, size_t start) {
void spellcheck_language_at(const String& str, size_t error_pos, SpellChecker** out) { void spellcheck_language_at(const String& str, size_t error_pos, SpellChecker** out) {
String tag = tag_at(str,error_pos); String tag = tag_at(str,error_pos);
size_t pos = min(tag.find_first_of(_(':')), tag.size()-1); size_t pos = min(tag.find_first_of(_(':')), tag.size()-1);
size_t pos2 = min(tag.find_first_of(_(':'),pos+1), tag.size()-1); size_t pos2 = min(tag.find_first_of(_(':'),pos+1), tag.size());
String language = tag.substr(pos+1,pos2-pos-1); String language = tag.substr(pos+1,pos2-pos-1);
if (language.empty()) return; if (language.empty()) return;
out[0] = &SpellChecker::get(language); out[0] = &SpellChecker::get(language);
if (pos2 >= tag.size()) return;
String extra = tag.substr(pos2+1); String extra = tag.substr(pos2+1);
if (extra.empty()) return; if (extra.empty()) return;
out[1] = &SpellChecker::get(extra,language); out[1] = &SpellChecker::get(extra,language);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment