From 5c8073d3444eb17254e59f6740e48256079dbf38 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Wed, 7 Feb 2024 12:52:49 +0100 Subject: [PATCH] Underline text if in dead key state (#7488) This highlights dead keys. Example: when in Brazilian keyboard layout and typing `"` it's now underlined. https://github.com/zed-industries/zed/assets/1185253/a6b65f7b-1007-473d-ab0f-5d658faa191b Release Notes: - Fixed dead keys not being underlined. Co-authored-by: Antonio --- crates/editor/src/editor.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 4cbd8965df7bccaeeab654ac797f844ef214c0c3..d37ba5f3c72b662f7d0d294d97b3fdc971f26db2 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -61,8 +61,8 @@ use gpui::{ DispatchPhase, ElementId, EventEmitter, FocusHandle, FocusableView, FontId, FontStyle, FontWeight, HighlightStyle, Hsla, InteractiveText, KeyContext, Model, MouseButton, ParentElement, Pixels, Render, SharedString, Styled, StyledText, Subscription, Task, TextStyle, - UniformListScrollHandle, View, ViewContext, ViewInputHandler, VisualContext, WeakView, - WhiteSpace, WindowContext, + UnderlineStyle, UniformListScrollHandle, View, ViewContext, ViewInputHandler, VisualContext, + WeakView, WhiteSpace, WindowContext, }; use highlight_matching_bracket::refresh_matching_bracket_highlights; use hover_popover::{hide_hover, HoverState}; @@ -9714,7 +9714,14 @@ impl ViewInputHandler for Editor { } else { this.highlight_text::( marked_ranges.clone(), - HighlightStyle::default(), // todo!() this.style(cx).composition_mark, + HighlightStyle { + underline: Some(UnderlineStyle { + thickness: px(1.), + color: None, + wavy: false, + }), + ..Default::default() + }, cx, ); }