aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-08-30 04:26:21 +0000
committerGitHub2023-08-30 04:26:21 +0000
commit0cb595e226c9970989ee1e680ae6b8011d188cbf (patch)
tree406b31b0343c74f96f9ae80d758f246a04374434 /helix-view/src/editor.rs
parent40d7e6c9c85d4f1ce2345f6e9d59fc091243124d (diff)
transition to nucleo for fuzzy matching (#7814)
* transition to nucleo for fuzzy matching * drop flakey test case since the picker streams in results now any test that relies on the picker containing results is potentially flakely * use crates.io version of nucleo * Fix typo in commands.rs Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com> --------- Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 94d0a852..86f35e0d 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -32,7 +32,7 @@ use std::{
use tokio::{
sync::{
mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
- oneshot, Notify, RwLock,
+ oneshot,
},
time::{sleep, Duration, Instant, Sleep},
};
@@ -925,10 +925,6 @@ pub struct Editor {
pub exit_code: i32,
pub config_events: (UnboundedSender<ConfigEvent>, UnboundedReceiver<ConfigEvent>),
- /// Allows asynchronous tasks to control the rendering
- /// The `Notify` allows asynchronous tasks to request the editor to perform a redraw
- /// The `RwLock` blocks the editor from performing the render until an exclusive lock can be acquired
- pub redraw_handle: RedrawHandle,
pub needs_redraw: bool,
/// Cached position of the cursor calculated during rendering.
/// The content of `cursor_cache` is returned by `Editor::cursor` if
@@ -955,8 +951,6 @@ pub struct Editor {
pub type Motion = Box<dyn Fn(&mut Editor)>;
-pub type RedrawHandle = (Arc<Notify>, Arc<RwLock<()>>);
-
#[derive(Debug)]
pub enum EditorEvent {
DocumentSaved(DocumentSavedEventResult),
@@ -1062,7 +1056,6 @@ impl Editor {
auto_pairs,
exit_code: 0,
config_events: unbounded_channel(),
- redraw_handle: Default::default(),
needs_redraw: false,
cursor_cache: Cell::new(None),
completion_request_handle: None,
@@ -1453,7 +1446,7 @@ impl Editor {
)?;
if let Some(diff_base) = self.diff_providers.get_diff_base(&path) {
- doc.set_diff_base(diff_base, self.redraw_handle.clone());
+ doc.set_diff_base(diff_base);
}
doc.set_version_control_head(self.diff_providers.get_current_head_name(&path));
@@ -1752,7 +1745,7 @@ impl Editor {
return EditorEvent::DebuggerEvent(event)
}
- _ = self.redraw_handle.0.notified() => {
+ _ = helix_event::redraw_requested() => {
if !self.needs_redraw{
self.needs_redraw = true;
let timeout = Instant::now() + Duration::from_millis(33);