<http://forum.pspad.com/read.php?f=2&i=10804&t=10804>
----------------------------------------------------------------
After using PSPad for a while, I'm feeling that autocompletion feature
lacks some important action.
Currently, if you write
==============
tmpfile ();
==============
in the .DEF file under [Keywords] section, you can use Ctrl+J to complete
that specific string easily.
But, in many cases, I (and many others) hope to extend this functionality.
Let's say I want to complete the following piece of code:
=============
class Person {
=============
to be like:
=============
class Person {
// with two space in this line and cursor on the third blank
position to make editing easier.
}
=============
after press Enter.
How can we do that?
I think it is not really difficult. I mean I'm suggesting using regular
expression in the Keywords section or in a new section.
So, for example, in a .DEF file, we can define a simple regular expression
line:
=============
/(^\s)*class\s([a_zA_Z]+)\s?{/ $1class\s$2\s{\n
\c\n}
=============
Here, first string represents a piece of code, and the second string
represents a string that should be replaced with.
IMPORTANT: in the second string "\c" represents the curser position (if
this has special meaning in regular expression, we can use other simbol
like "\[" or something).
I don't know whether there is a free regular expression engine out there
in the OSS. If there is, then this feature is good to add and I think (and
I hope) that it is not difficult to add.
Making a good regular expression is up to user or some people who is eager
to contribute PSPad's functionality.
Personally, I really want to see this feature in the future release of
PSPad.
--
PSPad freeware editor http://www.pspad.com