aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2018-05-29 21:45:28 -0700
committerJoe Wilm <joe@jwilm.com>2018-05-29 21:45:28 -0700
commitfc2ef0991ef2205fd975a95298bc98823015b791 (patch)
tree3059d1df9697db808703de401bced3edefe4e244
parent4698356f8bc718d8d138bb1908059cd286e3a563 (diff)
downloadalacritty-fc2ef0991ef2205fd975a95298bc98823015b791.tar.gz
alacritty-fc2ef0991ef2205fd975a95298bc98823015b791.zip
Remove dead code
-rw-r--r--src/event.rs2
-rw-r--r--src/grid/mod.rs1
-rw-r--r--src/grid/storage.rs43
-rw-r--r--src/selection.rs23
4 files changed, 6 insertions, 63 deletions
diff --git a/src/event.rs b/src/event.rs
index 1cdf1302..4a0e8d1c 100644
--- a/src/event.rs
+++ b/src/event.rs
@@ -99,7 +99,7 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> {
fn semantic_selection(&mut self, point: Point) {
let point = self.terminal.visible_to_buffer(point);
- *self.terminal.selection_mut() = Some(Selection::semantic(point, &*self.terminal));
+ *self.terminal.selection_mut() = Some(Selection::semantic(point));
self.terminal.dirty = true;
}
diff --git a/src/grid/mod.rs b/src/grid/mod.rs
index b03ae54f..97614d71 100644
--- a/src/grid/mod.rs
+++ b/src/grid/mod.rs
@@ -230,7 +230,6 @@ impl<T: Copy + Clone> Grid<T> {
new_line_count: index::Line,
template: &T,
) {
- let previous_scroll_limit = self.scroll_limit;
let lines_added = new_line_count - self.lines;
// Need to "resize" before updating buffer
diff --git a/src/grid/storage.rs b/src/grid/storage.rs
index 0f0f611b..d517fa01 100644
--- a/src/grid/storage.rs
+++ b/src/grid/storage.rs
@@ -172,25 +172,11 @@ impl<T> Storage<T> {
self.len
}
- #[inline]
- pub fn raw_len(&self) -> usize {
- self.inner.len()
- }
-
/// Compute actual index in underlying storage given the requested index.
fn compute_index(&self, requested: usize) -> usize {
(requested + self.zero) % self.inner.len()
}
- #[inline]
- pub fn line_offset(&self) -> usize {
- self.inner.len() + self.zero + *self.visible_lines
- }
-
- pub fn compute_line_index(&self, a: Line) -> usize {
- (self.line_offset() - *a) % self.inner.len()
- }
-
pub fn swap_lines(&mut self, a: Line, b: Line) {
let offset = self.inner.len() + self.zero + *self.visible_lines;
let a = (offset - *a) % self.inner.len();
@@ -234,13 +220,6 @@ impl<T> Storage<T> {
}
}
- /// Iterator over *logical* entries in the storage
- ///
- /// This *does not* iterate over hidden entries.
- pub fn iter_mut(&mut self) -> IterMut<T> {
- IterMut { storage: self, index: 0 }
- }
-
/// Iterate over *all* entries in the underlying buffer
///
/// This includes hidden entries.
@@ -300,28 +279,6 @@ impl<T> IndexMut<Line> for Storage<T> {
}
}
-pub struct IterMut<'a, T: 'a> {
- storage: &'a mut Storage<T>,
- index: usize,
-}
-
-impl<'a, T: 'a> Iterator for IterMut<'a, T> {
- type Item = &'a mut Row<T>;
-
- fn next(&mut self) -> Option<Self::Item> {
- if self.index == self.storage.len() {
- None
- } else {
- let index = self.index;
- self.index += 1;
-
- unsafe {
- Some(&mut *(&mut self.storage[index] as *mut _))
- }
- }
- }
-}
-
#[cfg(test)]
use index::Column;
diff --git a/src/selection.rs b/src/selection.rs
index a54bd49d..dca16e26 100644
--- a/src/selection.rs
+++ b/src/selection.rs
@@ -47,11 +47,6 @@ pub enum Selection {
Semantic {
/// The region representing start and end of cursor movement
region: Range<Point<usize>>,
-
- /// When beginning a semantic selection, the grid is searched around the
- /// initial point to find semantic escapes, and this initial expansion
- /// marks those points.
- initial_expansion: Range<Point<usize>>
},
Lines {
/// The region representing start and end of cursor movement
@@ -109,11 +104,9 @@ impl Selection {
region.start.point.line = (region.start.point.line as isize + offset) as usize;
region.end.point.line = (region.end.point.line as isize + offset) as usize;
},
- Selection::Semantic { ref mut region, ref mut initial_expansion } => {
+ Selection::Semantic { ref mut region } => {
region.start.line = (region.start.line as isize + offset) as usize;
region.end.line = (region.end.line as isize + offset) as usize;
- initial_expansion.start.line = (initial_expansion.start.line as isize + offset) as usize;
- initial_expansion.end.line = (initial_expansion.end.line as isize + offset) as usize;
},
Selection::Lines { ref mut region, ref mut initial_line } => {
region.start.line = (region.start.line as isize + offset) as usize;
@@ -123,16 +116,11 @@ impl Selection {
}
}
- pub fn semantic<G: SemanticSearch>(point: Point<usize>, grid: &G) -> Selection {
- let (start, end) = (grid.semantic_search_left(point), grid.semantic_search_right(point));
+ pub fn semantic(point: Point<usize>) -> Selection {
Selection::Semantic {
region: Range {
start: point,
end: point,
- },
- initial_expansion: Range {
- start: start,
- end: end
}
}
}
@@ -153,7 +141,7 @@ impl Selection {
Selection::Simple { ref mut region } => {
region.end = Anchor::new(location, side);
},
- Selection::Semantic { ref mut region, .. } |
+ Selection::Semantic { ref mut region } |
Selection::Lines { ref mut region, .. } =>
{
region.end = location;
@@ -166,8 +154,8 @@ impl Selection {
Selection::Simple { ref region } => {
Selection::span_simple(grid, region)
},
- Selection::Semantic { ref region, ref initial_expansion } => {
- Selection::span_semantic(grid, region, initial_expansion)
+ Selection::Semantic { ref region } => {
+ Selection::span_semantic(grid, region)
},
Selection::Lines { ref region, ref initial_line } => {
Selection::span_lines(grid, region, *initial_line)
@@ -177,7 +165,6 @@ impl Selection {
fn span_semantic<G>(
grid: &G,
region: &Range<Point<usize>>,
- initial_expansion: &Range<Point<usize>>
) -> Option<Span>
where G: SemanticSearch + Dimensions
{