From 4ea6d81437ec7b5bea165d78ca37cb163e262042 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Fri, 28 Dec 2018 10:40:38 -0500 Subject: [PATCH] Fix assertion when checking if change in selection MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The check for the iterator being in the same paragraph as the end of selection was incorrect, because paragraphs in different cells could have the same pit. We now additionally condition on having the same idx. This commit amends d1279875 (and thus 23de5e5e). For discussion, see: https://www.mail-archive.com/search?l=mid&q=a5afd0c01a0eb9a84fd4d050d15eb23016d6f38a.camel%40lyx.org Thanks to Jürgen. (cherry picked from commit c5301a6495b108df5b307da39dad5be65926f76b) --- src/Text3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index b5f9e33f47..8bd5d10e6b 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -3210,7 +3210,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()); + bool const in_last_par = (it.pit() == cur.selectionEnd().pit() && + it.idx() == cur.selectionEnd().idx()); if (in_last_par) end = cur.selectionEnd().pos(); else -- 2.39.5