@@ -260,7 +260,7 @@ impl View {
260260
261261 // If pos is in the middle of a wider grapheme (tab for example)
262262 // return the starting offset.
263− if col + width >= target {
263+ if col + width > target {
264264 break;
265265 }
266266
@@ -356,7 +356,7 @@ mod tests {
356356
357357 assert_eq!(
358358 view.text_pos_at_screen_coords(&text, 41, 40 + OFFSET + 1, 4),
359− Some(5)
359+ Some(4)
360360 );
361361
362362 assert_eq!(
@@ -384,9 +384,13 @@ mod tests {
384384 Some(0)
385385 );
386386
387+ assert_eq!(
388+ view.text_pos_at_screen_coords(&text, 40, 40 + OFFSET + 4, 4),
389+ Some(4)
390+ );
387391 assert_eq!(
388392 view.text_pos_at_screen_coords(&text, 40, 40 + OFFSET + 5, 4),
389− Some(5)
393+ Some(4)
390394 );
391395
392396 assert_eq!(
@@ -396,7 +400,7 @@ mod tests {
396400
397401 assert_eq!(
398402 view.text_pos_at_screen_coords(&text, 40, 40 + OFFSET + 7, 4),
399− Some(6)
403+ Some(5)
400404 );
401405
402406 assert_eq!(