movement: Remove unused stop_at_soft_boundaries parameter from line_beginning (#63245)
# Objective remove the entire `stop_at_soft_boundaries` parameter from `line_beginning`, since it was never used --- Release Notes: - N/A
This commit is contained in:
1 parent
fecc3273ed
commit
4ccbcabfee
3 files changed
+10
-20
No files matched your search
@@ -190,26 +190,16 @@ pub(crate) fn down_by_rows(
|
||||
}
|
||||
|
||||
/// Returns a position of the start of line.
|
||||
/// If `stop_at_soft_boundaries` is true, the returned position is that of the
|
||||
/// displayed line (e.g. it could actually be in the middle of a text line if that line is soft-wrapped).
|
||||
/// Otherwise it's always going to be the start of a logical line.
|
||||
pub fn line_beginning(
|
||||
map: &DisplaySnapshot,
|
||||
display_point: DisplayPoint,
|
||||
stop_at_soft_boundaries: bool,
|
||||
) -> DisplayPoint {
|
||||
let point = display_point.to_point(map);
|
||||
let soft_line_start = map.clip_point(DisplayPoint::new(display_point.row(), 0), Bias::Right);
|
||||
let line_start = map.prev_line_boundary(point).1;
|
||||
|
||||
if stop_at_soft_boundaries && display_point != soft_line_start {
|
||||
soft_line_start
|
||||
} else {
|
||||
line_start
|
||||
}
|
||||
///
|
||||
/// It's always going to be the start of a logical line.
|
||||
/// If you want to stop at last indented position or soft boundaries,
|
||||
/// use [`indented_line_beginning`] instead.
|
||||
pub fn line_beginning(map: &DisplaySnapshot, display_point: DisplayPoint) -> DisplayPoint {
|
||||
map.prev_line_boundary(display_point.to_point(map)).1
|
||||
}
|
||||
|
||||
/// Returns the last indented position on a given line.
|
||||
/// Returns the last indented position or the start of a given line.
|
||||
///
|
||||
/// If `stop_at_soft_boundaries` is true, the returned [`DisplayPoint`] is that of a
|
||||
/// displayed line (e.g. if there's soft wrap it's gonna be returned),
|
||||
/// otherwise it's always going to be a start of a logical line.
|
||||
|
||||
@@ -93,7 +93,7 @@ impl Vim {
|
||||
// Pasting before means pasting before the whole selection.
|
||||
let display_point = if line_mode {
|
||||
if action.before {
|
||||
movement::line_beginning(&display_map, sel.start, false)
|
||||
movement::line_beginning(&display_map, sel.start)
|
||||
} else {
|
||||
if sel.start == sel.end {
|
||||
movement::right(
|
||||
|
||||
@@ -166,7 +166,7 @@ impl Vim {
|
||||
selection.start..end_point
|
||||
} else if line_mode {
|
||||
let point = if before {
|
||||
movement::line_beginning(&display_map, selection.start, false)
|
||||
movement::line_beginning(&display_map, selection.start)
|
||||
} else {
|
||||
movement::line_end(&display_map, selection.start, false)
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user