]> git.lyx.org Git - features.git/commitdiff
more careful check for mathed to normal text change and vice versa for correct displa...
authorStephan Witt <switt@lyx.org>
Tue, 28 Dec 2010 13:20:20 +0000 (13:20 +0000)
committerStephan Witt <switt@lyx.org>
Tue, 28 Dec 2010 13:20:20 +0000 (13:20 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37020 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp
src/rowpainter.cpp

index f2a7a803cb0cb203b824bf040f6251599aadb5d2..9d63fa78b785b6041b062723b61ed67f5b4246e1 100644 (file)
@@ -2174,13 +2174,17 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
        needsUpdate |= (cur.pos() != cur.lastpos()) && cur.selection();
 
-       if (lyxrc.spellcheck_continuously && !needsUpdate && cur.inTexted()) {
+       if (lyxrc.spellcheck_continuously && !needsUpdate) {
                // Check for misspelled text
                // The redraw is useful because of the painting of
                // misspelled markers depends on the cursor position.
                // Trigger a redraw for cursor moves inside misspelled text.
-               if (cur.paragraph().id() != last_pid || cur.pos() != last_pos) {
-                       needsUpdate |= last_misspelled || cur.paragraph().isMisspelled(cur.pos());
+               if (!cur.inTexted()) {
+                       // move from regular text to math
+                       needsUpdate = last_misspelled;
+               } else if (cur.paragraph().id() != last_pid || cur.pos() != last_pos) {
+                       // move inside regular text
+                       needsUpdate = last_misspelled || cur.paragraph().isMisspelled(cur.pos());
                }
        }
 
index 5fe34d792e41724cba988a1c9850b117276b03dd..5ea2ffc8753df92b0cf9c03472f8df1c0879a938 100644 (file)
@@ -417,7 +417,7 @@ void RowPainter::paintFromPos(pos_type & vpos, bool changed)
                BufferView const * bv = pi_.base.bv;
                Cursor const & cur = bv->cursor();
                bool current_word = false;
-               if (par_.id() == cur.paragraph().id()) {
+               if (cur.inTexted() && par_.id() == cur.paragraph().id()) {
                        pos_type cpos = cur.pos();
                        if (cpos > 0 && cpos == par_.size() && !par_.isWordSeparator(cpos-1))
                                --cpos;