Find/replace for current procedure only

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Find/replace for current procedure only

Post by BarryG »

I'd love to have an IDE find/replace option for the current procedure only. Quite often I need to change something in a large procedure (several screens long, and I'm in the middle of it), and it's a pain to manually scroll up to the start of it (and lose my cursor position) and then select it all while scrolling back down to the end of it; just so I can tick "Search inside selection only". Thanks.

[Edit] Just had to search for a variable in a long procedure, and it wasn't there, so the cursor jumped way down else somewhere in my source to the first match. I know I can jump back with a hotkey, but it would be nice just to Find in the current procedure as well.
Last edited by BarryG on Tue Nov 14, 2023 5:53 am, edited 3 times in total.
AZJIO
Addict
Addict
Posts: 1318
Joined: Sun May 14, 2017 1:48 am

Re: Find/replace for current procedure only

Post by AZJIO »

like ctrl+m to select a block
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Find/replace for current procedure only

Post by BarryG »

I never knew about Ctrl+M, wow! That's a good tip. But it doesn't necessarily select all of a procedure's code (like when you're the middle of an If/Then block), so my request still stands.
AZJIO
Addict
Addict
Posts: 1318
Joined: Sun May 14, 2017 1:48 am

Re: Find/replace for current procedure only

Post by AZJIO »

you can click the hotkey a second time to select the code to a higher level
BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: Find/replace for current procedure only

Post by BarryG »

Nice! But I have lots of nested blocks, and it changes the cursor position to the top of each new selected block. So my request still stands.
Quin
Enthusiast
Enthusiast
Posts: 282
Joined: Thu Mar 31, 2022 7:03 pm
Location: United States
Contact:

Re: Find/replace for current procedure only

Post by Quin »

+1
PB v5.40/6.10, Windows 10 64-bit.
16-core AMD Ryzen 9 5950X, 128 GB DDR5.
Post Reply