aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2024-10-15 11:41:08 +0300
committerGitHub <noreply@github.com>2024-10-15 11:41:08 +0300
commita5bb567c0a15bed65ff18c94d04c8c147bf817a9 (patch)
treeda9efc2394af9c52ade67832ab172a5ab3fa8400 /alacritty/src/event.rs
parenta2653293a8e6ac5f5fb9f7e075656799d8df3488 (diff)
downloadr-alacritty-a5bb567c0a15bed65ff18c94d04c8c147bf817a9.tar.gz
r-alacritty-a5bb567c0a15bed65ff18c94d04c8c147bf817a9.tar.bz2
r-alacritty-a5bb567c0a15bed65ff18c94d04c8c147bf817a9.zip
Implement multi-char cursor highlight
Use `end` of the cursor to draw a `HollowBlock` from `start` to `end`. When cursor covers only a single character, use `Beam` cursor instead of `HollowBlock`. Fixes #8238. Fixes #7849.
Diffstat (limited to 'alacritty/src/event.rs')
-rw-r--r--alacritty/src/event.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs
index b4600ae3..46e9433c 100644
--- a/alacritty/src/event.rs
+++ b/alacritty/src/event.rs
@@ -1843,11 +1843,8 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
self.ctx.update_cursor_blinking();
},
Ime::Preedit(text, cursor_offset) => {
- let preedit = if text.is_empty() {
- None
- } else {
- Some(Preedit::new(text, cursor_offset.map(|offset| offset.0)))
- };
+ let preedit =
+ (!text.is_empty()).then(|| Preedit::new(text, cursor_offset));
if self.ctx.display.ime.preedit() != preedit.as_ref() {
self.ctx.display.ime.set_preedit(preedit);