Le 27/01/2022 à 17:26, Jean-Marc Lasgouttes a écrit :
So finally, the MathRow object points to an inset that has been deleted at the time of the completion. There should be code somewhere that should regenerate the math row. I'll have a look.

This seems to work and makes sense. Could someone do a quick check before I commit ? I will run it under valgrind later, when I am in front of an old enough ubuntu box.

JMarc


From f400a2cfa9b5552c103da0b7e336b6964dfa5b2d Mon Sep 17 00:00:00 2001
From: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date: Fri, 28 Jan 2022 17:13:30 +0100
Subject: [PATCH] Force redraw after completion

Inside a math inset when completing macro names, it could lead to crashes.

Note that this processUpdateFlags is present when outside of this if() branch.
---
 src/frontends/qt/GuiCompleter.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/frontends/qt/GuiCompleter.cpp b/src/frontends/qt/GuiCompleter.cpp
index 6fd39d3039..6effd3d05b 100644
--- a/src/frontends/qt/GuiCompleter.cpp
+++ b/src/frontends/qt/GuiCompleter.cpp
@@ -701,6 +701,10 @@ void GuiCompleter::tab()
 		hidePopup();
 		hideInline(cur);
 		updateVisibility(false, false);
+
+		// redraw if needed
+		if (cur.result().screenUpdate())
+			gui_->bufferView().processUpdateFlags(cur.result().screenUpdate());
 		return;
 	}
 	docstring nextchar = completion.substr(prefix.size(), 1);
-- 
2.32.0

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

Reply via email to