Implement select all
This commit is contained in:
parent
40c871bcf3
commit
2a4d9f0d28
2 changed files with 17 additions and 2 deletions
|
|
@ -456,7 +456,8 @@ impl Application for App {
|
||||||
Message::SelectAll(entity_opt) => {
|
Message::SelectAll(entity_opt) => {
|
||||||
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
|
let entity = entity_opt.unwrap_or_else(|| self.tab_model.active());
|
||||||
if let Some(terminal) = self.tab_model.data::<Mutex<Terminal>>(entity) {
|
if let Some(terminal) = self.tab_model.data::<Mutex<Terminal>>(entity) {
|
||||||
log::warn!("TODO: SELECT ALL");
|
let mut terminal = terminal.lock().unwrap();
|
||||||
|
terminal.select_all();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Message::SystemThemeModeChange(_theme_mode) => {
|
Message::SystemThemeModeChange(_theme_mode) => {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ use alacritty_terminal::{
|
||||||
event::{Event, EventListener, Notify, OnResize, WindowSize},
|
event::{Event, EventListener, Notify, OnResize, WindowSize},
|
||||||
event_loop::{EventLoop, Msg, Notifier},
|
event_loop::{EventLoop, Msg, Notifier},
|
||||||
grid::Dimensions,
|
grid::Dimensions,
|
||||||
index::Point,
|
index::{Column, Line, Point, Side},
|
||||||
|
selection::{Selection, SelectionType},
|
||||||
sync::FairMutex,
|
sync::FairMutex,
|
||||||
term::{
|
term::{
|
||||||
cell::Flags,
|
cell::Flags,
|
||||||
|
|
@ -284,6 +285,19 @@ impl Terminal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn select_all(&mut self) {
|
||||||
|
{
|
||||||
|
let mut term = self.term.lock();
|
||||||
|
let grid = term.grid();
|
||||||
|
let start = Point::new(Line(-(grid.history_size() as i32)), Column(0));
|
||||||
|
let end = Point::new(Line(grid.screen_lines() as i32), Column(grid.columns()));
|
||||||
|
let mut selection = Selection::new(SelectionType::Lines, start, Side::Left);
|
||||||
|
selection.update(end, Side::Right);
|
||||||
|
term.selection = Some(selection);
|
||||||
|
}
|
||||||
|
self.update();
|
||||||
|
}
|
||||||
|
|
||||||
pub fn set_config(&mut self, config: &crate::Config, themes: &HashMap<String, Colors>) {
|
pub fn set_config(&mut self, config: &crate::Config, themes: &HashMap<String, Colors>) {
|
||||||
let mut update_cell_size = false;
|
let mut update_cell_size = false;
|
||||||
let mut update = false;
|
let mut update = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue