Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro interface needs rework #3756

Closed
hiiamboris opened this issue Oct 3, 2021 · 22 comments
Closed

Macro interface needs rework #3756

hiiamboris opened this issue Oct 3, 2021 · 22 comments

Comments

@hiiamboris
Copy link

hiiamboris commented Oct 3, 2021

I'm going to use Mikromir - a DOS editor of the 80s-90s as reference, as it had well thought out macro system: both powerful and convenient, and still blows all known editors out of the water.

It was possible there to:

  • Press Shift+F7 to start recording, then Shift+F7 to stop recording. Macro was saved for use on F7 key.
  • Do exactly the same process for F8 key. Thus you had 2 macro keys that could invoke each other.
  • And there was another 10 shortcuts, but those were very rarely needed.
  • Repeat macro, e.g. pressing Esc 1 0 0 0 0 F7 would execute F7 macro 10000 times, almost instantaneously. It also could do that for every command bound to a key combo, but it were macros where this feature was the most useful.

So popular now multi-caret editing is nothing more than a limited version of what one can do with macros, and in the same amount of time/effort. The only advantage of multi-caret editing is that it shows the intermediate results after each key, while macros show the result after whole macro is finished. But macros have other advantages over it:

  • ability to search for text inside the macro sequence
  • ability to call other macros and editor commands (e.g. move the focus into other tab, copy something from there, get back and paste here)
  • no limit on number of lines or how far they stay apart (go try multi-caret editing if lines you edit do not fit the screen)

Cuda has a lot of this. And I'm not asking for the Esc 1 0 0 0 0 thing. Although it would make Cuda stand out ;)
But ability to record and replay macro quickly is totally missing. There should be something like Replay last macro.

Also it is basically a standard since those years that the same key that starts macro recording also ends it. Whether cancel is needed or not I can't tell, but I never ever used it. Cancelling is usually done by stopping the recording and simply not saving it (Esc).


The above is excessive and confusing:

  • when not recording, cancel & stop make no sense
  • when recording, start makes no sense
  • no indication of current state is shown anywhere (are we recording, Cap'n?)

I propose at the very minimum to:

  • have start/stop macro recording a single command, so it can be assigned to a single key combo
  • after macro recording stops, save it silently into the last recorded slot, so it can be played back and no fuss with dialog boxes is required
  • have replay last macro command that can also be assigned a key combo
@Alexey-T
Copy link
Owner

Alexey-T commented Oct 4, 2021

Okay,

  • change: command "macros: start recording" was renamed and now it starts+stops the recording; 2 commands "macros: stop recording" and "macros: cancel recording" are deprecated and removed from Command Palette

Plugin Macros will be updated later when this Cud will be released.

@Alexey-T
Copy link
Owner

Alexey-T commented Oct 4, 2021

Some indication of recording is already here (pale font statusbar msg)
Screenshot from 2021-10-04 13-09-11

@Alexey-T
Copy link
Owner

Alexey-T commented Oct 4, 2021

we need to wait some time (weeks?) until @kvichans will be free from work and see it.

@Alexey-T
Copy link
Owner

Alexey-T commented Oct 4, 2021

Added border indication for 'macro recording' state. (color of 'markers' is used).

Screenshot from 2021-10-04 18-11-39

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 24, 2021

@kvichans
I already made

1.146.2 (2021/10)

  • change: command "macros: start recording" was renamed and now it starts+stops the recording; 2 commands "macros: stop recording" and "macros: cancel recording" are deprecated and removed from Command Palette

Can you now remove usage of these 2 deprecated commands in Macros-plg? And simplify Macros plg menu?

@hiiamboris
Copy link
Author

Can you add 'play last macro' command too? (regardless if saved or not)

@Alexey-T
Copy link
Owner

Cuda has a lot of this. And I'm not asking for the Esc 1 0 0 0 0 thing. Although it would make Cuda stand out

Cud can run any macro N times, via the Macros dialog, it's has more flexible settings, not only the counter.
So I dont think Micromir is better here.

But ability to record and replay macro quickly is totally missing. There should be something like Replay last macro.

Cud can replay last macro-- you enter name after the recording, then you run that macro name.
do we really need a new command 'replay last macro'?

Whether cancel is needed or not I can't tell, but I never ever used it. Cancelling is usually done by stopping the recording and simply not saving it (Esc).

Macros-plg is updated today. it now has the single command 'start/stop recording'.

@hiiamboris
Copy link
Author

Cud can run any macro N times, via the Macros dialog, it's has more flexible settings, not only the counter. So I dont think Micromir is better here.

Esc 1 0 0 is just 4 keys. About one second to type.
Opening the macro dialog then finding the macro there, entering desired number and clicking Run is idk how much trouble, but way too much to use it ;)

Clearly you're not thinking about UX here :)

Cud can replay last macro-- you enter name after the recording, then you run that macro name. do we really need a new command 'replay last macro'?

That's what I'm doing exactly. Recording, stopping, typing !1 to save it, then macro 1 is bound to a key. But it's obviously extra effort: I'm fighting the design of macro plugin by doing this. Good design would not need me to.

@Alexey-T
Copy link
Owner

Alexey-T commented Nov 26, 2021

Okay: I am adding new command to plugin, 'play last recorded macro';
it is in my fork
https://github.com/Alexey-T/cuda_macros/tree/patch-1
branch 'patch1'.

@hiiamboris
Copy link
Author

Nice!

@Alexey-T
Copy link
Owner

Plugin Macros will be updated soon. issue solved.

@hiiamboris
Copy link
Author

hiiamboris commented Nov 26, 2021

@Alexey-T when I delete some macro, all the hotkeys bound to macros after get rebound to macro at a new position in the Macros menu. Total mess. Pls look into this too.

It also spams me with index out of bounds error 127 now that I try to rebind the key from Macros/Config.

@hiiamboris
Copy link
Author

This is my command palette now:

I think I broke Cuda :(

@Alexey-T Alexey-T reopened this Nov 26, 2021
@Alexey-T
Copy link
Owner

Alexey-T commented Nov 26, 2021

I think my patch broke the plugin, not Cuda.
Pls try the old version---->
plugin.Macros.zip
Ie, open zip file in Cud.

when I delete some macro, all the hotkeys bound to macros after get rebound to macro at a new position in the Macros menu. Total mess. Pls look into this too.

Is this a regression after I made the patch / or old version has it?

@Alexey-T
Copy link
Owner

I made a little fix to my patched version, it helped?
cuda_macros-patch-2.zip
Open .zip file in Cud.

@hiiamboris
Copy link
Author

Nope I don't think so.

@hiiamboris
Copy link
Author

bindings restore after restart, but just after macro deletion they're messed up

@Alexey-T
Copy link
Owner

Pls see #3756 (comment)
Is this a regression of my change/fix?

@hiiamboris
Copy link
Author

hiiamboris commented Nov 26, 2021

I'm a bit lazy to find out if it's a regression or not ;)
I don't delete macros often. Just did this time and met this issue.

Just create some macros, bind them to keys, then delete one of the first macros and try keys again - they execute wrong macros.

@Alexey-T Alexey-T added API bug and removed API labels Nov 26, 2021
@Alexey-T
Copy link
Owner

The initial issue was solved, closing;
and Macros bug with deletions - I posted it to #3845 .

@Alexey-T
Copy link
Owner

#3845 was solved, please test new release.

@hiiamboris
Copy link
Author

works fine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants