Skip to content

Commit

Permalink
Fix naming of previous jump, and remove unneeded comment change
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasschafer committed Jun 15, 2024
1 parent edf568b commit 381660c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helix-view/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl JumpList {
self.jumps.truncate(self.current);
// don't push duplicates
if self.jumps.back() != Some(&jump) {
// If the jumplist is full, drop the oldest items until we have space for another addition.
// If the jumplist is full, drop the oldest item.
while self.jumps.len() >= JUMP_LIST_CAPACITY {
if self.jumps.pop_front().is_some() {
self.current = self.current.saturating_sub(1);
Expand Down Expand Up @@ -72,12 +72,12 @@ impl JumpList {
}
// We need to do this separately from checked_sub above as pushing to the jumplist might change the position of self.current
self.current = self.current.saturating_sub(count);
self.jumps.get(self.current).and_then(|next_jump| {
if next_jump == &cur_jump {
self.jumps.get(self.current).and_then(|prev_jump| {
if prev_jump == &cur_jump {
self.current = self.current.saturating_sub(1);
self.jumps.get(self.current)
} else {
Some(next_jump)
Some(prev_jump)
}
})
} else {
Expand Down

0 comments on commit 381660c

Please sign in to comment.