Prepopulate replace input with current editor selection#1964
Prepopulate replace input with current editor selection#1964peterflynn merged 3 commits intoadobe:masterfrom jbalsas:jbalsas/findreplace-selection
Conversation
|
This looks good, but one thing I noticed is that the replace begins on the next occurrence after the text you initially selected. It loops back around eventually, but the text you had selected will always be last to get replaced. This bug already existed, of course, but your change makes it easier to hit since there's now an incentive to have some text selected. I think you can fix this by changing line 225 from |
|
Yes, I noticed that as well, but as it was already happening in master and is stated in the comments at the top I thought about trying to solve it separately... Something similar happens if you have the cursor in the middle of a word (no selection) which looks strange to me. However, I've been testing it and Sublime2 does exactly the same. @peterflynn I've tested your solution and setting |
|
@peterflynn I've already pushed the changes. After reading it again, I think the comment I was quoting refers to the find-next in general, which still works like that. This could also be fixed by setting |
|
@jbalsas: I actually think that comment is no longer correct even before your change, so we should probably just remove it. It originates from a very old version of the file, where it looks like Find and Replace were much more entangled. In more recent versions of the code, findNext() never does any replacement. But we can do that cleanup later -- I'm happy to merge this pull request now. |
Prepopulate Replace input with current editor selection (similar to Find)
Prepopulates the replace input with the current editor selection.
This pull request replaces #1962 following @peterflynn suggestions.