aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-06 04:56:34 +0000
committerBlaž Hrastnik2021-05-06 04:56:34 +0000
commit355ad3cb8289611b06cd42fa62ddfe0a5c716e83 (patch)
tree7c94da6e122a9ecf542103b46a3ca9e80654a52e /helix-term/src/application.rs
parent0e5308bce1a6e7d7d00854ae50902546cea9578d (diff)
Tokio migration.
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 8849ee81..3bf746ea 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -7,14 +7,13 @@ use crate::{compositor::Compositor, ui};
use log::{error, info};
use std::{
+ future::Future,
io::{self, stdout, Stdout, Write},
path::PathBuf,
sync::Arc,
time::Duration,
};
-use smol::prelude::*;
-
use anyhow::Error;
use crossterm::{
@@ -39,16 +38,15 @@ pub struct Application {
compositor: Compositor,
editor: Editor,
- executor: &'static smol::Executor<'static>,
callbacks: LspCallbacks,
}
impl Application {
- pub fn new(mut args: Args, executor: &'static smol::Executor<'static>) -> Result<Self, Error> {
+ pub fn new(mut args: Args) -> Result<Self, Error> {
use helix_view::editor::Action;
let mut compositor = Compositor::new()?;
let size = compositor.size();
- let mut editor = Editor::new(executor, size);
+ let mut editor = Editor::new(size);
if let Ok(files) = args.values_of_t::<PathBuf>("files") {
for file in files {
@@ -64,7 +62,6 @@ impl Application {
compositor,
editor,
- executor,
callbacks: FuturesUnordered::new(),
};
@@ -72,14 +69,12 @@ impl Application {
}
fn render(&mut self) {
- let executor = &self.executor;
let editor = &mut self.editor;
let compositor = &mut self.compositor;
let callbacks = &mut self.callbacks;
let mut cx = crate::compositor::Context {
editor,
- executor,
callbacks,
scroll: None,
};
@@ -97,7 +92,7 @@ impl Application {
break;
}
- use futures_util::{select, FutureExt};
+ use futures_util::{select, FutureExt, StreamExt};
select! {
event = reader.next().fuse() => {
self.handle_terminal_events(event)
@@ -125,7 +120,6 @@ impl Application {
pub fn handle_terminal_events(&mut self, event: Option<Result<Event, crossterm::ErrorKind>>) {
let mut cx = crate::compositor::Context {
editor: &mut self.editor,
- executor: self.executor,
callbacks: &mut self.callbacks,
scroll: None,
};