[LyX/master] Fix first draw of auto-open inset

Jean-Marc Lasgouttes lasgouttes at lyx.org
Sat May 23 14:28:11 UTC 2020


commit 7761e1317eaa2c880446f05b707b03067d665681
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Sat May 23 16:47:48 2020 +0200

    Fix first draw of auto-open inset
    
    note-next and reference-next should trigger an update so that metrics
    are updated when the cursor ends up in an auto-open inset.
    
    Fixes bug #11870.
---
 src/BufferView.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 621b58e..43d74b6 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1531,6 +1531,10 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
 
 	case LFUN_NOTE_NEXT:
 		gotoInset(this, NOTE_CODE, false);
+		// FIXME: if SinglePar is changed to act on the inner
+		// paragraph, this will not be OK anymore. The update is
+		// useful for auto-open collapsible insets.
+		dr.screenUpdate(Update::SinglePar | Update::FitCursor);
 		break;
 
 	case LFUN_REFERENCE_NEXT: {
@@ -1538,6 +1542,10 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
 		tmp.push_back(LABEL_CODE);
 		tmp.push_back(REF_CODE);
 		gotoInset(this, tmp, true);
+		// FIXME: if SinglePar is changed to act on the inner
+		// paragraph, this will not be OK anymore. The update is
+		// useful for auto-open collapsible insets.
+		dr.screenUpdate(Update::SinglePar | Update::FitCursor);
 		break;
 	}
 


More information about the lyx-cvs mailing list