Page 1 of 1

search only in current function

PostPosted: Wed May 14, 2014 11:25 am
by stefanoni
Is this possible, to search for something, but only in the actual function ?
I meen betwean the current Cursorposition until the last "}" endfunction-sign.


Screen Shot 05-14-14 at 11.19 AM.JPG
Screen Shot 05-14-14 at 11.19 AM.JPG (54.62 KiB) Viewed 3210 times

Re: search only in current function

PostPosted: Wed May 14, 2014 2:45 pm
by lopamudram
Hello Stefanoni,

Yes, this is possible. There are quite a few options which can search within current scope if you can select the word in that scope.

- Select or double click a word within a function, it will select (grey background) all the occurrences for the word in the function or scope.
- Select a word then press "Ctrl + Shift + G". Else right click on selection and select Search->References->Workspace.

Most of the time I need to search a element inside function to rename a variable or parameter, for which:
- Select the word then use shortcut "Shift + Alt + R". Else right click on selected word select refactor->rename.

Hope this helps.

Thanks,
Lopamudra
lopamudram@mindfiresolutions.com

Re: search only in current function

PostPosted: Thu May 15, 2014 7:43 am
by stefanoni
Thank you Lopamudra,

You showed me many possibilities. Maybe I should really try to change old habits and wishes.
:-)

My Idea was:
- CTRL + F (open search)
- type some searchstring
- ENTER ENTER ENTER lets me jump to all this occurrences,
but never out of the current function.

What I do now, I copy a view searchstrings (relevant var- / func-names )
to the very end of the function and then start working like described above.