From 06a5bca79bb81aeb97b96e5f493204bdf04dc3ba Mon Sep 17 00:00:00 2001 From: cossonleo Date: Mon, 30 May 2022 14:41:50 +0800 Subject: [PATCH] optimize tree explore render --- helix-term/src/ui/editor.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index b5148635..a23429d8 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -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); @@ -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); + } } } }