You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the d} command, if there's no new line at the end of the buffer, the last character will be left behind. The same command, in vim, would delete all lines.
Steps to reproduce:
Create new file with workspace: new file
Write two lines of text, for example, This is\ntwo lines
Move the cursor to the first column of the first row, location 1:1 on the bottom right
Press d} to delete until the end of the paragraph
Confirm that the s from lines is not deleted
Expected Behavior: All lines are deleted, regardless of whether a new line exists at the end of the file
Actual Behavior: The last character is not deleted
This Pull Request attempts to fix an issue where using `d}` in vim mode
would not delete all characters in case there's no blank lines at the
end of the buffer.
When calculating the end point for this motion, if there's no blank
lines at the end of the buffer, Zed was calculating it to be the last
character in the last line. However, if there's a newline at the end of
the buffer, it calculates the end point to be the point at the right of
the last character.
Here's an example, for the following buffer contents:
```
Hello!
Hello!
```
If the `d}` command is run at `(0, 0)`, the end point will be set to
`(1, 5)`. However, fi the same command is run for this buffer instead:
```
Hello!
Hello!
```
The end point will be set to `(1, 6)`, there's a 1 unit difference in
the column, which leads to all characters actually being deleted.
Closes#29393
Release Notes:
- Fixed deleting to the end of paragraph when there's no blank lines
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Summary
When using the
d}
command, if there's no new line at the end of the buffer, the last character will be left behind. The same command, in vim, would delete all lines.Steps to reproduce:
workspace: new file
This is\ntwo lines
1:1
on the bottom rightd}
to delete until the end of the paragraphs
fromlines
is not deletedExpected Behavior: All lines are deleted, regardless of whether a new line exists at the end of the file
Actual Behavior: The last character is not deleted
Screencast
Vim
vim.mov
Zed
zed.mov
Zed Version and System Specs
Zed: v0.183.10 (Zed)
OS: macOS 15.3.2
Memory: 16 GiB
Architecture: aarch64
The text was updated successfully, but these errors were encountered: