aboutsummaryrefslogtreecommitdiff
path: root/terminal.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-02-06 06:31:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-06 06:37:55 +0000
commit88dcde3ed8b30c14a5d834d0e88f9b4a5f584939 (patch)
treedadd0006f33982832580ea1b40dbf538106b153e /terminal.h
parentMerge branch 'regex-mode' (diff)
term: insert-mode: handle combining characters correctly
When the client application emits combining characters, for example multi-codepoint emojis, in insert-mode, we ended up pushing partial graphemes to the right, for each codepoint, resulting in too many cells (and with the wrong content) being inserted. The fix is fairly simple; don't "insert" when appending characters to an existing grapheme cluster. This isn't something we can detect easily in print_insert() (it would require us to do grapheme clustering again). Fortunately, we do have the required information in action_utf8_print(). So, pass this information as a boolean to term_print(). Closes #1947
Diffstat (limited to 'terminal.h')
-rw-r--r--terminal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/terminal.h b/terminal.h
index 4242ed1d..d8e7cf94 100644
--- a/terminal.h
+++ b/terminal.h
@@ -894,7 +894,8 @@ void term_cursor_up(struct terminal *term, int count);
void term_cursor_down(struct terminal *term, int count);
void term_cursor_blink_update(struct terminal *term);
-void term_print(struct terminal *term, char32_t wc, int width);
+void term_print(struct terminal *term, char32_t wc, int width,
+ bool insert_mode_disable);
void term_fill(struct terminal *term, int row, int col, uint8_t c, size_t count,
bool use_sgr_attrs);