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

The kb-macro.repeatPlaybackTillEndOfFile command does NOT have an optional sequence argument #458

Closed
FrancoisMongeau opened this issue Jan 10, 2025 · 8 comments

Comments

@FrancoisMongeau
Copy link

FrancoisMongeau commented Jan 10, 2025

Near the bottom of the ReadMe, it says:

The kb-macro.playback command has an optional sequence argument to specify a 
command sequence to playback instead of the last recorded sequence.

If I use kb-macro.repeatPlaybackTillEndOfFile binded to a shortcut key (eg Ctrl-Shift-Alt-s) in keybindings.json (see example below), the argument sequence is ignored (or seems to be ignored) and it is the last macro that I recorded that is executed.

   {
      "key": "ctrl+shift+alt+s",
      "command": "kb-macro.repeatPlaybackTillEndOfFile ",
      "args": {
          "sequence": [
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "cursorRightSelect" },
              { "command": "deleteRight" },
              { "command": "cursorRight" },

I understand the kb-macro.repeatPlaybackTillEndOfFile does not support this argument, am I right? Could it?

I tried a work around, but it does not work as I expected:
If I use kb-macro.playback binded to the shortcut key, the arg sequence is played. Good. Now if I hit Ctrl-Shift-P and select Repeat Playback Till End Of File from the drop down, it plays back the last macro I recorded, not the macro I just executed.

So, I see two possible improvements:
1 Support argument sequence in kb-macro.repeatPlaybackTillEndOfFile.
2 When using Ctrl-Shift-P and select Repeat Playback Till End Of File it should run the last macro that was executed, not the last macro that was recorded. Or add kb-macro.repeatLastPlaybackTillEndOfFile?

@tshino
Copy link
Owner

tshino commented Jan 10, 2025

Thank you for pointing out that! You are correct.

I think your first suggestion is good 👍. I will work on that later.

The second suggestion sounds interesting, but let me think about it.

@tshino
Copy link
Owner

tshino commented Jan 10, 2025

The command names 'Repeat Playback' and 'Repeat Playback Till End of File' were a bit misleading indeed.
They repeatedly perform playback of the last recorded macro. It does not repeat the last playback.

Changing the behavior of an existing command without introducing any new argument is not good. Creating a new command is better.

Thinking about use cases of performing last performed playback, I think we may want to have all three types of new playback commands:

  1. perform the last playback once again
  2. perform the last playback N times repeatedly
  3. perform the last playback repeatedly till the end of the file

@FrancoisMongeau
Copy link
Author

I totally agree. As I suggested, possibly something like kb-macro.repeatLastPlaybackTillEndOfFile?
I really like this product so far. I find it easy to use and the learning curve is not steep. Thanks for your work.
What is the long term plan/vision? How can I help?

@tshino
Copy link
Owner

tshino commented Jan 13, 2025

It is easy to imagine having a set of shortcut keys in the keybindings.json for easy daily coding or something. Some would map to a single command. Others would map to the playback command since each is a sequence of multiple commands.
Then I came to a question. What is the expectation for 'perform the last playback'?
It may make sense if one has an intended set of candidates for 'the last playback'. Then it is better to mark the candidate playbacks explicitly to distinguish them from other random shortcut keys.

@FrancoisMongeau
Copy link
Author

Apologies: I do not understand the question.

@tshino
Copy link
Owner

tshino commented Jan 14, 2025

Sorry for the confusion. I didn't mean to ask you a question; I was just wondering. I want to make this extension as useful for people as possible without introducing unnecessary features.

@tshino
Copy link
Owner

tshino commented Feb 15, 2025

Hi, I selected the first one from your two ideas. The release v0.14.0 has that as a new feature.
I decided not to make the 'repeat the last playback' feature since it seems hard to understand what it does or when to use it.

Thank you for great suggestions!

@tshino tshino closed this as completed Feb 15, 2025
@FrancoisMongeau
Copy link
Author

Thanks @tshino ! I will try asap and let you know how it goes.

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

No branches or pull requests

2 participants