Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Add more languages to levels.lua #33

Open
brymer-meneses opened this issue May 6, 2021 · 21 comments
Open

Add more languages to levels.lua #33

brymer-meneses opened this issue May 6, 2021 · 21 comments

Comments

@brymer-meneses
Copy link

brymer-meneses commented May 6, 2021

I have configured this plugin to show custom colors and I want to make them appear in a certain order.
However, I get random order of appearance.

Screenshot from 2021-05-07 06-56-17

@brymer-meneses
Copy link
Author

brymer-meneses commented May 6, 2021

Is this a bug or a known feature?

@p00f
Copy link
Owner

p00f commented May 7, 2021

It's not random per se, it just uses all nodes to calculate nesting depth (instead of only brackets) so it appears random

This was adressed by #25 but I reverted it for other reasons, I'll add it again when #29 is complete.

I'm keeping this open as a reminder, thank you.

@brymer-meneses brymer-meneses changed the title Random order of colors Incorrect order of colors May 7, 2021
@brymer-meneses
Copy link
Author

Any updates on this one?

@p00f
Copy link
Owner

p00f commented May 18, 2021

I'll try to do it this week

@brymer-meneses
Copy link
Author

Thank you! Let me know if I can help!

@p00f
Copy link
Owner

p00f commented May 26, 2021

Sorry I got caught up in acads, I'll get to it now

p00f added a commit that referenced this issue May 26, 2021
Co-authored-by: another-name <kil0metres@users.noreply.github.com>"
p00f added a commit that referenced this issue May 26, 2021
Co-authored-by: another-name <kil0metres@users.noreply.github.com>"
p00f added a commit that referenced this issue May 26, 2021
Co-authored-by: another-name <kil0metres@users.noreply.github.com>"
@brymer-meneses
Copy link
Author

Sorry I got caught up in acads, I'll get to it now

Dude I'm not supporting you or anything, you're working for free. It's okay lol, I'm grateful for your work!

@p00f
Copy link
Owner

p00f commented May 26, 2021

You can try out the colornum branch now, I've done lua, c++ and rust.

Let me know if I can help!

Can you test if there's a performance hit against master ? Maybe large C++ files like firefox source

@p00f
Copy link
Owner

p00f commented May 26, 2021

before

image

after

image

@brymer-meneses
Copy link
Author

brymer-meneses commented May 26, 2021

You can try out the colornum branch now, I've done lua, c++ and rust.

It's a hit-or-miss.

2021-05-26_23-00

The brackets at the bottom of my screenshot are okay, however the colors at the top are not as expected.

@p00f
Copy link
Owner

p00f commented May 26, 2021

There's nothing much I can do for lua though - it's a parser limitation. To highlight print(1+(2+(3))) correctly I'll have to count binary_operation since there is no parenthesized_expression node like java here. This will now do

image

because it counts the concatenation as a level

c++ and rust on the other hand look much better

@p00f
Copy link
Owner

p00f commented May 26, 2021

Similarly there's no node for indexing so this happens

image

(which is maybe fine here because the shapes of the brackets are different)

@brymer-meneses
Copy link
Author

I guess we'll just have to live with this minor inconvenience then.

Thanks for fixing this!

@brymer-meneses
Copy link
Author

You can try out the colornum branch now, I've done lua, c++ and rust.

Let me know if I can help!

Can you test if there's a performance hit against master ? Maybe large C++ files like firefox source

I have opened a cpp file with 2500 lines taken from tensorflow, there was a slight lag, but not that bad imo.

@p00f
Copy link
Owner

p00f commented Jun 1, 2021

I've merged the colornum branch into master (currently with rust, cpp and fennel queries). Now we only need to add levels for more languages from #25 (and change if needed)

@p00f
Copy link
Owner

p00f commented Jun 1, 2021

I won't be able to do stuff in the coming weeks, feel free to submit PRs

@p00f
Copy link
Owner

p00f commented Jun 1, 2021

Just add the rainbow.level nodes from the PR into the respective table in levels.lua like so:
image

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2021

Stale issue message

@karimlevallois
Copy link

Is this still being worked on? I'm trying to mirror my colour settings from Sublime Text and VSCode, so I have put the colours in the same order in my lua config file. However, Python files (at least) are not colouring in the same order as they are in my config file.

@p00f
Copy link
Owner

p00f commented Aug 19, 2021

Is this still being worked on?

Not actively, I (and other contributors) fix this when I notice something

@p00f
Copy link
Owner

p00f commented Jan 23, 2022

Lua is fixed with the new parser

@p00f p00f changed the title Incorrect order of colors Add more languages to levels.lua Jan 23, 2022
@p00f p00f pinned this issue Jan 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants