History

Disable ligatures in SSH connection dialogue (#20549)

Closes #20381 Release Notes: - Fixed password dialog for remote server showing ligatures

Conrad Irwin committed 2 years ago

Commit 47ca3401 parent d1e2c6e2 files · +8 −2Browse files

Unified · Split

2 files
  1. crates/gpui/src/text_system/font_features.rs +5 −0
  2. crates/recent_projects/src/ssh_connections.rs +3 −2
crates/gpui/src/text_system/font_features.rs+5−0
@@ -7,6 +7,11 @@ use schemars::schema::{InstanceType, SchemaObject}; · 6 unmodified lines
7pub struct FontFeatures(pub Arc<Vec<(String, u32)>>);7pub struct FontFeatures(pub Arc<Vec<(String, u32)>>);
8 8
9impl FontFeatures {9impl FontFeatures {
10 /// Disables `calt`.
11 pub fn disable_ligatures() -> Self {
12 Self(Arc::new(vec![("calt".into(), 0)]))
13 }
14
10 /// Get the tag name list of the font OpenType features15 /// Get the tag name list of the font OpenType features
11 /// only enabled or disabled features are returned16 /// only enabled or disabled features are returned
12 pub fn tag_value_list(&self) -> &[(String, u32)] {17 pub fn tag_value_list(&self) -> &[(String, u32)] {
crates/recent_projects/src/ssh_connections.rs+3−2
@@ -7,8 +7,8 @@ use editor::Editor; · 6 unmodified lines
7use futures::channel::oneshot;7use futures::channel::oneshot;
8use gpui::{8use gpui::{
9 percentage, Animation, AnimationExt, AnyWindowHandle, AsyncAppContext, DismissEvent,9 percentage, Animation, AnimationExt, AnyWindowHandle, AsyncAppContext, DismissEvent,
10 EventEmitter, FocusableView, ParentElement as _, PromptLevel, Render, SemanticVersion,10 EventEmitter, FocusableView, FontFeatures, ParentElement as _, PromptLevel, Render,
11 SharedString, Task, TextStyleRefinement, Transformation, View, WeakView,11 SemanticVersion, SharedString, Task, TextStyleRefinement, Transformation, View, WeakView,
12};12};
13use gpui::{AppContext, Model};13use gpui::{AppContext, Model};
14 14
@@ -178,6 +178,7 @@ impl SshPrompt { · 163 unmodified lines
178 let mut text_style = cx.text_style();178 let mut text_style = cx.text_style();
179 let refinement = TextStyleRefinement {179 let refinement = TextStyleRefinement {
180 font_family: Some(theme.buffer_font.family.clone()),180 font_family: Some(theme.buffer_font.family.clone()),
181 font_features: Some(FontFeatures::disable_ligatures()),
181 font_size: Some(theme.buffer_font_size.into()),182 font_size: Some(theme.buffer_font_size.into()),
182 color: Some(cx.theme().colors().editor_foreground),183 color: Some(cx.theme().colors().editor_foreground),
183 background_color: Some(gpui::transparent_black()),184 background_color: Some(gpui::transparent_black()),