indent guides: Toggle action (#12203)

Added a new action `editor: Toggle indent guides`, to show/hide indent
guides

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner 2024-05-23 16:45:20 +02:00 committed by GitHub
parent feea607bac
commit 58a3ba02c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 10 deletions

View file

@ -35,14 +35,11 @@ impl Editor {
&self,
visible_buffer_range: Range<MultiBufferRow>,
snapshot: &DisplaySnapshot,
cx: &AppContext,
cx: &mut ViewContext<Editor>,
) -> Option<Vec<MultiBufferIndentGuide>> {
if self.show_indent_guides == Some(false) {
return None;
}
let enabled = self.should_show_indent_guides(cx);
let settings = self.buffer.read(cx).settings_at(0, cx);
if settings.indent_guides.enabled {
if enabled {
Some(indent_guides_in_range(visible_buffer_range, snapshot, cx))
} else {
None