Make invisibles display configurable

This commit is contained in:
Kirill Bulatov 2023-05-04 14:43:50 +03:00 committed by Kirill Bulatov
parent ad731ea6d2
commit f0a88b3337
4 changed files with 35 additions and 1 deletions

View file

@ -1365,6 +1365,14 @@ impl EditorElement {
is_tab: chunk.is_tab,
}
});
let settings = cx.global::<Settings>();
let show_invisibles = settings
.editor_overrides
.show_invisibles
.or(settings.editor_defaults.show_invisibles)
.unwrap_or_default()
== settings::ShowInvisibles::All;
layout_highlighted_chunks(
chunks,
&style.text,
@ -1372,6 +1380,7 @@ impl EditorElement {
cx.font_cache(),
MAX_LINE_LEN,
rows.len() as usize,
show_invisibles,
)
}
}