dandavison / dandavison/delta

🐛 `syntax` not respected for `*-non-emph-style`

Open
#545 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.2k
Forks
572
Avg merge
11m
Merged PRs (30d)
1

Description

Hi! I'm noticing that if I have the following style settings:

```
minus-style = red
minus-emph-style = bold underline red
minus-non-emph-style = syntax
plus-style = green
plus-emph-style = bold underline green
plus-non-emph-style = syntax
```

Then the `minus/plus-non-emph-style` seems to use `normal` instead of `syntax` highlighting:
Screen Shot 2021-03-21 at 12 41 39 AM

However, if I use:

```
minus-style = syntax
minus-emph-style = bold underline red
minus-non-emph-style = syntax
plus-style = syntax
plus-emph-style = bold underline green
plus-non-emph-style = syntax
```

Then the `minus/plus-non-emph-style` will use `syntax` as expected:

Screen Shot 2021-03-21 at 12 42 52 AM

However, I'm trying to get it such that only the meaningful changes are red/green while everything else is syntax highlighted. I could see why this would be difficult to implement, so I wasn't sure if this was expected behavior. Couldn't find it documented anywhere.

Fantastic plugin btw, I really appreciate all the work done on this 🙂

If it helps, the raw output of the screenshotted section using `git --no-pager diff`:
```
" buffer navigation
nnoremap
nnoremap l :Buffers
-nnoremap { :bprevious
-nnoremap } :bnext
-nnoremap Q :bprevious bdelete #
+nnoremap [ :bprevious
+nnoremap ] :bnext
nnoremap ; :BLines
nnoremap : :Lines
+nnoremap Q :bprevious bdelete #

" tab navigation
-nnoremap [ :tabp
-nnoremap ] :tabn
+nnoremap { :tabp
+nnoremap } :tabn
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the reported minus/plus style settings and a git diff containing changed and unchanged lines, then compare the rendering with the configuration where the main styles use syntax. Done means non-emphasized unchanged content retains syntax highlighting while meaningful changes remain red or green.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.