Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/compositor.rs')
-rw-r--r--helix-term/src/compositor.rs26
1 files changed, 3 insertions, 23 deletions
diff --git a/helix-term/src/compositor.rs b/helix-term/src/compositor.rs
index 266a8aec..bcb3e449 100644
--- a/helix-term/src/compositor.rs
+++ b/helix-term/src/compositor.rs
@@ -16,7 +16,6 @@ pub enum EventResult {
}
use crate::job::Jobs;
-use crate::ui::picker;
use helix_view::Editor;
pub use helix_view::input::Event;
@@ -27,7 +26,7 @@ pub struct Context<'a> {
pub jobs: &'a mut Jobs,
}
-impl Context<'_> {
+impl<'a> Context<'a> {
/// Waits on all pending jobs, and then tries to flush all pending write
/// operations for all documents.
pub fn block_try_flush_writes(&mut self) -> anyhow::Result<()> {
@@ -80,7 +79,6 @@ pub struct Compositor {
area: Rect,
pub(crate) last_picker: Option<Box<dyn Component>>,
- pub(crate) full_redraw: bool,
}
impl Compositor {
@@ -89,7 +87,6 @@ impl Compositor {
layers: Vec::new(),
area,
last_picker: None,
- full_redraw: false,
}
}
@@ -103,11 +100,6 @@ impl Compositor {
/// Add a layer to be rendered in front of all existing layers.
pub fn push(&mut self, mut layer: Box<dyn Component>) {
- // immediately clear last_picker field to avoid excessive memory
- // consumption for picker with many items
- if layer.id() == Some(picker::ID) {
- self.last_picker = None;
- }
let size = self.size();
// trigger required_size on init
layer.required_size((size.width, size.height));
@@ -136,18 +128,10 @@ impl Compositor {
Some(self.layers.remove(idx))
}
- pub fn remove_type<T: 'static>(&mut self) {
- let type_name = std::any::type_name::<T>();
- self.layers
- .retain(|component| component.type_name() != type_name);
- }
pub fn handle_event(&mut self, event: &Event, cx: &mut Context) -> bool {
- // If it is a key event, a macro is being recorded, and a macro isn't being replayed,
- // push the key event to the recording.
+ // If it is a key event and a macro is being recorded, push the key event to the recording.
if let (Event::Key(key), Some((_, keys))) = (event, &mut cx.editor.macro_recording) {
- if cx.editor.macro_replaying.is_empty() {
- keys.push(*key);
- }
+ keys.push(*key);
}
let mut callbacks = Vec::new();
@@ -216,10 +200,6 @@ impl Compositor {
.find(|component| component.id() == Some(id))
.and_then(|component| component.as_any_mut().downcast_mut())
}
-
- pub fn need_full_redraw(&mut self) {
- self.full_redraw = true;
- }
}
// View casting, taken straight from Cursive