1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-25 14:05:41 -05:00

Fix selection while scrolling

Properly update an active selection while scrolling the main scrollback buffer.

This does not affect the alternate screen buffer, since no scrollback buffer is
available.
This commit is contained in:
Nathan Lilienthal 2018-11-01 21:34:02 -04:00 committed by Christian Duerr
parent a3f729f589
commit fd8af0df33
2 changed files with 12 additions and 0 deletions

View file

@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Selection memory leak and glitches in the alternate screen buffer - Selection memory leak and glitches in the alternate screen buffer
- Invalid default configuration on macOS and Linux - Invalid default configuration on macOS and Linux
- Middle mouse pasting if mouse mode is enabled - Middle mouse pasting if mouse mode is enabled
- Selections now properly update as you scroll the scrollback buffer while selecting
## Version 0.2.1 ## Version 0.2.1

View file

@ -58,6 +58,17 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> {
fn scroll(&mut self, scroll: Scroll) { fn scroll(&mut self, scroll: Scroll) {
self.terminal.scroll_display(scroll); self.terminal.scroll_display(scroll);
if let ElementState::Pressed = self.mouse().left_button_state {
let (x, y) = (self.mouse().x, self.mouse().y);
let size_info = self.size_info();
let point = size_info.pixels_to_coords(x, y);
let cell_side = self.mouse().cell_side;
self.update_selection(Point {
line: point.line,
col: point.col
}, cell_side);
}
} }
fn clear_history(&mut self) { fn clear_history(&mut self) {