gitui-org / gitui-org/gitui

Wrong diff highlighting for "no newline at end of file"

Open
#2,223 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
22.5k
Forks
773
PR merge metrics
No merged PRs in 30d

Description

When a file without newline at the end is "fixed" by adding a newline, the diff view shows the message "\ No newline at end of file" in green:

![image](https://github.com/extrawurst/gitui/assets/2412819/9fe9427d-cc5a-4b4e-b23f-0797229c277c)

This is a bit misleading, it suggests that the change was to remove the newline rather than add it.

For comparison here's how it looks with the default `git diff`:

![image](https://github.com/extrawurst/gitui/assets/2412819/96fbb6c6-97a2-451c-8311-a80c119a835a)

(tested on gitui 0.26.1)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.