X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Frowpainter.cpp;h=5ea2ffc8753df92b0cf9c03472f8df1c0879a938;hb=225c1dbe55635a97b183909ea7194b8d92051378;hp=c11dc3b0d90d6963aba792df609ab20472cc6a46;hpb=ad76c66e338dfe4f9aae09429a30b205fe00e257;p=lyx.git diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index c11dc3b0d9..5ea2ffc875 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -38,6 +38,8 @@ #include "insets/InsetText.h" +#include "mathed/InsetMath.h" + #include "support/debug.h" #include "support/gettext.h" #include "support/textutils.h" @@ -392,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 @@ -408,8 +410,21 @@ 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; + Cursor const & cur = bv->cursor(); + bool current_word = false; + if (cur.inTexted() && par_.id() == cur.paragraph().id()) { + pos_type cpos = cur.pos(); + if (cpos > 0 && cpos == par_.size() && !par_.isWordSeparator(cpos-1)) + --cpos; + current_word = par_.isSameSpellRange(pos, cpos) ; + } + if (!current_word) + paintMisspelledMark(orig_x, changed); } } @@ -753,7 +768,10 @@ void RowPainter::paintOnlyInsets() // If outer row has changed, nested insets are repaint completely. Inset const * inset = par_.getInset(pos); bool const nested_inset = inset && - (inset->asInsetText() || inset->asInsetTabular()); + ((inset->asInsetMath() && + !inset->asInsetMath()->asMacroTemplate()) + || inset->asInsetText() + || inset->asInsetTabular()); if (!nested_inset) continue; if (x_ > pi_.base.bv->workWidth()