Autoreplace

EvROCS

Member²
(Version: 9.0.2.1621)
I love the autoreplace function.

I prefer using it with 'special characters' (like * and ^) for two reasons:
1. to make sure an alias is only autoreplaced if it's followed by this character
for example: "for*" will be replaced by a for-loop construction, but "for" will not.
2. to make a distinction between different types of replacement text.
for example:
typing tablealias abc* will be replaced by "select abc.* from my_abc_table abc;"
typing tablealias abc^ will be replaced by "my_abc_table abc"

Now I find that only a few special characters work with autoreplace.
So far only * and ^ seem to work.
If for example I have an entry
cnt_ = select count(*) from

The string cnt_ does not get replaced. If I change the underscore into an asterisk or a carrot it does.

Am I doing something wrong?

Furthermore:
Following advise in another thread, I have also tried turning of autoreplace in the preferences, and assigning a shortcut-key to "Editor: Autoreplace".
For me, this would be a very acceptable way to handle reason 1. (In fact I would love to use it this way)
However,
In the program-window that was open when I went to preferences all works as expected: no automatic autoreplace, hitting the shortcut key initiates a replace.
But when I close that program window and open a new one, still no automatic autoreplace (as expected) but no reaction to the shortcut key either. All other customized key's work perfectly.
Does anyone know why?

Erik van Roon
 
Thanks for the reply, Marco.

Do I understand correctly that my issues are not due to my own stupidity, and that you where able to reproduce them?
 
We have not yet been able to reproduce this. All seems to work fine. We're still looking into this though.
 
Would it help if I send you my autoreplace.txt?
I mean, if you can't reproduce it, it implies that there might be something wrong on my end.
 
Problem partially solved

The issue with autoreplace only accepting * and ^ as special characters was due to my stupidity.
My autoreplace.txt had entries like "alias* = replacement text".
Removing the whitespace on both sides of the equal sign makes plsql developer accept other characters then just * and ^.
My bad! The examples in the manual clearly show no whitespace on either side of the equal sign.
Still, weird that when whitespace is included, it does work with * and ^. But that's not a bug.

The other problem, with the shortcut key for autoreplace, still exists.
 
About the second issue (shortcut key not working):

As long as "Tools - Preferences - User interface - Editor - Autoreplace - Enabled" is checked the key for autoreplace (CTRL-\) works flawlessly.
When I uncheck the mentioned checkbox, CTRL-\ still performs a replace in all allready open program windows, but NOT in any new program window
 
Back
Top