summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/index.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2020-03-07 22:17:38 +0000
committerGitHub <noreply@github.com>2020-03-07 22:17:38 +0000
commit64a3115648d354731ef08c2de8b2168b9326b7b5 (patch)
treec9121ed2e475ed2b531d8f8a1c01d9f000d74769 /alacritty_terminal/src/index.rs
parentde5d770416eb6ea5567b2b46874b8e35b084b9e1 (diff)
downloadalacritty-64a3115648d354731ef08c2de8b2168b9326b7b5.tar.gz
alacritty-64a3115648d354731ef08c2de8b2168b9326b7b5.zip
Fix selection with invisible start and end
This resolves an issue with the selection clamping, where no selection would be rendered at all when the start was above the viewport while the end was below it.
Diffstat (limited to 'alacritty_terminal/src/index.rs')
-rw-r--r--alacritty_terminal/src/index.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/alacritty_terminal/src/index.rs b/alacritty_terminal/src/index.rs
index 51566d8d..56d32003 100644
--- a/alacritty_terminal/src/index.rs
+++ b/alacritty_terminal/src/index.rs
@@ -73,12 +73,11 @@ impl<L> Point<L> {
impl Ord for Point {
fn cmp(&self, other: &Point) -> Ordering {
- use std::cmp::Ordering::*;
match (self.line.cmp(&other.line), self.col.cmp(&other.col)) {
- (Equal, Equal) => Equal,
- (Equal, ord) | (ord, Equal) => ord,
- (Less, _) => Less,
- (Greater, _) => Greater,
+ (Ordering::Equal, Ordering::Equal) => Ordering::Equal,
+ (Ordering::Equal, ord) | (ord, Ordering::Equal) => ord,
+ (Ordering::Less, _) => Ordering::Less,
+ (Ordering::Greater, _) => Ordering::Greater,
}
}
}