]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Tooltips for collapsables and branches
[lyx.git] / src / BufferView.cpp
index 148b3e77860365d9e5a1a9ee63cf93ee0294be6c..5558f2889b836c6294ec055dee450344ce0d13b9 100644 (file)
@@ -1018,24 +1018,24 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                        DocIterator dit = b->getParFromID(id);
                        if (dit.atEnd()) {
                                LYXERR(Debug::INFO, "No matching paragraph found! [" << id << "].");
+                               ++i;
+                               continue;
+                       }
+                       LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id()
+                               << " found in buffer `"
+                               << b->absFileName() << "'.");
+
+                       if (b == &buffer_) {
+                               // Set the cursor
+                               setCursor(dit);
+                               processUpdateFlags(Update::Force | Update::FitCursor);
                        } else {
-                               LYXERR(Debug::INFO, "Paragraph " << dit.paragraph().id()
-                                       << " found in buffer `"
-                                       << b->absFileName() << "'.");
-
-                               if (b == &buffer_) {
-                                       // Set the cursor
-                                       setCursor(dit);
-                                       showCursor();
-                               } else {
-                                       // Switch to other buffer view and resend cmd
-                                       theLyXFunc().dispatch(FuncRequest(
-                                               LFUN_BUFFER_SWITCH, b->absFileName()));
-                                       theLyXFunc().dispatch(cmd);
-                               }
-                               break;
+                               // Switch to other buffer view and resend cmd
+                               theLyXFunc().dispatch(FuncRequest(
+                                       LFUN_BUFFER_SWITCH, b->absFileName()));
+                               theLyXFunc().dispatch(cmd);
                        }
-                       ++i;
+                       break;
                }
                break;
        }
@@ -1108,7 +1108,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                break;
 
        case LFUN_WORD_FIND:
-               find(this, cmd);
+               if (find(this, cmd))
+                       showCursor();
+               else
+                       message(_("String not found!"));
                break;
 
        case LFUN_WORD_REPLACE: {
@@ -1727,6 +1730,9 @@ void BufferView::putSelectionAt(DocIterator const & cur,
                } else
                        d->cursor_.setSelection(d->cursor_, length);
        }
+       // Ensure a redraw happens in any case because the new selection could 
+       // possibly be on the same screen as the previous selection.
+       processUpdateFlags(Update::Force | Update::FitCursor);
 }