From 4f4f752e47d88fa732c31d6d09545f44e303c72d Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 5 Apr 2025 20:26:20 +0100 Subject: [PATCH] Put the cursor at the right-hand end of the pre-edit string That's the more logical location in a string more than one character long. GTK does actually tell us where it thinks the cursor should be, but we don't yet pay attention to that. --- terminal/terminal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terminal/terminal.c b/terminal/terminal.c index fff9391d..6c2c9306 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -6129,7 +6129,11 @@ static void do_paint(Terminal *term) preedit_end = term->cols; preedit_start = preedit_end - term->preedit_termline->cols; } - our_curs_x = preedit_start; + if (term->preedit_termline->chars[term->preedit_termline->cols - 1] + .chr == UCSWIDE) + our_curs_x = preedit_end - 2; + else + our_curs_x = preedit_end - 1; } /*