[LyX/master] Fix preedit caret position in insets

Koji Yokota <[email protected]>
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 8e9d82787c6021c501b080f1963df330b658e9d0
Author: Koji Yokota <[email protected]>
Date:   Thu Apr 23 14:29:25 2026 +0900

    Fix preedit caret position in insets
    
    This fixes the caret position of preedits when preedit inputs goes over
    two rows or more
---
 src/frontends/qt/GuiInputMethod.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/frontends/qt/GuiInputMethod.cpp b/src/frontends/qt/GuiInputMethod.cpp
index 654a4af573..f1404054a5 100644
--- a/src/frontends/qt/GuiInputMethod.cpp
+++ b/src/frontends/qt/GuiInputMethod.cpp
@@ -788,11 +788,8 @@ std::array<int,2> GuiInputMethod::setCaretOffset(pos_type caret_pos)
 		int left_margin;
 		int inset_offset;
 		if (d->cur_->depth() > 1) {
-			pit_type & outer_pit = d->cur_->bottom().pit();
-			TextMetrics & tm =
-			        d->buffer_view_->textMetrics(d->cur_->bottom().text());
-			left_margin = tm.leftMargin(outer_pit);
-			inset_offset = d->cur_->inset().leftOffset(d->buffer_view_);
+			left_margin = d->cur_->inset().leftOffset(&d->cur_->bv());
+			inset_offset =  d->cur_->inset().xo(d->cur_->bv());
 		} else {
 			left_margin = d->rows_[caret_row.index].left_margin;
 			inset_offset = 0;
-- 
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.