Skip to content

🐛 Trailing whitespace in otherwise empty line is not highlighted #212

@FranklinYu

Description

@FranklinYu

Steps to reproduce:

  1. Clone any repository, such as this one.
  2. Edit a file with an empty line on it, such as Cargo.toml.
  3. Add a space (or tab) to the empty line.
  4. git diff

Git raw diff:

diff --git a/Cargo.toml b/Cargo.toml
index 7c7e71f..7330174 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ license = "MIT"
 readme = "README.md"
 repository = "https://github.com/dandavison/delta"
 version = "0.2.0"
-
+
 [[bin]]
 name = "delta"
 path = "src/main.rs"
@@ -36,6 +36,6 @@ default-features = false
 features = ["parsing", "assets", "yaml-load", "dump-load", "regex-onig"]

 [dependencies.error-chain]
-version = "0.12.2"
+version = "0.12.2"
 default-features = false
 features = []

Screenshot of Git raw diff:

image

Screenshot of Delta diff:

image

Note that, as comparison, trailing whitespace is rendered correctly. I would like a whitespace-only line to look the same.

Environments

  • Delta 0.1.1
  • macOS Catalina
  • Git 2.24.3 (macOS built-in version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions