From: Jean-Marc Lasgouttes Date: Fri, 9 Apr 2021 16:15:31 +0000 (+0200) Subject: Fixup f3a0e8ff: costly thinko X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c9146e5b;p=features.git 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. --- 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.