diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-29 20:39:30 -0500 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-29 20:53:41 -0500 |
commit | b704dafb2420df6f7fca64980a2f52c1a00bcef5 (patch) | |
tree | f4659fa9ba38a8626d478e23d97b331c6dd5f8dc /src/selection.rs | |
parent | f1336ee1c74c8e3d324ff7b32b562a64046df5ce (diff) | |
download | alacritty-b704dafb2420df6f7fca64980a2f52c1a00bcef5.tar.gz alacritty-b704dafb2420df6f7fca64980a2f52c1a00bcef5.zip |
Fix some bugs with selections
Moving the window on macOS would cause a panic in certain circumstances.
Diffstat (limited to 'src/selection.rs')
-rw-r--r-- | src/selection.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/selection.rs b/src/selection.rs index a3ab0ac5..ebc84bee 100644 --- a/src/selection.rs +++ b/src/selection.rs @@ -106,12 +106,16 @@ impl Selection { debug_assert!(!(tail < front)); // Single-cell selections are a special case - if start == end && start_side != end_side { - return Some(Span { - ty: SpanType::Inclusive, - front: *front, - tail: *tail - }); + if start == end { + if start_side != end_side { + return Some(Span { + ty: SpanType::Inclusive, + front: *front, + tail: *tail + }); + } else { + return None; + } } // The other special case is two adjacent cells with no |