Fix vim code working on display map chars (#10103)

Release Notes:

- vim: Fixed motion bugs when softwrap, folds or inlay hints were used.
This commit is contained in:
Conrad Irwin 2024-04-02 22:16:52 -06:00 committed by GitHub
parent 754547f349
commit 5a2a85a7db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 95 additions and 140 deletions

View file

@ -876,10 +876,8 @@ impl EditorElement {
block_width = em_width;
}
let block_text = if let CursorShape::Block = selection.cursor_shape {
snapshot
.chars_at(cursor_position)
.next()
.and_then(|(character, _)| {
snapshot.display_chars_at(cursor_position).next().and_then(
|(character, _)| {
let text = if character == '\n' {
SharedString::from(" ")
} else {
@ -900,7 +898,8 @@ impl EditorElement {
}],
)
.log_err()
})
},
)
} else {
None
};