1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-24 06:25:03 -05:00

Set ATTR_RIGHTCURS on pre-edit cursor

Currently, we display the cursor at the right-hand end of the pre-edit
text.  That looks good for block and underline cursors, but it's a bit
weird for the vertical line, which naturally appears at the left edge
of the rightmost character.  Setting ATTR_RIGHTCURS fixes this and
means that the vertical-line cursor appears at the right edge of the
rightmost character.

That also corrects a weirdness where ATTR_RIGHTCURS was leaking
through from the underlying pending-wrap state of the terminal, which
was definitely wrong.
This commit is contained in:
Ben Harris 2025-04-06 13:31:15 +01:00
parent 368d74cc25
commit 9fcff77767

View File

@ -6128,11 +6128,13 @@ static void do_paint(Terminal *term)
preedit_end = term->cols;
preedit_start = preedit_end - term->preedit_termline->cols;
}
/* Show the cursor at the right end of the pre-edit text. */
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;
cursor |= ATTR_RIGHTCURS;
}
/*