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.
This commit is contained in:
Ivan Tham 2021-12-12 21:51:57 +08:00 committed by Blaž Hrastnik
parent 5326a05117
commit 9a32617b30
3 changed files with 5 additions and 5 deletions

View File

@ -78,7 +78,7 @@ ### Changes
| `Ctrl-a` | Increment object (number) under cursor | `increment` |
| `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
| `Q` | Start/stop macro recording to the selected register | `record_macro` |
| `q` | Play back a recorded macro from the selected register | `play_macro` |
| `q` | Play back a recorded macro from the selected register | `replay_macro` |
#### Shell

View File

@ -396,7 +396,7 @@ pub fn doc(&self) -> &str {
increment, "Increment",
decrement, "Decrement",
record_macro, "Record macro",
play_macro, "Play macro",
replay_macro, "Replay macro",
);
}
@ -6015,7 +6015,7 @@ fn record_macro(cx: &mut Context) {
keys.pop();
let s = keys
.into_iter()
.map(|key| format!("{}", key))
.map(|key| key.to_string())
.collect::<Vec<_>>()
.join(" ");
cx.editor.registers.get_mut(reg).write(vec![s]);
@ -6029,7 +6029,7 @@ fn record_macro(cx: &mut Context) {
}
}
fn play_macro(cx: &mut Context) {
fn replay_macro(cx: &mut Context) {
let reg = cx.register.unwrap_or('@');
let keys: Vec<KeyEvent> = if let Some([keys]) = cx.editor.registers.read(reg) {
match keys.split_whitespace().map(str::parse).collect() {

View File

@ -594,7 +594,7 @@ fn default() -> Keymaps {
"P" => paste_before,
"Q" => record_macro,
"q" => play_macro,
"q" => replay_macro,
">" => indent,
"<" => unindent,