Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Add a theme entry for whitespace, use it to style whitespaces
Nate Butlerab6b3adb2b23
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rsindex 326963a0a5a..a3ad392547e 100644--- a/crates/editor/src/element.rs+++ b/crates/editor/src/element.rs@@ -2202,7 +2202,7 @@ impl Element<Editor> for EditorElement {let invisible_symbol_font_size = self.style.text.font_size / 2.0;let invisible_symbol_style = RunStyle {- color: self.style.line_number,+ color: self.style.whitespace,font_id: self.style.text.font_id,underline: Default::default(),};diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rsindex 1211f537422..fb6bd85f02b 100644--- a/crates/theme/src/theme.rs+++ b/crates/theme/src/theme.rs@@ -636,6 +636,7 @@ pub struct Editor {pub composition_mark: HighlightStyle,pub jump_icon: Interactive<IconButton>,pub scrollbar: Scrollbar,+ pub whitespace: Color,}#[derive(Clone, Deserialize, Default)]diff --git a/styles/src/styleTree/editor.ts b/styles/src/styleTree/editor.tsindex cd0adf6bc7f..7caa8b1c674 100644--- a/styles/src/styleTree/editor.ts+++ b/styles/src/styleTree/editor.ts@@ -3,7 +3,7 @@ import { ColorScheme, Layer, StyleSets } from "../themes/common/colorScheme"import { background, border, borderColor, foreground, text } from "./components"import hoverPopover from "./hoverPopover"-import { buildSyntax } from "../themes/common/syntax"+import { SyntaxHighlightStyle, buildSyntax } from "../themes/common/syntax"export default function editor(colorScheme: ColorScheme) {let layer = colorScheme.highest@@ -123,6 +123,7 @@ export default function editor(colorScheme: ColorScheme) {renameFade: 0.6,unnecessaryCodeFade: 0.5,selection: colorScheme.players[0],+ whitespace: colorScheme.ramps.neutral(0.5).hex(),guestSelections: [colorScheme.players[1],colorScheme.players[2],