]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.cpp
Help avoiding shortcut clashes by discriminating strings.
[lyx.git] / src / rowpainter.cpp
index 5fe34d792e41724cba988a1c9850b117276b03dd..5d0bcb6b2850e11ac51c091ad3b53d2ede810071 100644 (file)
@@ -417,10 +417,12 @@ 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;
+                       else if (cpos > 0 && par_.isWordSeparator(cpos))
+                               --cpos;
                        current_word = par_.isSameSpellRange(pos, cpos) ;
                }
                if (!current_word)