commit | 8225bf0c372a7cdc92d6598a751586a616006e40 | [log] [tgz] |
---|---|---|
author | Marcel Smit <marcel303@gmail.com> | Thu Oct 11 10:16:22 2018 +0200 |
committer | Marcel Smit <marcel303@gmail.com> | Thu Oct 11 10:16:22 2018 +0200 |
tree | 2b6862fb5c32ca54bf7276b20ea9a489b7f59dc1 | |
parent | 11877e9a7574f32ca68dfb4f8e11425c32b7db91 [diff] |
- Small optimizes SetText, GetText. - Added GetTextLines and SetTextLines, which directly get passed in a vector of strings. The reasons for having these functions are 1) when I save a file, I want to write '\r\n' or '\n' depending on the line ending mode detected when loading a file, or as set by the user through a menu option. In either case, I want to set the line ending myself, instead of having the text editor use '\n' when concatenating all of the lines. 2) when loading a file, I will read the entire file, detect line endings, create strings in a vector. The regular SetText would have my concatenate all of these strings, only so it can split it up again. Passing the vector directly is more than twice as fast and less cumbersome.
Syntax highlighting text editor for ImGui
Demo project: https://github.com/BalazsJako/ColorTextEditorDemo
This is my attempt to write a relatively simple widget which provides source code editing functionality with basic syntax highlighting.
While it relies on Omar Cornut's https://github.com/ocornut/imgui, it does not follow the “pure” one widget - one function approach. Since the editor has to maintain a relatively complex internal state, it did not seem to be practical to try and enforce fully immediate mode.
The code is work in progress, please report if you find any issues.
Main features are:
Known issues:
Don't forget to post your screenshots if you use this little piece of software in order to keep me motivated. :)