From c9146e5be087638d0dc115e862fd685c74e257e4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 9 Apr 2021 18:15:31 +0200 Subject: [PATCH] Fixup f3a0e8ff: costly thinko When the buffer stuff has been updated, the Buffer::needUpdate() should be reset to false. This was forgotten in f3a0e8ff. Fixes performance issues with MergedManuals, for example. UpdateBuffer would be run again and again when selecting text. --- src/Buffer.cpp | 7 +++++++ src/Buffer.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index c66b730d9d..c3d1276b84 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -4914,6 +4914,13 @@ void Buffer::bufferRefs(TeXErrors const & terr, ErrorList & errorList) const } +void Buffer::updateBuffer() const +{ + updateBuffer(UpdateMaster, InternalUpdate); + d->need_update = false; +} + + void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const { LBUFERR(!text().paragraphs().empty()); diff --git a/src/Buffer.h b/src/Buffer.h index 6d4f77c3fd..e342199b25 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -728,7 +728,7 @@ public: /// Updates screen labels and some other information associated with /// insets and paragraphs. Actually, it's more like a general "recurse /// through the Buffer" routine, that visits all the insets and paragraphs. - void updateBuffer() const { updateBuffer(UpdateMaster, InternalUpdate); } + void updateBuffer() const; /// \param scope: whether to start with the master document or just /// do this one. /// \param output: whether we are preparing for output. -- 2.39.2