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