]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
HTML for comments and colors.
[lyx.git] / src / BufferView.cpp
index 6a1e25e6922b19c2d0582b92cbeb308f0c54b25c..0d5b76a61482d1284b18502ef258c39a0acd0c70 100644 (file)
@@ -816,7 +816,7 @@ void BufferView::showCursor()
 void BufferView::showCursor(DocIterator const & dit, bool recenter)
 {
        if (scrollToCursor(dit, recenter)) {
-               buffer_.changed(false);
+               buffer_.changed(true);
                updateHoveredInset();
        }
 }
@@ -824,8 +824,10 @@ void BufferView::showCursor(DocIterator const & dit, bool recenter)
 
 void BufferView::scrollToCursor()
 {
-       if (scrollToCursor(d->cursor_, false))
+       if (scrollToCursor(d->cursor_, false)) {
+               buffer_.changed(true);
                updateHoveredInset();
+       }
 }
 
 
@@ -873,11 +875,7 @@ bool BufferView::scrollToCursor(DocIterator const & dit, bool recenter)
                        scrolled = scrollDown(ypos - height_ + defaultRowHeight() ); 
 
                // else, nothing to do, the cursor is already visible so we just return.
-               if (scrolled != 0) {
-                       updateMetrics();
-                       return true;
-               }
-               return false;
+               return scrolled != 0;
        }
 
        // fix inline completion position
@@ -904,7 +902,6 @@ bool BufferView::scrollToCursor(DocIterator const & dit, bool recenter)
        else
                d->anchor_ypos_ = defaultRowHeight() * 2;
 
-       updateMetrics();
        return true;
 }
 
@@ -2050,10 +2047,12 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
 void BufferView::lfunScroll(FuncRequest const & cmd)
 {
        string const scroll_type = cmd.getArg(0);
-       int const scroll_step = 
-               (scroll_type == "line") ? d->scrollbarParameters_.single_step
-               : (scroll_type == "page") ? d->scrollbarParameters_.page_step : 0;
-       if (scroll_step == 0)
+       int scroll_step = 0;
+       if (scroll_type == "line")
+               scroll_step = d->scrollbarParameters_.single_step;
+       else if (scroll_type == "page")
+               scroll_step = d->scrollbarParameters_.page_step;
+       else
                return;
        string const scroll_quantity = cmd.getArg(1);
        if (scroll_quantity == "up")