]> git.lyx.org Git - features.git/blobdiff - src/BufferView.cpp
Break the paragraph's big row according to margins
[features.git] / src / BufferView.cpp
index 526cb3379196e27db5665d69aaeedeb9b2b8ca67..25b33b953ad75a189745d1dc6824dc4cec89c87a 100644 (file)
@@ -228,7 +228,7 @@ struct BufferView::Private
        ///
        CoordCache coord_cache_;
        ///
-       typedef map<MathData const *, MathRow> MathRows;
+       typedef unordered_map<MathData const *, MathRow> MathRows;
        MathRows math_rows_;
 
        /// this is used to handle XSelection events in the right manner.
@@ -583,7 +583,7 @@ void BufferView::processUpdateFlags(Update::flags flags)
 }
 
 
-void BufferView::updateScrollbar()
+void BufferView::updateScrollbarParameters()
 {
        if (height_ == 0 && width_ == 0)
                return;
@@ -1481,6 +1481,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                else {
                        dr.screenUpdate(Update::Force | Update::FitCursor);
                        dr.forceBufferUpdate();
+                       resetInlineCompletionPos();
                        if (buffer().params().citeEngine() != engine ||
                            buffer().params().citeEngineType() != enginetype)
                                buffer().invalidateCiteLabels();
@@ -1501,6 +1502,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                else {
                        dr.screenUpdate(Update::Force | Update::FitCursor);
                        dr.forceBufferUpdate();
+                       resetInlineCompletionPos();
                        if (buffer().params().citeEngine() != engine ||
                            buffer().params().citeEngineType() != enginetype)
                                buffer().invalidateCiteLabels();
@@ -1907,7 +1909,8 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                cur.setCursor(doc_iterator_begin(cur.buffer()));
                cur.selHandle(false);
                // Force an immediate computation of metrics because we need it below
-               updateMetrics();
+               if (scrolled)
+                       processUpdateFlags(Update::Force);
 
                d->text_metrics_[&buffer_.text()].editXY(cur, p.x_, p.y_,
                        true, act == LFUN_SCREEN_UP);
@@ -3481,7 +3484,7 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret)
 
        // The scrollbar needs an update.
        // FIXME: does it always? see ticket #11947.
-       updateScrollbar();
+       updateScrollbarParameters();
 
        // Normalize anchor for next time
        pair<pit_type, ParagraphMetrics const *> firstpm = tm.first();