aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r--src/term/mod.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 6de8afac..67d34be1 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -38,6 +38,9 @@ use self::cell::LineLength;
impl selection::SemanticSearch for Term {
fn semantic_search_left(&self, mut point: Point<usize>) -> Point<usize> {
+ // Limit the starting point to the last line in the history
+ point.line = min(point.line, self.grid.len() - 1);
+
let mut iter = self.grid.iter_from(point);
let last_col = self.grid.num_cols() - Column(1);
@@ -57,6 +60,9 @@ impl selection::SemanticSearch for Term {
}
fn semantic_search_right(&self, mut point: Point<usize>) -> Point<usize> {
+ // Limit the starting point to the last line in the history
+ point.line = min(point.line, self.grid.len() - 1);
+
let mut iter = self.grid.iter_from(point);
let last_col = self.grid.num_cols() - Column(1);
@@ -1017,7 +1023,7 @@ impl Term {
}
// Starting line
- res.append(&self.grid, start.line, Column(0)..(start.col + 1));
+ res.append(&self.grid, start.line, Column(0)..start.col);
}
}