Skip to content

Commit

Permalink
optimize tree explore render
Browse files Browse the repository at this point in the history
  • Loading branch information
cossonleo committed Jun 21, 2022
1 parent 21d4bf8 commit 06a5bca
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,12 @@ impl Component for EditorView {
}
cx.editor.resize(editor_area); // -1 from bottom for commandline

if let Some(explore) = self.explorer.as_mut() {
if !explore.content.is_focus() && config.explorer.is_embed() {
explore.content.render(area, surface, cx);
}
}

for (view, is_focused) in cx.editor.tree.views() {
let doc = cx.editor.document(view.doc).unwrap();
self.render_view(cx.editor, doc, view, area, surface, is_focused);
Expand Down Expand Up @@ -1406,10 +1412,12 @@ impl Component for EditorView {
}

if let Some(explore) = self.explorer.as_mut() {
if config.explorer.is_embed() {
explore.content.render(area, surface, cx);
} else if explore.content.is_focus() {
explore.render(area, surface, cx);
if explore.content.is_focus() {
if config.explorer.is_embed() {
explore.content.render(area, surface, cx);
} else {
explore.render(area, surface, cx);
}
}
}
}
Expand Down

0 comments on commit 06a5bca

Please sign in to comment.