From dc11d2726ef3fb7323d25cb5c107580b6adf5154 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 28 Feb 2023 19:53:53 -0800 Subject: [PATCH] Made code fold indicators show up on active line indicators --- crates/editor/src/editor.rs | 6 +++++- crates/editor/src/element.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 69bb298c22..cb9bf4da6c 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -2702,6 +2702,7 @@ impl Editor { pub fn render_fold_indicators( &self, fold_data: Option>, + active_rows: &BTreeMap, style: &EditorStyle, gutter_hovered: bool, line_height: f32, @@ -2717,7 +2718,10 @@ impl Editor { .iter() .copied() .filter_map(|(fold_location, fold_status)| { - (gutter_hovered || fold_status == FoldStatus::Folded).then(|| { + (gutter_hovered + || fold_status == FoldStatus::Folded + || !*active_rows.get(&fold_location).unwrap_or(&true)) + .then(|| { ( fold_location, MouseEventHandler::::new( diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 78c3518d81..a44cb78197 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1858,6 +1858,7 @@ impl Element for EditorElement { view.render_fold_indicators( folds, + &active_rows, &style, view.gutter_hovered, line_height,