]> git.lyx.org Git - features.git/commitdiff
Limit the search for the word at current cursor position only to the case in which...
authorTommaso Cucinotta <tommaso@lyx.org>
Sat, 20 Mar 2010 12:15:05 +0000 (12:15 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Sat, 20 Mar 2010 12:15:05 +0000 (12:15 +0000)
Fixes crash in #6573.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33811 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyxfind.cpp

index 4f3151dd2bda0e0c8bc066df3e08a7f82d006073..6aade107bb2411469f5352b616f1463b54f726c2 100644 (file)
@@ -206,8 +206,10 @@ bool stringSelected(BufferView * bv, docstring & searchstr,
                    bool cs, bool mw, bool fw)
 {
        // if nothing selected and searched string is empty, this
-       // means that we want to search current word at cursor position.
-       if (!bv->cursor().selection() && searchstr.empty()) {
+       // means that we want to search current word at cursor position,
+       // but only if we are in texted() mode.
+       if (!bv->cursor().selection() && searchstr.empty()
+           && bv->cursor().inTexted()) {
                bv->cursor().innerText()->selectWord(bv->cursor(), WHOLE_WORD);
                searchstr = bv->cursor().selectionAsString(false);
                return true;