+3

Find All within selection

David Baumgold fa 13 anys 0
The situation: I want to copy a function and change a few variable names and function calls in the copied version. I'm using Vintage mode, so I can just use the Vim keystrokes to easily select the function in Visual mode, yank it, and paste it below. Next, I want to do a search/replace, but *only* within the context of the copied function, so I select the copied function using Visual mode, press "/" or "Cmd-F" to bring up the search box, type in the word I want to find, and then press Alt-Enter, intending for it to match within the context of the selected text. Instead, it matches across the whole file. (If it matched correctly, I could use ST2's multiple selection/cursors feature to easily replace the way I want.)

Can you add a feature to restrict search to within a selection?