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:
parent
feea607bac
commit
58a3ba02c6
4 changed files with 24 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue