diff --git a/src/main.rs b/src/main.rs index cd778ca..ffda820 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,6 @@ use cosmic::{ app::{Command, Core, Settings}, cosmic_theme, executor, iced::{ - self, futures::SinkExt, subscription::{self, Subscription}, widget::row, @@ -91,7 +90,7 @@ impl cosmic::Application for App { } /// Creates the application, and optionally emits command on initialize. - fn init(core: Core, input: Self::Flags) -> (Self, Command) { + fn init(core: Core, _flags: Self::Flags) -> (Self, Command) { let mut app = App { core, tab_model: segmented_button::ModelBuilder::default().build(), diff --git a/src/terminal.rs b/src/terminal.rs index 244c74e..0f2a098 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -1,10 +1,9 @@ use alacritty_terminal::{ - ansi::{Color, Handler, NamedColor}, - config::{Config, PtyConfig}, + ansi::{Color, NamedColor}, + config::Config, event::{Event, EventListener, Notify, OnResize, WindowSize}, - event_loop::{EventLoop, Msg, Notifier, State}, + event_loop::{EventLoop, Msg, Notifier}, grid::Dimensions, - index::{Column, Line, Point}, sync::FairMutex, term::{ cell::Flags, @@ -14,19 +13,16 @@ use alacritty_terminal::{ }; use cosmic::{iced::advanced::graphics::text::font_system, widget::segmented_button}; use cosmic_text::{ - Attrs, AttrsList, Buffer, BufferLine, Family, FontSystem, Metrics, Shaping, Style, Weight, Wrap, + Attrs, AttrsList, Buffer, BufferLine, Family, Metrics, Shaping, Style, Weight, Wrap, }; use std::{ borrow::Cow, mem, sync::{Arc, Weak}, - thread::JoinHandle, time::Instant, }; use tokio::sync::mpsc; -use crate::terminal_theme; - pub use alacritty_terminal::grid::Scroll as TerminalScroll; #[derive(Clone, Copy, Debug)] @@ -103,7 +99,6 @@ pub struct Terminal { term: Arc>>, colors: Colors, notifier: Notifier, - pty_join_handle: JoinHandle<(EventLoop, State)>, } impl Terminal { @@ -133,7 +128,7 @@ impl Terminal { }; let config = Config::default(); - let mut size = Size { + let size = Size { width: (80.0 * cell_width).ceil() as u32, height: (24.0 * cell_height).ceil() as u32, cell_width, @@ -157,7 +152,7 @@ impl Terminal { false, ); let notifier = Notifier(pty_event_loop.channel()); - let pty_join_handle = pty_event_loop.spawn(); + let _pty_join_handle = pty_event_loop.spawn(); Self { colors, @@ -166,7 +161,6 @@ impl Terminal { size, term, notifier, - pty_join_handle, } } @@ -266,7 +260,7 @@ impl Terminal { //TODO: is redraw needed after all events? //TODO: use LineDamageBounds { - let mut buffer = Arc::make_mut(&mut self.buffer); + let buffer = Arc::make_mut(&mut self.buffer); let mut line_i = 0; let mut last_point = None; diff --git a/src/terminal_box.rs b/src/terminal_box.rs index f2593c0..8f9763d 100644 --- a/src/terminal_box.rs +++ b/src/terminal_box.rs @@ -18,7 +18,6 @@ use cosmic::{ Shell, }, }; -use cosmic_text::{Action, Edit, Metrics, Motion, Scroll}; use std::{ cell::Cell, cmp, @@ -168,7 +167,7 @@ where tree: &widget::Tree, renderer: &mut Renderer, _theme: &Renderer::Theme, - style: &renderer::Style, + _style: &renderer::Style, layout: Layout<'_>, _cursor_position: mouse::Cursor, viewport: &Rectangle, @@ -299,9 +298,8 @@ where ) -> Status { let state = tree.state.downcast_mut::(); let scrollbar_rect = state.scrollbar_rect.get(); - let mut terminal = self.terminal.lock().unwrap(); + let terminal = self.terminal.lock().unwrap(); let buffer_size = terminal.with_buffer(|buffer| buffer.size()); - let mut font_system = font_system().write().unwrap(); let mut status = Status::Ignored; match event { @@ -505,7 +503,7 @@ where Event::Mouse(MouseEvent::CursorMoved { .. }) => { if let Some(dragging) = &state.dragging { if let Some(p) = cursor_position.position() { - let x = (p.x - layout.bounds().x) - self.padding.left; + let _x = (p.x - layout.bounds().x) - self.padding.left; let y = (p.y - layout.bounds().y) - self.padding.top; match dragging { Dragging::Buffer => {