Hi there,
I'm using p9p's acme, and I would like to take a piece of code and change, for example this:
int main(int argc, char *argv[]) {
For this:
int main(int argc, char *argv[])
{
So, for doing that, I thought about using some regexps and the Edit command.
I would like to work with some generic regexp, so I wrote the following:
Edit , x/^[^ ]+[ ]*[^(]*\([^)]*\)[ ]*\{[ ]*$/ s/[ ]*{[ ]*$/\n{/g
By the man, the x command, under sam(1) does execute the command after the x. Also, we
have to use \n, instead of a real newline.
AFAICT, these two commands work, separatedly. Using the first one prints me the whole
set of function definitions, and using the s// when selecting the line that holds something like:
blah blah (blah blah) {
Does indeed change that for:
blah blah (blah blah)
{
But when used together, this command doesn't work. Could please someone provide
me with some insight on why this doesn't work? Thanks a lot.
(Sorry for the blah)