on master help sign in
Handle edge case in `range_to_target()` correctly.
commite98d669c303576802291ef9826a22066e4191808 authorNathan Vegdahl <cessen@cessen.com> dateMon 19 Jul 2021, 12:30 (5 years ago) parentb0311f4
1 file changed+1−1
helix-core/src/movement.rs+1−1
helix-core/src/movement.rs+1−1
@@ -285,7 +285,7 @@ impl CharHelpers for Chars<'_> {
285285 // Find our target position(s).
286286 let head_start = head;
287287 while let Some(next_ch) = self.next() {
288− if reached_target(target, prev_ch.unwrap_or(next_ch), next_ch) {
288+ if prev_ch.is_none() || reached_target(target, prev_ch.unwrap(), next_ch) {
289289 if head == head_start {
290290 anchor = head;
291291 } else {