Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Disable indent guides for single line editors (#12584)

Bennet Bo Fennerde8ef0814363
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index f888534f6ba..987b39a44c5 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -1697,6 +1697,12 @@ impl Editor {
cx.on_focus(&focus_handle, Self::handle_focus).detach();
cx.on_blur(&focus_handle, Self::handle_blur).detach();
+ let show_indent_guides = if mode == EditorMode::SingleLine {
+ Some(false)
+ } else {
+ None
+ };
+
let mut this = Self {
focus_handle,
buffer: buffer.clone(),
@@ -1726,7 +1732,7 @@ impl Editor {
show_git_diff_gutter: None,
show_code_actions: None,
show_wrap_guides: None,
- show_indent_guides: None,
+ show_indent_guides,
placeholder_text: None,
highlight_order: 0,
highlighted_rows: HashMap::default(),