-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Add Word Coloring to Multi-Line Control #986
Comments
Hello, Realistically it isn't going to happen soon, but eventually we may evolve the text editor to provide some sort of text coloring facility. It's not a trivial feature and won't happen soon so don't hold your breath right now :) |
ah, ok thanks :) |
Closing this as expected. Note that there is a full-featured code editor that you might want to use here: |
Unfortunatelly linked widget has currently broken calculation of cursor position. It is off in +x axis more the longer text is on line. Basically there seems to be some issue with calculation from column to screen pos of character. I did report it to author. Maybe you may know about some change that may broke it i found for example rounding in ImGui::CalcTextSize which iam not sure about (but removing it did not help either) |
Hmm, the only thing I can think of is that change |
I tried to revert this but it did not fix the issue but when i removed rounding at the end of ImGui::CalcTextSize it started working. Problem from what i have seen is that author is using CalcTextSize on per character basis to calculate cursor position. This rounding then introduces bigger and bigger error with each character (none of them has exact size). Part from commit you mentioned he probably attempt to mitigate resulting in another error after mentioned commit. |
They should probably use the lower level |
I tried that and it seem to be working well now (had to remove their parts that were fighting removed code you mentioned previously). OK, will test font scaling and give them patch :-) Thank you for your assistance, it was really helpfull |
Hello,
finally i abandon scintilla.
i just need word coloring in the text multi line control.
I hope i can have a string with information about word start, word end, and word color to pass to the multi-line control. like that maybe "start : end : color" => "10:22:#99ccff"
So before the multi-line control i imagine analyse the text and format a special string for it in the ImGuiTextEditCallback
Finally i imagine pass this buffer to a modified version of ImFont::RenderText.
Do you think i may be heavy , maybe you have another way ?
Thanks for your help
The text was updated successfully, but these errors were encountered: