Skip to content

Commit

Permalink
style: include comment to explain pos_at_visual_coords breaking con…
Browse files Browse the repository at this point in the history
…dition
  • Loading branch information
mtoohey31 committed Jun 7, 2022
1 parent 33e8fa7 commit 3c17265
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helix-core/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ pub fn pos_at_visual_coords(text: RopeSlice, coords: Position, tab_width: usize)
grapheme_width(&grapheme)
};

// If pos is in the middle of a wider grapheme (tab for example)
// return the starting offset.
if grapheme_width > cols_remaining {
break;
}
Expand Down

0 comments on commit 3c17265

Please sign in to comment.