IDE Wish: Replace All Up To...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

IDE Wish: Replace All Up To...

Post by Tenaja »

I often reuse local variable names, such as Counter. I wish there was a way to "Replace All" but have it stop at a certain line number. This would allow changing all local vars in just one Procedure, but not all of them. Sometimes you use that Counter var many times in one Proc, and this would make renaming it a lot faster.

Thanks!
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: IDE Wish: Replace All Up To...

Post by TomS »

Better: Replace all within the selected text.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: IDE Wish: Replace All Up To...

Post by freak »

TomS wrote:Better: Replace all within the selected text.
There is a checkbox for that right in the Find/Replace dialog ;)
quidquid Latine dictum sit altum videtur
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: IDE Wish: Replace All Up To...

Post by skywalk »

@freak
Have you considered adding a switch for just the text in a Procedure?
This way I don't have to select stuff before doing the search and replace.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Michael Vogel
Addict
Addict
Posts: 2798
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: IDE Wish: Replace All Up To...

Post by Michael Vogel »

A shortcut (Alt+S) could be fine, as Alt+R should set the replace check and jump into the text field, Alt+A should do the same like pressing the 'replace all' button etc.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: IDE Wish: Replace All Up To...

Post by MachineCode »

skywalk wrote:Have you considered adding a switch for just the text in a Procedure?
+1

Also, a keyboard shortcut to select the entire procedure where the cursor is, would be fantastic.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: IDE Wish: Replace All Up To...

Post by Tenaja »

freak wrote:
TomS wrote:Better: Replace all within the selected text.
There is a checkbox for that right in the Find/Replace dialog ;)
...this checkbox is all but useless, and totally sucks, since the dialog box disappears after the first search. If you want to continue, you have to re-highlight all of the same text. This useless "feature" actually highlights the need for Search Up To Line #.

...now, if the dialog box did NOT disappear, and the highlighting remained, the tone of this post would be entirely different!!! (And yes, a dialog box like this can be implemented; Notepad++ is a nice example.)
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: IDE Wish: Replace All Up To...

Post by MachineCode »

Tenaja wrote:...this checkbox is all but useless, and totally sucks, since the dialog box disappears after the first search. If you want to continue, you have to re-highlight all of the same text.
What have you been smoking? The dialog box STAYS OPEN and the highlighted text REMAINS highlighted after a replace!

I just re-tested it to make sure I wasn't mistaken, and yes, I could change the matches in the hightlighted text over and over, without the box closing or the highlights being lost. Don't know why it ain't working for you.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
TomS
Enthusiast
Enthusiast
Posts: 342
Joined: Sun Mar 18, 2007 2:26 pm
Location: Munich, Germany

Re: IDE Wish: Replace All Up To...

Post by TomS »

freak wrote:There is a checkbox for that right in the Find/Replace dialog
Ah, yes. I was too quick to post...
MachineCode wrote:The dialog box STAYS OPEN
Yes it does (if you use "Replace All")
MachineCode wrote:highlighted text REMAINS highlighted after a replace!
No it doesn't.
Post Reply