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
I found unstaged new line deletion after staging new empty buffer with stage_buffer subcommand. At the moment I cannot explain myself how nvim or gitsigns can cause it.
No .editorconfig in working directory.
Neovim version
v0.11.0-dev-124+g90a4b1a59
Operating system and version
Debian Sid
Expected behavior
It seems that git diff output on such file should be empty.
I'm not sure this is a bug. Nvim cannot display buffers with no lines as the cursor needs to go somewhere. When you run stage_buffer you are going to stage at least 1 empty line, however when you save the buffer, since their are no modifications, the newline doesn't get written. If you insert a character, save, remove, save again, the file will be saved with 1 empty line.
I tried to reproduce it again and noticed one missing assumption: empty file new2 exists - otherwise GIT_PAGER= git diff -- new2 shows empty output.
It seems that if the buffer contains nothing or some white character but the corresponding file is empty, the result of stage_buffer should be addition or nothing.
Description
I found unstaged new line deletion after staging new empty buffer with
stage_buffer
subcommand. At the moment I cannot explain myself how nvim or gitsigns can cause it.No
.editorconfig
in working directory.Neovim version
v0.11.0-dev-124+g90a4b1a59
Operating system and version
Debian Sid
Expected behavior
It seems that
git diff
output on such file should be empty.Actual behavior
Minimal config
Steps to reproduce
Inside some Git repo
nvim --clean -u minimal.lua
new2:Gistigns stage_buffer
GIT_PAGER= git diff -- new2
Gitsigns debug messages
The text was updated successfully, but these errors were encountered: