aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-03-10 12:14:58 +0100
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:46:20 -0700
commitd9bd21d33f7f35d1362a581cefb1c897a821fcad (patch)
tree945089b96fbbad1b153430d1565a410003be30f5 /src/input.rs
parenta238e9ac5832cb9a40f886a3b873728cd7890d01 (diff)
downloadalacritty-d9bd21d33f7f35d1362a581cefb1c897a821fcad.tar.gz
alacritty-d9bd21d33f7f35d1362a581cefb1c897a821fcad.zip
Fix selection in scrollback
There were a few issues with selection in scrollback that were mainly off-by-one errors. This aims at fixing these issues. This also fixes a bug that currently exists in master where the last cell is not selected when the mouse leaves the window to the right.
Diffstat (limited to 'src/input.rs')
-rw-r--r--src/input.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs
index 16fddc2c..7b9eda56 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -278,7 +278,10 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> {
let cell_x = (x as usize - size_info.padding_x as usize) % size_info.cell_width as usize;
let half_cell_width = (size_info.cell_width / 2.0) as usize;
- let cell_side = if cell_x > half_cell_width {
+ let cell_side = if cell_x > half_cell_width
+ // Edge case when mouse leaves the window
+ || x as f32 >= size_info.width - size_info.padding_x
+ {
Side::Right
} else {
Side::Left