X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Frowpainter.cpp;h=47ab84d3a2b5e7130eb47cebc276b3ebc8dae163;hb=1e190a2af27ca99831f51567c16e6b39bf4317c3;hp=bb529748bb653cfb397a4ce370116159c7efa03f;hpb=4e8cc18554ca1cc0f7ffa4564f5535c7eee3a63c;p=lyx.git diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index bb529748bb..47ab84d3a2 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -394,7 +394,7 @@ void RowPainter::paintFromPos(pos_type & vpos, bool changed) lang == "farsi"; // spelling correct? - bool const misspelled_ = + bool const misspelled = lyxrc.spellcheck_continuously && par_.isMisspelled(pos); // draw as many chars as we can @@ -410,8 +410,23 @@ void RowPainter::paintFromPos(pos_type & vpos, bool changed) paintForeignMark(orig_x, orig_font.language()); - if (lyxrc.spellcheck_continuously && misspelled_) { - paintMisspelledMark(orig_x, changed); + if (lyxrc.spellcheck_continuously && misspelled) { + // check for cursor position + // don't draw misspelled marker for words at cursor position + // we don't want to disturb the process of text editing + BufferView const * bv = pi_.base.bv; + DocIterator const nw = bv->cursor().newWord(); + bool new_word = false; + if (!nw.empty() && par_.id() == nw.paragraph().id()) { + pos_type cpos = nw.pos(); + if (cpos > 0 && cpos == par_.size() && !par_.isWordSeparator(cpos-1)) + --cpos; + else if (cpos > 0 && par_.isWordSeparator(cpos)) + --cpos; + new_word = par_.isSameSpellRange(pos, cpos) ; + } + if (!new_word) + paintMisspelledMark(orig_x, changed); } }