remove some dead code
This commit is contained in:
1 parent
6db31d5f64
commit
bcf3d8db35
5 files changed
+1
-54
No files matched your search
@@ -6,7 +6,6 @@ use portable_pty::{Child, MasterPty, PtySize};
|
||||
use std::cell::{RefCell, RefMut};
|
||||
use std::sync::Arc;
|
||||
use term::color::ColorPalette;
|
||||
use term::selection::SelectionRange;
|
||||
use term::{Clipboard, KeyCode, KeyModifiers, MouseEvent, Terminal, TerminalHost};
|
||||
|
||||
pub struct LocalTab {
|
||||
@@ -91,19 +90,6 @@ impl Tab for LocalTab {
|
||||
self.domain_id
|
||||
}
|
||||
|
||||
fn selection_range(&self) -> Option<SelectionRange> {
|
||||
let terminal = self.terminal.borrow();
|
||||
let rows = terminal.screen().physical_rows;
|
||||
terminal
|
||||
.selection_range()
|
||||
.map(|r| r.clip_to_viewport(terminal.get_viewport_offset(), rows))
|
||||
}
|
||||
|
||||
fn selection_text(&self) -> Option<String> {
|
||||
let terminal = self.terminal.borrow();
|
||||
Some(terminal.get_selection_text())
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
self.terminal.borrow().is_mouse_grabbed()
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ use portable_pty::PtySize;
|
||||
use std::cell::RefMut;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use term::color::ColorPalette;
|
||||
use term::selection::SelectionRange;
|
||||
use term::{Clipboard, KeyCode, KeyModifiers, MouseEvent, TerminalHost};
|
||||
|
||||
static TAB_ID: ::std::sync::atomic::AtomicUsize = ::std::sync::atomic::AtomicUsize::new(0);
|
||||
@@ -70,12 +69,6 @@ pub trait Tab: Downcast {
|
||||
|
||||
fn set_clipboard(&self, _clipboard: &Arc<dyn Clipboard>) {}
|
||||
|
||||
/// Returns the selection range adjusted to the viewport
|
||||
/// (eg: it has been normalized and had clip_to_viewport called
|
||||
/// on it prior to being returned)
|
||||
fn selection_range(&self) -> Option<SelectionRange>;
|
||||
fn selection_text(&self) -> Option<String>;
|
||||
|
||||
fn trickle_paste(&self, text: String) -> anyhow::Result<()> {
|
||||
if text.len() <= PASTE_CHUNK_SIZE {
|
||||
// Send it all now
|
||||
|
||||
@@ -742,7 +742,7 @@ impl<S: ReadAndWrite> ClientSession<S> {
|
||||
let highlight = tab.renderer().current_highlight().as_ref().cloned();
|
||||
|
||||
Ok(Pdu::SendMouseEventResponse(SendMouseEventResponse {
|
||||
selection_range: tab.selection_range(),
|
||||
selection_range: None,
|
||||
highlight,
|
||||
}))
|
||||
})
|
||||
|
||||
@@ -317,22 +317,6 @@ impl Tab for ClientTab {
|
||||
self.client.local_domain_id
|
||||
}
|
||||
|
||||
fn selection_range(&self) -> Option<SelectionRange> {
|
||||
*self
|
||||
.renderable
|
||||
.borrow()
|
||||
.inner
|
||||
.borrow()
|
||||
.selection_range
|
||||
.lock()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn selection_text(&self) -> Option<String> {
|
||||
// FIXME: get selection from peer or the surface
|
||||
None
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
// FIXME: get the real state from the remote
|
||||
true
|
||||
|
||||
@@ -316,22 +316,6 @@ impl Tab for TermWizTerminalTab {
|
||||
self.domain_id
|
||||
}
|
||||
|
||||
fn selection_range(&self) -> Option<SelectionRange> {
|
||||
*self
|
||||
.renderable
|
||||
.borrow()
|
||||
.inner
|
||||
.borrow()
|
||||
.selection_range
|
||||
.lock()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn selection_text(&self) -> Option<String> {
|
||||
// FIXME: grab it from the surface
|
||||
None
|
||||
}
|
||||
|
||||
fn is_mouse_grabbed(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user