Open kwinso opened 2 years ago
What was the macro?
What was the macro?
Is there a way to copy macro's key sequence? (I recorded it into separate register)
You can paste out the contents of a register by pressing " then the key for the register (kbd>@</kbd by default for macros) and then p then copy that to the clipboard
This is my macro (I commands separated with newlines so it's more clear what's going on):
i
# type: INSERT INTO
<S-I><S-N><S-S><S-E><S-R><S-T><space><S-I><S-N><S-T><S-O>
# type 'table(uuid, name)" and then skip autoclosed bracket with "li"
<space>table(uuid,<space>name<esc>li
<space>values(gen_random_uuid(),
# Remove auto-closed bracket, go to the end of the line to remove trainling ","
# because I operated with a list of single-qouted strings separated by ",\n"
<space><esc>d<S-A><backspace>)
<space>on<space>conflict<space>(name<esc>li<space>do<space>nothing;<esc>
# Go to begging of next line
jgh
Just tried it, 40 repetitions take around 3 seconds.
It takes a lot of time because a lot of keypresses are executed. I think we can improve the performance by not re-rendering after every command though: https://github.com/helix-editor/helix/blob/c4d7cde6c8d7f5ca3a9cabd50bdfbda9c3f7bb15/helix-term/src/commands.rs#L4964-L4966 ui::Editor should not re-render while macro_replaying
Summary
I'm using helix v22.08.1. When using relatively long macro with a lot of lines, execution of macros freezes the editor completely. Only killing the process helps. Even 20 repetitions freeze editor for like 2 seconds.
Reproduction Steps
The macro:
Helix log
No response
Platform
Linux
Terminal Emulator
Alacritty, latest release
Helix Version
helix 22.08.1