Re: [LyX/master] Run updateBuffer when adding/merging changes

2021-01-29 Thread Jean-Marc Lasgouttes

Le 28/01/2021 à 15:54, Richard Kimberly Heck a écrit :

-    if (cur.needBufferUpdate()) {
+    if (cur.needBufferUpdate() || buffer().needUpdate()) {
  cur.clearBufferUpdate();


Shouldn't the Buffer::updateBuffer_ member also be reset here?


Good catch. Thanks.

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Run updateBuffer when adding/merging changes

2021-01-28 Thread Richard Kimberly Heck

On 1/28/21 5:28 AM, Jean-Marc Lasgouttes wrote:

commit f3a0e8ff9a9b914d40eb520bb31674d1ad4eb0d0
Author: Jean-Marc Lasgouttes 
Date:   Thu Jan 28 10:10:18 2021 +0100

 Run updateBuffer when adding/merging changes
 
 Following 4a4ded22, the enabling of some change-related functions is

 handled in updateBuffer. However, this method is not ran at every
 document change for performance reasons.
 
 This patch adds code to every place that modifies

 Paragraph::Private::changes_ that checks whether the `changedness' of
 the paragraph, err... changes.
 
 To this end, a new helper struct is introduced that remembers

 paragraph state at contruction time, and compares it to new state in
 the destructor.
 
 New forceUpdate/needUpdate methods are added to Buffer class, since

 the cursor is in general not available in the places where these
 changes are made.
 
 Fixes bug #12074.

---
  src/Buffer.cpp |   17 -
  src/Buffer.h   |6 -
  src/BufferView.cpp |2 +-
  src/Paragraph.cpp  |   69 
  4 files changed, 91 insertions(+), 3 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 6454ba3..f2a3702 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index ec89084..8094c64 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -2417,7 +2417,7 @@ void BufferView::mouseEventDispatch(FuncRequest const & 
cmd0)
// Do we have a selection?
theSelection().haveSelection(cursor().selection());
  
-	if (cur.needBufferUpdate()) {

+   if (cur.needBufferUpdate() || buffer().needUpdate()) {
cur.clearBufferUpdate();


Shouldn't the Buffer::updateBuffer_ member also be reset here?

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel