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

syntax highlighting not working #46

Closed
carmen-gh opened this issue Aug 22, 2023 · 6 comments
Closed

syntax highlighting not working #46

carmen-gh opened this issue Aug 22, 2023 · 6 comments

Comments

@carmen-gh
Copy link

Hi, thanks for this awesome tool.
I use it everyday in lazygit.

I wonder how the syntax highlighting is working.
My kotlin code is not highlighted and I wonder if there is a fix a can do on my machine or if it needs to be supported by the tool.

@carmen-gh
Copy link
Author

https://github.com/shikijs/shiki/blob/v0.9.3/docs/languages.md#literal-values
kotlin is listed as supported language in shiki

@banga
Copy link
Owner

banga commented Sep 4, 2023

Hey, glad you like it! This is happening because I use the file extension as the language name passed to shiki, which usually works because shiki has aliases from file extensions to languages (e.g. 'rs' for rust), but it doesn't for Kotlin.

A PR like shikijs/shiki#353 adding aliases: ['kt'] for kotlin should resolve this issue if you feel comfortable doing that. If not, I can take a stab at it.

@carmen-gh
Copy link
Author

Thanks, yes I will definitely take the opportunity and create a PR

@carmen-gh
Copy link
Author

shikijs/shiki#525

@carmen-gh
Copy link
Author

@banga
Copy link
Owner

banga commented Oct 12, 2023

Great! I just bumped the shiki version to pick this up and checked that kotlin files highlight correctly now. I released v0.17.0, which you should be able to update to via npm i -g git-split-diffs.

@banga banga closed this as completed Oct 13, 2023
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