If you open diffview in a repository with files in dos format, the buffer holding contents of the file in the index (on the left for changes, on the right for staged changes), is always in unix format. If you modify and write this buffer, you will change the file format and thus appear to have changed every line in this git revision.
Using the file browser to stage entire files (pressing - in the left sidebar does not appear to have this problem. Consequences only occur if you save the index buffer manually.
Expected behavior
Buffers containing the index state of a file should be consistent with its format in the local repository and workspace.
Actual behavior
The index buffer is always unix format.
Steps to reproduce
Create a git repository and add a file containing some text. Save it in the dos format.
Commit the file to history.
Modify the file in some manner.
Run :DiffviewOpen. Note the file format of the index is unix while the workspace is dos.
Modify the index buffer and save.
Observe with git dif --staged that the file format has been changed and every line appears in the diff.
Health check
Output of :checkhealth diffview
```
diffview: require("diffview.health").check()
Checking plugin dependencies ~
- OK nvim-web-devicons installed.
Checking VCS tools ~
- The plugin requires at least one of the supported VCS tools to be valid.
- OK Git found.
- OK Git is up-to-date. (2.41.0)
- WARNING Configured `hg_cmd` is not executable: 'hg'
```
Log info
Relevant info from :DiffviewLog
```
# No relevant log info.
```
Description
If you open diffview in a repository with files in dos format, the buffer holding contents of the file in the index (on the left for changes, on the right for staged changes), is always in unix format. If you modify and write this buffer, you will change the file format and thus appear to have changed every line in this git revision.
Using the file browser to stage entire files (pressing
-
in the left sidebar does not appear to have this problem. Consequences only occur if you save the index buffer manually.Expected behavior
Buffers containing the index state of a file should be consistent with its format in the local repository and workspace.
Actual behavior
The index buffer is always unix format.
Steps to reproduce
:DiffviewOpen
. Note the file format of the index is unix while the workspace is dos.git dif --staged
that the file format has been changed and every line appears in the diff.Health check
Output of
``` diffview: require("diffview.health").check() Checking plugin dependencies ~ - OK nvim-web-devicons installed. Checking VCS tools ~ - The plugin requires at least one of the supported VCS tools to be valid. - OK Git found. - OK Git is up-to-date. (2.41.0) - WARNING Configured `hg_cmd` is not executable: 'hg' ```:checkhealth diffview
Log info
Relevant info from
``` # No relevant log info. ```:DiffviewLog
Neovim version
Operating system and version
Linux 6.3.8-arch1-1 x86_64 GNU/Linux
Minimal config