fpjohnston / TECO-64

Enhanced and portable version of TECO text editor in C.
24 stars 6 forks source link

Macros seem not to work as expected #16

Open mcctuxic opened 6 months ago

mcctuxic commented 6 months ago

I am sure, this is a definitely a bug, but I am completely unsure, whether it is my bug or a slight glitch in teco.

From the command line from within teco:

@^Uv/5,7:w`-w`/``

and executed via

mv``

works fine. Putting the same into init.tec results in this error message:

?ILL   Invalid command '<^P>'
[1]    7897 exit 1     teco-64
mcctuxic commented 6 months ago

Ok...got an answer and another issue...

One may get this working, when inserting the raw ESCAPE character (0x1B) for the '`'. But that's ugly, because normally this character is not shown when listing the containing file.

BUT! Teco-64 is a modern implementation of TECO, the other standard editor :)

One can put commands into a Q-register (that is: writing a macro) by simply using the @-modifier like this:

@^UQ{
    ...
    ...
    ...
}

"Q" is the name of the Q-register ("Q" in this case) and "..." stands for one complete command each.

BUT! There seems to be a bug. When creating a macro like this:

@^UV{
  5,7:w
  -w
}

and execute this macro from within TECO-64 I get

?DPY   Display mode error
fpjohnston commented 6 months ago

Okay. I'll chase it down. Thanks for letting me know.