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

Feature-Request: Start and Repeat Makro until end of document #34

Closed
trx222 opened this issue Jan 12, 2022 · 12 comments
Closed

Feature-Request: Start and Repeat Makro until end of document #34

trx222 opened this issue Jan 12, 2022 · 12 comments
Labels
enhancement New feature or request

Comments

@trx222
Copy link

trx222 commented Jan 12, 2022

Hi and thank you for your work on this plugin. I waited long time for it ;)

Now comes the wishes: I often record a macro to manipulate imports an scripts - the I have to replay a makro für every line, so I also record the "cursor down to next line". It would be great of I can replay the makro until the end on document with an extra shortcut.

Maybe with some savety checks the the makro knows if it will not reach the end and escape then.

best regards

@tshino
Copy link
Owner

tshino commented Jan 12, 2022

Thank you for your request! I'm very happy to hear a request like this.

I would like to try to implement this feature.
I think some text editor has the same feature, but I don't know the editor's name.
If you know, could you please tell me the names of such text editors?
And if they are included in the keymap wrappers, I will assign the original keybindings for the new command for those editors.

Also, I think if I could know some information about the existing editor's feature and/or test its behavior, it will help me to design the feature and especially the safety logic you mentioned.
Anyway, I think I can implement it.

Thanks.

@tshino tshino added the enhancement New feature or request label Jan 12, 2022
@trx222
Copy link
Author

trx222 commented Jan 12, 2022

Hi tshino, long time ago, as windows user, I used "textpad" ( https://www.textpad.com/ ) what have this feature. Now I am on mac and for my macros I use a windows emulation just for this tool ;)
I am a developer to, maybe i find some time then I will also check your code ... But I never build any plugins or so ...

@tshino
Copy link
Owner

tshino commented Jan 12, 2022

Thank you for the info and for offering to check my code!

And now, I'm very happy to know the fact that a mac user is using this extension. That means this extension is working on mac. In fact, I have never tested it on mac myself, though the automated test on CI is running on Windows, Linux, and macOS as well.
😁

@trx222
Copy link
Author

trx222 commented Jan 12, 2022

It works great for me 👍🏼

@tshino
Copy link
Owner

tshino commented Jan 16, 2022

Hi @trx222, I have just implemented the feature and created a Pull Request.
If you have time, could you take a look at that perhaps at least the description?

If you want to try it your own, the steps would be: (I don't know much about mac though)

  • clone this repo and checkout the branch of the PR
  • npm install
  • launch vscode (code .)
  • in the Run and Debug, select Run Extension, and run it.

Any comments or requests are welcome.
Thanks.

@trx222
Copy link
Author

trx222 commented Jan 16, 2022

Hi @tshino - cool, I will try it tomorrow!

@trx222
Copy link
Author

trx222 commented Jan 17, 2022

Can you guide me how I can test the new command then ? I have it running but have no shortcut for the new command ...

@tshino
Copy link
Owner

tshino commented Jan 18, 2022

Yes. The new command doesn't have a shortcut yet. You should use Command Palette and search like 'macro repeat til'.
What key would you recommend to assign to the command as default?

@trx222
Copy link
Author

trx222 commented Jan 18, 2022

Ok, I checked the keymap editor and didn't found the new one.
I am relative new to vsc ( because the missing macro functionality :-D ) so I don't know if I can say which keymap is good and not already used to something important. If possible I would recommend to use an additional modifier key to replay like SHIFT+CTRL+ALT+P

@tshino
Copy link
Owner

tshino commented Jan 18, 2022

Let's see step by step.

If you have successfully cloned the repo and checked out the branch, you should find some new files like src/end_of_file_detector.js.
image

If you have successfully run the extension, another vscode instance will be launched, and on the new vscode instance you should be able to find the new command named Keyboard Macro: Repeat Playback Till End of File.
image

You can find the new command both in Command Palette (cmd+shift+p) and in Keyboard Shortcuts (cmd+k cmd+s).
image
image

@tshino
Copy link
Owner

tshino commented Jan 26, 2022

Since it works for me, now I will merge the pull request.
And I start to prepare for the next release.

@tshino
Copy link
Owner

tshino commented Feb 1, 2022

I have published v0.10.0 which includes this feature.
The new command is available at Command Palette (Ctrl+Shift+P or Cmd+Shift+P for mac).

It doesn't have a default keyboard shortcut, but I think it is not so big a problem.
Users can assign it to an arbitrary keystroke.
Since this extension may be used by users with a variety of different keymaps, adding a new shortcut key may cause conflicts possibly for some users. So I think we should keep default keyboard shortcuts as fewest as possible.

Again, thank you for your request for this great new feature!

@tshino tshino closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants