mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-10 20:41:59 +00:00
Adjust left movement when soft_wrap mode is used (#10464)
Release Notes: - Added/Fixed #10350
This commit is contained in:
parent
e0e1103228
commit
3ea17248c8
1 changed files with 6 additions and 0 deletions
|
@ -47,6 +47,12 @@ pub fn left(map: &DisplaySnapshot, mut point: DisplayPoint) -> DisplayPoint {
|
|||
pub fn saturating_left(map: &DisplaySnapshot, mut point: DisplayPoint) -> DisplayPoint {
|
||||
if point.column() > 0 {
|
||||
*point.column_mut() -= 1;
|
||||
} else if point.column() == 0 {
|
||||
// If the current sofr_wrap mode is used, the column corresponding to the display is 0,
|
||||
// which does not necessarily mean that the actual beginning of a paragraph
|
||||
if map.display_point_to_fold_point(point, Bias::Left).column() > 0 {
|
||||
return left(map, point);
|
||||
}
|
||||
}
|
||||
map.clip_point(point, Bias::Left)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue