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

Inconsistent colors with nvim configuration #24

Closed
raffaem opened this issue Jan 29, 2024 · 5 comments · Fixed by #29
Closed

Inconsistent colors with nvim configuration #24

raffaem opened this issue Jan 29, 2024 · 5 comments · Fixed by #29
Labels
good first issue Good for newcomers

Comments

@raffaem
Copy link
Contributor

raffaem commented Jan 29, 2024

I have both the nvim theme and this theme for IPython.

However, colors are inconsistent.

For example, "from" and "import" keywords are mauve in nvim and teal in IPython.

Package names are white in nvim and orange in IPython.

Imported classes are yellow and peach respectively:

image

@backwardspy
Copy link
Member

you're right, the current colour choices in the pygments integration are from before we had standardised our syntax highlights; they need to be changed to fit the updated style guide.

@backwardspy backwardspy added the good first issue Good for newcomers label Jan 29, 2024
@raffaem
Copy link
Contributor Author

raffaem commented Jan 29, 2024

def _make_styles(flavour: Flavour) -> Dict[_TokenType, str]:

https://github.com/catppuccin/catppuccin/blob/main/docs/style-guide.md#code-editors

?

@backwardspy
Copy link
Member

backwardspy commented Jan 29, 2024

(in reply to a deleted comment) i found it very hard to find documentation on how exactly to write proper pygments themes, especially when it comes to their use in ipython. what we have right now is the result of a lot of experimentation and referencing what scant resources i could find on github et cetera. please let me know if you do manage to make any headway with it!

@raffaem
Copy link
Contributor Author

raffaem commented Jan 31, 2024

(in reply to a deleted comment) i found it very hard to find documentation on how exactly to write proper pygments themes, especially when it comes to their use in ipython. what we have right now is the result of a lot of experimentation and referencing what scant resources i could find on github et cetera. please let me know if you do manage to make any headway with it!

Does the PR looks good?

I find Pygments is a "simpler" syntax highlighter. The lexer splits code into tokens, the filter filters the list of tokens, then the formatter will print out the list of tokens using the style.

This is different from the syntax highlighting that neovim uses which is based on tree-sitter.

Pygments doesn't distinguish between variables, global functions, class functions. All of them are tokenized as Token.Name, so it leads to different syntax highlighting.

Anyway, I think I came near to the best we could.

@backwardspy
Copy link
Member

hey, i saw your PR but haven't had a chance to try it out yet, but i really appreciate the effort you've put into this. i'll try and give it a go soon and give you some feedback. thanks!

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

Successfully merging a pull request may close this issue.

2 participants