Remove duplicate EventProxy

This commit is contained in:
Dániel Buga 2022-04-20 00:44:26 +02:00 committed by Dongdong Zhou
parent f07a763670
commit 1f0214a857
2 changed files with 4 additions and 32 deletions

View File

@ -795,9 +795,9 @@ macro_rules! term_sequence {
#[derive(Clone)]
pub struct EventProxy {
term_id: TermId,
proxy: Arc<LapceProxy>,
event_sink: ExtEventSink,
pub term_id: TermId,
pub proxy: Arc<LapceProxy>,
pub event_sink: ExtEventSink,
}
impl EventProxy {}

View File

@ -2,7 +2,6 @@
use alacritty_terminal::{
ansi,
event::EventListener,
grid::Dimensions,
index::{Direction, Side},
term::{cell::Flags, search::RegexSearch, SizeInfo},
@ -22,7 +21,7 @@
proxy::LapceProxy,
split::SplitDirection,
state::Mode,
terminal::{LapceTerminalData, LapceTerminalViewData},
terminal::{EventProxy, LapceTerminalData, LapceTerminalViewData},
};
use lapce_rpc::terminal::TermId;
use unicode_width::UnicodeWidthChar;
@ -854,30 +853,3 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, _env: &Env) {
}
}
}
#[derive(Clone)]
pub struct EventProxy {
term_id: TermId,
proxy: Arc<LapceProxy>,
event_sink: ExtEventSink,
}
impl EventProxy {}
impl EventListener for EventProxy {
fn send_event(&self, event: alacritty_terminal::event::Event) {
match event {
alacritty_terminal::event::Event::PtyWrite(s) => {
self.proxy.terminal_write(self.term_id, &s);
}
alacritty_terminal::event::Event::Title(title) => {
let _ = self.event_sink.submit_command(
LAPCE_UI_COMMAND,
LapceUICommand::UpdateTerminalTitle(self.term_id, title),
Target::Widget(self.proxy.tab_id),
);
}
_ => (),
}
}
}