[LyX/master] Additional cursor position validation required to avoid an assertion in Text::selectWord
Stephan Witt
switt at lyx.org
Thu Aug 11 19:49:29 UTC 2022
commit 7391ca961d7985918a8d7b4fb52b01078b83a5c9
Author: Stephan Witt <switt at lyx.org>
Date: Thu Aug 11 22:35:58 2022 +0200
Additional cursor position validation required to avoid an assertion in Text::selectWord
---
src/BufferView.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 6f1b412..da309d6 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1719,6 +1719,8 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
}
if (cur.selection())
pattern = cur.selectionAsString(false);
+ else if (!cur.inTexted())
+ break; // not suitable for selectWord at cursor
else {
pos_type spos = cur.pos();
cur.innerText()->selectWord(cur, WHOLE_WORD);
More information about the lyx-cvs
mailing list