Delta: 馃悰 syntax-theme should be honored in a custom feature in gitconfig

Created on 14 Jul 2020  路  9Comments  路  Source: dandavison/delta

With this config, the syntax-theme should be activated, but is not. side-by-side is activated however, as expected. cc @amanjitsk ref #251

[delta]
    features = my-feature

[delta "my-feature"]
    syntax-theme = Nord
    side-by-side = true

Most helpful comment

@amanjitsk the bugs you reported with syntax-theme and paging not respecting (custom features in) git config have both been fixed on master. I'll aim to release them in the next few days and will probably mention on this ticket when released.

All 9 comments

I have also noticed that the paging = always option does not take effect for diffs shorter than the height of the terminal (which is really my sole usecase for paging=always). Don't know if this is how its meant to be or if I have something weird going on.

Hi @amanjitsk, I think that's working for me. What do you get if you do these?

env | grep -iE '(pager|less)'
echo hello | delta --paging=always

I get this:

image

For the first command, I get a huge list, but the relevant portion is
image
For the second command, I get something weird. I get
image

but then on pressing any other key, I proceed to get the paged output as expected (with the pager)

For the second command, I get something weird. I get

OK, that's because you have navigate active. I've added a section in the README now describing this problem, pasted below. Incidentally, I'm finding git config --global really useful for toggling certain delta settings on-the-fly.


The recommended way to use navigate is to activate it only when needed, for example by doing

git config --global delta.navigate true

The reason is the following: Delta uses less as its pager, and the navigate feature works by doing less --pattern <regex-matching-file-and-commit-lines>. When the git output does not contain file/commit diff lines, less --pattern behaves unhelpfully (see #234, #237).

Ah I see, thanks for the pointer, makes sense!

One more question; I currently have paging = always set in my git config, but it doesn't seem to work unless I specify it at the command line. Is this also expected ? That's what I had originally meant!

I currently have paging = always set in my git config, but it doesn't seem to work unless I specify it at the command line. Is this also expected ?

Hm, I think that's a bug. I can reproduce it. Thanks!

@amanjitsk the bugs you reported with syntax-theme and paging not respecting (custom features in) git config have both been fixed on master. I'll aim to release them in the next few days and will probably mention on this ticket when released.

Thanks for the quick update! I'll wait for the binary release as I don't have rust installed

Was this page helpful?
0 / 5 - 0 ratings