-
Notifications
You must be signed in to change notification settings - Fork 0
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
C/C++ syntax highlighting #116
Comments
It is doable and also a nice idea. |
It has been asked for but I don't see it written up anywhere. Thanks for doing so. |
there's already an ImGUI component for this: https://github.com/BalazsJako/ImGuiColorTextEdit |
How about GNU Emacs's Face mechanism that allow user to choose color for different kinds of word of programming language? |
Please export the function that handle the text rendering, so i can implement my own with colors This issue is 4 years old and no progress were made $30 software btw |
@ryuukk Apologies for the lack of progress on this. I don't use syntax highlighting but I understand that it is a useful feature to have when viewing code for many people. The library you pointed to in the previous comment was used as the basis for the text view in RemedyBG long ago. However, it has been largely gutted due to performance (and other) issues (like failing to syntax highlight properly). From the project's readme:
I did intentionally note that syntax highlighting is not available in the project's page:
Perhaps I incorrectly chose which features to work on in my limited time over the years (I'd much rather write a debugger than a text editor) and I, again, apologize for not getting to this sooner. Anyway, happy to refund your money given viewing colorized text is an important feature for you and has not been implemented yet. |
I've been reading up about the tree-sitter lib lately (https://tree-sitter.github.io/tree-sitter/), and it seems like a pretty capable thing. I haven't tried anything with it myself, so I cannot speak about how hefty of a dependency it is or how easy to use it is in practice, but what I gather from other people is that it at least looks decent. |
Yeah, I would second tree-sitter recommendation. It should be faster and more accurate than regex. I really wish this feature exist. |
Thanks for the suggestion @n00bmind. I'll take a look. |
Doesn't look like tree-sitter is going to work out at this time. For example,
|
ok, I've just open sourced my very simple highlighter (header only), it can be found here along with an example, it requires C++17 because of std::string_view, but well... |
Implemented comment / keyword highlighting. To ship in 0.3.9.7. |
Not sure if this has actually been requested by anyone, but it would be nice to be at least able to highlight the standard keywords used in C/C++ in the source file window so that it's easier to identify areas of the code. Having everything be one colour makes a little hard to read code sometimes.
The text was updated successfully, but these errors were encountered: