From 3bbde58c098b0afca6c8a5c56cc1ea71f7eaafc5 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 5 Apr 2025 15:47:52 +0100 Subject: [PATCH] Properly hide existing combining characters with pre-edit text If a character cell under the pre-edit text has a combining character, it shouldn't be combined with a character from the pre-edit text, but should be hidden instead. This also means that the pre-edit text could contain combining characters if I implemented a way to put them into it. --- terminal/terminal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terminal/terminal.c b/terminal/terminal.c index 5cf726d7..287355ad 100644 --- a/terminal/terminal.c +++ b/terminal/terminal.c @@ -6279,6 +6279,10 @@ static void do_paint(Terminal *term) unsigned long tattr, tchar; bool break_run, do_copy, next_run_dirty = false; termchar *d = lchars + j; + bool in_preedit = j >= preedit_start && j < preedit_end; + + if (in_preedit) + d = term->preedit_termchars + j - preedit_start; tattr = newline[j].attr; tchar = newline[j].chr;