]> git.lyx.org Git - lyx.git/blobdiff - src/bufferview_funcs.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / bufferview_funcs.C
index 170ed0b80e0fb8cfbae8a527cdf52d48929b9940..3135a75461e8840ff99790c423f703b3ca6526e8 100644 (file)
@@ -253,12 +253,15 @@ void gotoInset(BufferView * bv, vector<InsetBase_code> const & codes,
        }
 
        if (!gotoNextInset(tmpcur, codes, contents)) {
-               if (tmpcur != doc_iterator_begin(tmpcur.inset())) {
+               if (bv->cursor() != doc_iterator_begin(bv->buffer()->inset())) {
                        tmpcur.reset(tmpcur.bottom().inset());
-                       if (!gotoNextInset(tmpcur, codes, contents))
+                       if (!gotoNextInset(tmpcur, codes, contents)) {
                                bv->cursor().message(_("No more insets"));
+                               return;
+                       }
                } else {
                        bv->cursor().message(_("No more insets"));
+                       return;
                }
        }