-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 methods to get position from column and line in TextEdit
#55102
Add methods to get position from column and line in TextEdit
#55102
Conversation
f14f16d
to
c9755a7
Compare
I've applied suggested changes and removed some no-longer-necessary code. Retested with folding and wrapping and it seems to work as expected. Curious about the "If the first and last character is visible, it doesn't necessarily mean all character in between are" case, but don't know what to do about it. We can remove the check for the visible range, of course. It was only proposed as an optimization step to avoid going for characters that are definitely not visible (as for the purposes of these new methods, we return So please let me know what I need to do here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nitpicks otherwise looks good.
If the col
optimisation is too much effort to work in, will be okay to leave it out.
c9755a7
to
9d0fc97
Compare
9d0fc97
to
e85e6ec
Compare
I've moved things around as requested, and added a note to the docs to explain the difference between values returned by the two methods. Since I want to keep PS. See the second to last force-push for the relevant changes, the last one is just a rebase. |
Thanks! |
This closes godotengine/godot-proposals#1644 for
master
. I'm going to make another PR for3.x
, but it's going to be quite different for obvious reasons.The added methods can be useful to draw something around specific characters. We'll have a proper API for that at some point, but this should be generally useful still. And this would allow to introduce similar methods to
3.x
and preserve feature parity.I'm really interested to see if this is a good implementation, as I don't feel comfortable working with TextServer yet and am not confident about the approach 😅