diff options
author | Joe Wilm <joe@jwilm.com> | 2016-08-22 08:37:50 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-08-22 08:37:50 -0700 |
commit | 3c5d46c8518fb6a1a6e1679ba3a2cc8815f37d3c (patch) | |
tree | 887dca71dcd533ee68b0f68837700903eef52325 /src/index.rs | |
parent | b325afe8d2d67a72e14f436fec2158e822db4e8e (diff) | |
download | alacritty-3c5d46c8518fb6a1a6e1679ba3a2cc8815f37d3c.tar.gz alacritty-3c5d46c8518fb6a1a6e1679ba3a2cc8815f37d3c.zip |
Scrolling v2
The previous scrolling + scroll region implementation exhibited display
corruption bugs in several applications including tmux, irssi, htop, and
vim. The new implementation doesn't seem to suffer from any of those
issues.
This implementation is able to `find /usr` on my machine (nearly 600k
lines) in ~2.0 seconds while st is able to do the same in ~2.2 seconds.
Alacritty is officially faster!
Diffstat (limited to 'src/index.rs')
-rw-r--r-- | src/index.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/index.rs b/src/index.rs index 61c39fd6..946e01fa 100644 --- a/src/index.rs +++ b/src/index.rs @@ -131,6 +131,33 @@ macro_rules! sub { $construct(self.0 - rhs.0) } } + + impl<'a> ops::Sub<$ty> for &'a $ty { + type Output = $ty; + + #[inline] + fn sub(self, rhs: $ty) -> $ty { + $construct(self.0 - rhs.0) + } + } + + impl<'a> ops::Sub<&'a $ty> for $ty { + type Output = $ty; + + #[inline] + fn sub(self, rhs: &'a $ty) -> $ty { + $construct(self.0 - rhs.0) + } + } + + impl<'a, 'b> ops::Sub<&'a $ty> for &'b $ty { + type Output = $ty; + + #[inline] + fn sub(self, rhs: &'a $ty) -> $ty { + $construct(self.0 - rhs.0) + } + } } } |