Populate the replace input with the currently selected text#1962
Populate the replace input with the currently selected text#1962jbalsas wants to merge 1 commit intoadobe:masterfrom jbalsas:jbalsas/replace-selected-text
Conversation
There was a problem hiding this comment.
This is now used in QuickOpen and FindInFiles (sort of) other than here. Maybe it would be worth refactoring at some point...
|
Have been missing this functionality badly |
There was a problem hiding this comment.
This doesn't do any escaping, so it could break the HTML if there are quotes/etc. in the string.
Why not do it the same way as _launchFind()? That should work just as well for the Replace dialog. And since _replace() only does anything when there is an Editor available, I think you could ditch getCurrentEditorSelectedText() and follow _launchFind()'s example there too -- i.e. simpler logic for getting the initial string.
There was a problem hiding this comment.
Oh I see... didn't notice that...
I'm closing this pull request then and will submit a new one following your directions soon
Currently, the actions "Find", "Find in Files", "Quick Open" and "Go to Definition" populate their input text with the currently selected text which doesn't happen for the "Replace" action.
I don't know if this is intentional. If not, this fixes it and populates the initial replace input with the current selection.