diff --git a/crates/settings_content/src/theme.rs b/crates/settings_content/src/theme.rs index c63536b0749afd055ab4883fc3169b2d1151e3f2..623e463cfb6c7da13f30b7df04b20177f598c893 100644 --- a/crates/settings_content/src/theme.rs +++ b/crates/settings_content/src/theme.rs @@ -1033,6 +1033,9 @@ pub struct ThemeColorsContent { /// Background color for Vim Visual Block mode indicator. #[serde(rename = "vim.visual_block.background")] pub vim_visual_block_background: Option, + /// Background color for Vim yank highlight. + #[serde(rename = "vim.yank.background")] + pub vim_yank_background: Option, /// Background color for Vim Helix Normal mode indicator. #[serde(rename = "vim.helix_normal.background")] pub vim_helix_normal_background: Option, diff --git a/crates/theme/src/default_colors.rs b/crates/theme/src/default_colors.rs index cc5bdd1f32dc334e0a4a7974c2ca8d263b27adb8..fce0e54c720bf2c21ded9bd8240498053a651f6d 100644 --- a/crates/theme/src/default_colors.rs +++ b/crates/theme/src/default_colors.rs @@ -175,6 +175,7 @@ impl ThemeColors { vim_visual_background: system.transparent, vim_visual_line_background: system.transparent, vim_visual_block_background: system.transparent, + vim_yank_background: neutral().light_alpha().step_3(), vim_helix_normal_background: system.transparent, vim_helix_select_background: system.transparent, vim_normal_foreground: system.transparent, @@ -320,6 +321,7 @@ impl ThemeColors { vim_visual_background: system.transparent, vim_visual_line_background: system.transparent, vim_visual_block_background: system.transparent, + vim_yank_background: neutral().dark_alpha().step_4(), vim_helix_normal_background: system.transparent, vim_helix_select_background: system.transparent, vim_normal_foreground: system.transparent, diff --git a/crates/theme/src/fallback_themes.rs b/crates/theme/src/fallback_themes.rs index b04d676774626bf708e2ef58dca6ff6b1b87d2b0..72b65f85c9ecb2776fc6066c8b926cfa4bd42929 100644 --- a/crates/theme/src/fallback_themes.rs +++ b/crates/theme/src/fallback_themes.rs @@ -257,6 +257,7 @@ pub(crate) fn zed_default_dark() -> Theme { vim_visual_background: SystemColors::default().transparent, vim_visual_line_background: SystemColors::default().transparent, vim_visual_block_background: SystemColors::default().transparent, + vim_yank_background: hsla(207.8 / 360., 81. / 100., 66. / 100., 0.2), vim_helix_normal_background: SystemColors::default().transparent, vim_helix_select_background: SystemColors::default().transparent, vim_normal_foreground: SystemColors::default().transparent, diff --git a/crates/theme/src/schema.rs b/crates/theme/src/schema.rs index afe7bf759ddf817a686e21b929345040a61cff7e..61cf869b951ac4d285e1eaca42e226a6ac3e4a6a 100644 --- a/crates/theme/src/schema.rs +++ b/crates/theme/src/schema.rs @@ -796,6 +796,11 @@ pub fn theme_colors_refinement( .vim_visual_block_background .as_ref() .and_then(|color| try_parse_color(color).ok()), + vim_yank_background: this + .vim_yank_background + .as_ref() + .and_then(|color| try_parse_color(color).ok()) + .or(editor_document_highlight_read_background), vim_helix_normal_background: this .vim_helix_normal_background .as_ref() diff --git a/crates/theme/src/styles/colors.rs b/crates/theme/src/styles/colors.rs index b54dc38fdf80665977120cf80c5a15b12b0021a6..75ba8ea391848a5a899f5ff64319a77b5f3d6ca9 100644 --- a/crates/theme/src/styles/colors.rs +++ b/crates/theme/src/styles/colors.rs @@ -175,6 +175,8 @@ pub struct ThemeColors { pub vim_visual_line_background: Hsla, /// Background color for Vim Visual Block mode indicator. pub vim_visual_block_background: Hsla, + /// Background color for Vim yank highlight. + pub vim_yank_background: Hsla, /// Background color for Vim Helix Normal mode indicator. pub vim_helix_normal_background: Hsla, /// Background color for Vim Helix Select mode indicator. diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index 2df113bfe803fd3e60d9238f7127fd84a5ef05f7..b052e865265368234d7a1bed42957a714ca9d5bb 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -207,6 +207,7 @@ impl VsCodeThemeConverter { terminal_ansi_white: vscode_colors.terminal.ansi_white.clone(), terminal_ansi_bright_white: vscode_colors.terminal.ansi_bright_white.clone(), link_text_hover: vscode_colors.text_link.active_foreground.clone(), + vim_yank_background: vscode_colors.editor.range_highlight_background.clone(), ..Default::default() }) } diff --git a/crates/vim/src/normal/yank.rs b/crates/vim/src/normal/yank.rs index 8ad4e6b9c02e3c83ba82e6383a7a32fc3b60ec22..6f2abfddd576f51e90b7c8db4f54419a365ce79b 100644 --- a/crates/vim/src/normal/yank.rs +++ b/crates/vim/src/normal/yank.rs @@ -228,7 +228,7 @@ impl Vim { editor.highlight_background( HighlightKey::HighlightOnYank, &ranges_to_highlight, - |_, colors| colors.colors().editor_document_highlight_read_background, + |_, colors| colors.colors().vim_yank_background, cx, ); cx.spawn(async move |this, cx| {