vim: Refactor and fix multiline operations (#25055)
Changes:
- [x] Cursor at the start during yank operations on objects (`yip`,
`yab` etc).
- [x] Refactors this: Trim all leading and trailing whitespace from
inner multiline bracket selection.
- This leaves a nicely indented line when doing `ci{` `vi{d` etc
- [x] Checks for empty selection
- [x] Removed moving cursor to the start in visual bracket operations
This cleans up the previous implementation by providing a simpler check
in `surrounding_markers`, instead of calling a new function in
`expand_object`. No functionality was changed there except for handling
the empty selection and removing some cursor adjustments that should not
have been there after further testing.
Release Notes:
- N/A
This commit is contained in:
@@ -16,7 +16,7 @@ use workspace::searchable::Direction;
|
||||
|
||||
use crate::{
|
||||
motion::{first_non_whitespace, next_line_end, start_of_line, Motion},
|
||||
object::{self, Object},
|
||||
object::Object,
|
||||
state::{Mode, Operator},
|
||||
Vim,
|
||||
};
|
||||
@@ -375,9 +375,6 @@ impl Vim {
|
||||
} else {
|
||||
selection.end = range.end;
|
||||
}
|
||||
if !around && object.is_multiline() {
|
||||
object::preserve_indented_newline(map, selection);
|
||||
}
|
||||
}
|
||||
|
||||
// In the visual selection result of a paragraph object, the cursor is
|
||||
|
||||
Reference in New Issue
Block a user