aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/event.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-06-20 15:56:09 +0000
committerGitHub <noreply@github.com>2019-06-20 15:56:09 +0000
commite0a286515f12c6ceed53c74df1c10123cb0b550d (patch)
treee24c9fc28984cdc577fd87b47c36d72c82ab3368 /alacritty_terminal/src/event.rs
parenta1c70b1d68f192c3e6901095f646e17a93774746 (diff)
downloadalacritty-e0a286515f12c6ceed53c74df1c10123cb0b550d.tar.gz
alacritty-e0a286515f12c6ceed53c74df1c10123cb0b550d.zip
Add block selection
This implements a block selection mode which can be triggered by holding Control before starting a selection. If text is copied using this block selection, newlines will be automatically added to the end of the lines. This fixes #526.
Diffstat (limited to 'alacritty_terminal/src/event.rs')
-rw-r--r--alacritty_terminal/src/event.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/alacritty_terminal/src/event.rs b/alacritty_terminal/src/event.rs
index f844bf68..171f3ce7 100644
--- a/alacritty_terminal/src/event.rs
+++ b/alacritty_terminal/src/event.rs
@@ -102,6 +102,12 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> {
self.terminal.dirty = true;
}
+ fn block_selection(&mut self, point: Point, side: Side) {
+ let point = self.terminal.visible_to_buffer(point);
+ *self.terminal.selection_mut() = Some(Selection::block(point, side));
+ self.terminal.dirty = true;
+ }
+
fn semantic_selection(&mut self, point: Point) {
let point = self.terminal.visible_to_buffer(point);
*self.terminal.selection_mut() = Some(Selection::semantic(point));