Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Enhancements for the rename panel #2428
Enhancements for the rename panel #2428
Changes from 13 commits
28a366f
0f9f72f
c667f3b
0d93fc9
cb9fd8f
7ded35c
b817449
897297c
3d0ee6a
7a66743
2225e1c
670ff23
239d4af
c24f4e2
36218f9
76db9d8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
maybe the naming could be a bit more clear that it's about position like
utf_16_pos_to_code_point_pos
?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.
I don't really feel
utf_16_pos_to_code_point_pos
. Could we keep the current name? I have reworded the docstring a little bit, and I think it's clear from the docstring and from usage what the function does.Btw, the parameter is named
col
because that's the name given in theView.text_point_utf16
method.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.
The name to me strongly suggests something that feels like charset conversion which I think is kinda confusing.
Can we do
utf16_offset_to_code_point_offset
? Or if we want to match ST more thenutf16_point_to_code_point
?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.
I'm willing to give up if you insist. I'm after all nit picking a bit.
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.
Well, I'd say "code points" already implies that it's about the position, because there is no character encoding named "code points". If we want to have the word "position" in the name, then I would suggest
utf16_to_utf32_position
.If we want to mach ST closely, then it should probably be
code_point_utf16
or even the same nametext_point_utf16
(but the latter would be confusing I guess). The only difference between the builtin and this function here is that the builtin counts from the beginning of the view's content, while this one takes the string as an explicit parameter, and it always usesclamp=True
.So I would prefer one of these:
utf16_to_code_points
(current)utf16_to_utf32_position
code_point_utf16
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.
kinda like
utf16_to_utf32_position
but choose yourself whether to rename it or not later