on master help sign in
Handle edge case in `range_to_target()` correctly.
e98d669Nathan Vegdahl
helix-core/src/movement.rs+1−1
@@ -285,7 +285,7 @@ impl CharHelpers for Chars<'_> {
285 // Find our target position(s).
285 // Find our target position(s).
286 let head_start = head;
286 let head_start = head;
287 while let Some(next_ch) = self.next() {
287 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) {
289 if head == head_start {
289 if head == head_start {
290 anchor = head;
290 anchor = head;
291 } else {
291 } else {