aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2025-01-10 06:57:21 +0300
committerKirill Chibisov <contact@kchibisov.com>2025-01-10 10:59:07 +0300
commit28910e3adc9d48edc4f43008d987eecd869ded31 (patch)
tree56bebe67c0f97709a49bd3c907d380d9b0e8c112
parent8ab406d3fd51620a1ded910bc89fc02a2bcb838a (diff)
downloadr-alacritty-28910e3adc9d48edc4f43008d987eecd869ded31.tar.gz
r-alacritty-28910e3adc9d48edc4f43008d987eecd869ded31.tar.bz2
r-alacritty-28910e3adc9d48edc4f43008d987eecd869ded31.zip
Fix cut off wide characters in preedit string
The wide char spacers must not be drawn, like we do for regular wide characters.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/renderer/mod.rs8
2 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9fe121d4..6ab157db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@ Notable changes to the `alacritty_terminal` crate are documented in its
- First daemon mode window ignoring window options passed through CLI
- Report of Enter/Tab/Backspace in kitty keyboard's report event types mode
- Crash when pressing certain modifier keys on macOS 15+
+- Cut off wide characters in preedit string
## 0.14.0
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs
index 16885b31..3362db42 100644
--- a/alacritty/src/renderer/mod.rs
+++ b/alacritty/src/renderer/mod.rs
@@ -206,10 +206,10 @@ impl Renderer {
glyph_cache: &mut GlyphCache,
) {
let mut wide_char_spacer = false;
- let cells = string_chars.enumerate().map(|(i, character)| {
+ let cells = string_chars.enumerate().filter_map(|(i, character)| {
let flags = if wide_char_spacer {
wide_char_spacer = false;
- Flags::WIDE_CHAR_SPACER
+ return None;
} else if character.width() == Some(2) {
// The spacer is always following the wide char.
wide_char_spacer = true;
@@ -218,7 +218,7 @@ impl Renderer {
Flags::empty()
};
- RenderableCell {
+ Some(RenderableCell {
point: Point::new(point.line, point.column + i),
character,
extra: None,
@@ -227,7 +227,7 @@ impl Renderer {
fg,
bg,
underline: fg,
- }
+ })
});
self.draw_cells(size_info, glyph_cache, cells);