Open janosharsanyi opened 2 months ago
I like this idea. I use Ctrl+D a lot to change variable names in bulk and it is really annoying that the "position" in global_position is selected when you have selected the position variable name, as in your example. It is especially annoying since if you select "position" (the variable) all other position variables will be highlighted, but the Ctrl+D action will deviate from that highlighting and select global_position as well.
Describe the project you are working on
Any project
Describe the problem or limitation you are having in your project
When variables/functions in the code start with the same prefix, it can be cumbersome to select the next whole word matches.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
If the selection was empty and the cursor is near a word, it is selected automatically. However currently when
Ctrl+D
is pressed again, it can also select parts of words. With this enhancement, it would only select matched words in this case.If parts of the code was selected when
Ctrl+D
was first pressed, next presses ofCtrl+D
would select substrings (as the current behavior, this part would be unchanged).Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Ctrl+D
pressed without initial selection:Ctrl+D
pressed when a part of the text was already selected (keep current behavior):We would need to know when the user pressed
Ctrl+D
(inTextEdit::add_selection_for_next_occurrence
/ui_text_add_selection_for_next_occurrence
) if the selection was initially empty (and the first word selection was started by the function itself) or the user pressedCtrl+D
after selecting part of the code.(This would reset on manual selection change.)
If this enhancement will not be used often, can it be worked around with a few lines of script?
False-positive matches can be skipped with
Ctrl+Alt+D
, but takes longer and error-prone.Is there a reason why this should be core and not an add-on in the asset library?
Other editors work like this, it's inconvenient to re-adjust using this text editor