on master help sign in
Rename play macro to replay macro

Macro needs to be defined first before playing so replay is more accurate. Also, replay have the same length as record which makes it looks nice.

commit9a32617b3093ce6ab3b925d9f1c6b17218c1b491 authorIvan Tham <pickfire@riseup.net> dateSun 12 Dec 2021, 21:51 (5 years ago) parent5326a05
3 files changed+5−5
book/src/keymap.md+1−1 helix-term/src/commands.rs+3−3 helix-term/src/keymap.rs+1−1
book/src/keymap.md+1−1
@@ -78,7 +78,7 @@
7878| `Ctrl-a` | Increment object (number) under cursor | `increment` |
7979| `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
8080| `Q` | Start/stop macro recording to the selected register | `record_macro` |
81−| `q` | Play back a recorded macro from the selected register | `play_macro` |
81+| `q` | Play back a recorded macro from the selected register | `replay_macro` |
8282
8383#### Shell
8484
helix-term/src/commands.rs+3−3
@@ -396,7 +396,7 @@ impl MappableCommand {
396396 increment, "Increment",
397397 decrement, "Decrement",
398398 record_macro, "Record macro",
399− play_macro, "Play macro",
399+ replay_macro, "Replay macro",
400400 );
401401}
402402
@@ -6015,7 +6015,7 @@ fn record_macro(cx: &mut Context) {
60156015 keys.pop();
60166016 let s = keys
60176017 .into_iter()
6018− .map(|key| format!("{}", key))
6018+ .map(|key| key.to_string())
60196019 .collect::<Vec<_>>()
60206020 .join(" ");
60216021 cx.editor.registers.get_mut(reg).write(vec![s]);
@@ -6029,7 +6029,7 @@ fn record_macro(cx: &mut Context) {
60296029 }
60306030}
60316031
6032−fn play_macro(cx: &mut Context) {
6032+fn replay_macro(cx: &mut Context) {
60336033 let reg = cx.register.unwrap_or('@');
60346034 let keys: Vec<KeyEvent> = if let Some([keys]) = cx.editor.registers.read(reg) {
60356035 match keys.split_whitespace().map(str::parse).collect() {
helix-term/src/keymap.rs+1−1
@@ -594,7 +594,7 @@ impl Default for Keymaps {
594594 "P" => paste_before,
595595
596596 "Q" => record_macro,
597− "q" => play_macro,
597+ "q" => replay_macro,
598598
599599 ">" => indent,
600600 "<" => unindent,