diff options
author | Christian Duerr <contact@christianduerr.com> | 2018-03-10 12:14:58 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2018-03-13 16:58:15 -0700 |
commit | f8e36d166342d9ee4a91f8e89f55677cd0fd0644 (patch) | |
tree | a7bb8ff817301779d5d61e5e7a2976fe227daa71 /src/input.rs | |
parent | a741193bc0f96595e8b618322440669125bf08a6 (diff) | |
download | alacritty-f8e36d166342d9ee4a91f8e89f55677cd0fd0644.tar.gz alacritty-f8e36d166342d9ee4a91f8e89f55677cd0fd0644.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.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs index f1e63299..af45c6ef 100644 --- a/src/input.rs +++ b/src/input.rs @@ -274,7 +274,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 |