[LyX/master] Fix crash when testing changes in selection

Jean-Marc Lasgouttes <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 8ac6770da10ae901cf5b01f184a7930c7f4cf438
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Fri Apr 3 16:33:25 2026 +0200

    Fix crash when testing changes in selection
    
    Testing for pit() and idx() is not enough, it is better to use
    directly id(), as was done originally in 23de5e5e.
    
    Fixes bug #13294.
---
 src/Text.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Text.cpp b/src/Text.cpp
index d38f7be132..a5fe9474da 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -6916,8 +6916,8 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
 			for (DocIterator it = cur.selectionBegin(); ; it.forwardPar()) {
 				pos_type const beg = it.pos();
 				pos_type end;
-				bool const in_last_par = (it.pit() == cur.selectionEnd().pit() &&
-							  it.idx() == cur.selectionEnd().idx());
+				bool const in_last_par
+					= (it.paragraph().id() == cur.selectionEnd().paragraph().id());
 				if (in_last_par)
 					end = cur.selectionEnd().pos();
 				else
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.