]> git.lyx.org Git - features.git/commitdiff
Fixed issue #8543 also for advanced search (cursor moved at proper end of selection...
authorTommaso Cucinotta <tommaso@lyx.org>
Wed, 3 Apr 2013 23:43:36 +0000 (00:43 +0100)
committerTommaso Cucinotta <tommaso@lyx.org>
Wed, 3 Apr 2013 23:43:36 +0000 (00:43 +0100)
src/lyxfind.cpp

index a2fcf004f89276ea8e892e0413a6c50d0387e58b..62255c4ba91065625bb50d911b333a2e6bebae82 100644 (file)
@@ -1445,6 +1445,14 @@ bool findAdv(BufferView * bv, FindAndReplaceOptions const & opt)
 
        try {
                MatchStringAdv matchAdv(bv->buffer(), opt);
+               int length = bv->cursor().selectionEnd().pos() - bv->cursor().selectionBegin().pos();
+               if (length > 0) {
+                       LYXERR(Debug::FIND, "Putting selection at cur=" << cur << " with length: " << length << " and direction: " << !opt.forward);
+                       if (opt.forward)
+                               bv->putSelectionAt(bv->cursor().selectionBegin(), length, false);
+                       else
+                               bv->putSelectionAt(bv->cursor().selectionBegin(), length, true);
+               }
                findAdvReplace(bv, opt, matchAdv);
                cur = bv->cursor();
                if (opt.forward)