From 8f57e9cfd4105ef42ae469151c4d5ab91415b7bb Mon Sep 17 00:00:00 2001 From: thomasschafer Date: Sat, 15 Jun 2024 18:48:46 +0100 Subject: [PATCH] Fix naming of previous jump, and remove unneeded comment change --- helix-view/src/view.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index 83ea4f0dca30a..68d25a5d947e6 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -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); @@ -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 {