aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lilienthal <nathan@nixpulvis.com>2018-11-01 21:34:02 -0400
committerChristian Duerr <chrisduerr@users.noreply.github.com>2018-11-02 01:34:02 +0000
commitfd8af0df3395a13f7fe670e293ee9584669aa7bd (patch)
treeca62e4fc475615ee87d8aae1653cdea5fc477863
parenta3f729f5899a1d56222641f362805f251de3f84d (diff)
downloadalacritty-fd8af0df3395a13f7fe670e293ee9584669aa7bd.tar.gz
alacritty-fd8af0df3395a13f7fe670e293ee9584669aa7bd.zip
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.
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/event.rs11
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ed8fa98..5e9cb5f2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
- Invalid default configuration on macOS and Linux
- Middle mouse pasting if mouse mode is enabled
+- Selections now properly update as you scroll the scrollback buffer while selecting
## Version 0.2.1
diff --git a/src/event.rs b/src/event.rs
index c6fd9168..b3def0eb 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -58,6 +58,17 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> {
fn scroll(&mut self, scroll: 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) {