Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Not picking custom bat theme #953

Closed
hbarcelos opened this issue Feb 8, 2022 · 2 comments
Closed

🐛 Not picking custom bat theme #953

hbarcelos opened this issue Feb 8, 2022 · 2 comments

Comments

@hbarcelos
Copy link

Context

$ bat --version          
> bat 0.19.0 (59a8f58b)

$ delta --version           
> delta 0.11.3

Description

I've added a custom theme to bat as instructed in their docs. I've run bat cache --build and if I run bat --list-themes | cat I see the following list:

1337
Coldark-Cold
Coldark-Dark
DarkNeon
Dracula
GitHub
Monokai Extended
Monokai Extended Bright
Monokai Extended Light
Monokai Extended Origin
Nord
OneHalfDark
OneHalfLight
Solarized (dark)
Solarized (light)
Sublime Snazzy
TwoDark
Visual Studio Dark+
ansi
base16
base16-256
gruvbox-dark
gruvbox-light
polar-ice <-------- this is my theme!
zenburn

When using bat my custom theme works as expected. However, if I run delta --list-syntax-themes, I get:

Light syntax themes:
    GitHub
    Monokai Extended Light
    OneHalfLight
    Solarized (light)
    gruvbox-light

Dark syntax themes:
    1337
    Coldark-Cold
    Coldark-Dark
    DarkNeon
    Dracula
    Monokai Extended
    Monokai Extended Bright
    Monokai Extended Origin
    Nord
    OneHalfDark
    Solarized (dark)
    Sublime Snazzy
    TwoDark
    Visual Studio Dark+
    ansi
    base16
    base16-256
    gruvbox-dark
    zenburn

No polar-ice theme as I would expect.

In my themes.gitconfig file I have:

[delta "polar-ice-bear"]
    dark = true
    syntax-theme = polar-ice
    file-style = bold yellow
    file-decoration-style = yellow ol ul
    hunk-label = @
    hunk-header-style = line-number syntax
    hunk-header-file-style = magenta
    hunk-header-line-number-style = magenta
    hunk-header-decoration-style = none
    file-modified-label = ✎
    file-removed-label = ✖
    file-added-label = ✚
    file-copied-label = ⎘
    file-renamed-label = ➜
    minus-style = red
    minus-emph-style = lightgrey "#e11418"
    plus-style = green
    plus-emph-style = lightgrey "#61ab16"
    line-numbers = true
    line-numbers-minus-style = red
    line-numbers-zero-style = "#697981"
    line-numbers-plus-style = green
    line-numbers-left-format = "{nm:>4}┊"
    line-numbers-right-format = "{np:>4}│"
    line-numbers-left-style = "#697981"
    line-numbers-right-style = "#697981"

So the obvious result is that although the diff colors are correct, the theme for syntax highlighting is not working.

image

@dandavison
Copy link
Owner

Hi @hbarcelos, thanks for this. I think it's the same issue as #895. The immediate fix would be to use an older version of bat to create the custom theme for delta. The real fix is this unreleased PR #903 and the accompanying bat PR sharkdp/bat#2030 which would need to be released first.

@hbarcelos
Copy link
Author

Oh, I'm sorry for the duplicate.

I'll wait for the real fix to be release then.
Thank you for your awesome work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants