mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-13 06:39:31 +03:00
Merge pull request #2228 from zed-industries/make-folds-show-on-active-lines
Made code fold indicators show up on active line indicators
This commit is contained in:
commit
8358efbd6c
@ -2702,6 +2702,7 @@ impl Editor {
|
||||
pub fn render_fold_indicators(
|
||||
&self,
|
||||
fold_data: Option<Vec<(u32, FoldStatus)>>,
|
||||
active_rows: &BTreeMap<u32, bool>,
|
||||
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::<FoldIndicators>::new(
|
||||
|
@ -1858,6 +1858,7 @@ impl Element for EditorElement {
|
||||
|
||||
view.render_fold_indicators(
|
||||
folds,
|
||||
&active_rows,
|
||||
&style,
|
||||
view.gutter_hovered,
|
||||
line_height,
|
||||
|
Loading…
Reference in New Issue
Block a user