Mark macros as experimental in docs

Given that currently macro does not integrate well with registers and
the internal representation of macros is expected to be changed.
imgbot
Ivan Tham 3 years ago committed by Blaž Hrastnik
parent 9a32617b30
commit b9cb3930e2

@ -46,39 +46,39 @@
### Changes ### Changes
| Key | Description | Command | | Key | Description | Command |
| ----- | ----------- | ------- | | ----- | ----------- | ------- |
| `r` | Replace with a character | `replace` | | `r` | Replace with a character | `replace` |
| `R` | Replace with yanked text | `replace_with_yanked` | | `R` | Replace with yanked text | `replace_with_yanked` |
| `~` | Switch case of the selected text | `switch_case` | | `~` | Switch case of the selected text | `switch_case` |
| `` ` `` | Set the selected text to lower case | `switch_to_lowercase` | | `` ` `` | Set the selected text to lower case | `switch_to_lowercase` |
| `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` | | `` Alt-` `` | Set the selected text to upper case | `switch_to_uppercase` |
| `i` | Insert before selection | `insert_mode` | | `i` | Insert before selection | `insert_mode` |
| `a` | Insert after selection (append) | `append_mode` | | `a` | Insert after selection (append) | `append_mode` |
| `I` | Insert at the start of the line | `prepend_to_line` | | `I` | Insert at the start of the line | `prepend_to_line` |
| `A` | Insert at the end of the line | `append_to_line` | | `A` | Insert at the end of the line | `append_to_line` |
| `o` | Open new line below selection | `open_below` | | `o` | Open new line below selection | `open_below` |
| `O` | Open new line above selection | `open_above` | | `O` | Open new line above selection | `open_above` |
| `.` | Repeat last change | N/A | | `.` | Repeat last change | N/A |
| `u` | Undo change | `undo` | | `u` | Undo change | `undo` |
| `U` | Redo change | `redo` | | `U` | Redo change | `redo` |
| `Alt-u` | Move backward in history | `earlier` | | `Alt-u` | Move backward in history | `earlier` |
| `Alt-U` | Move forward in history | `later` | | `Alt-U` | Move forward in history | `later` |
| `y` | Yank selection | `yank` | | `y` | Yank selection | `yank` |
| `p` | Paste after selection | `paste_after` | | `p` | Paste after selection | `paste_after` |
| `P` | Paste before selection | `paste_before` | | `P` | Paste before selection | `paste_before` |
| `"` `<reg>` | Select a register to yank to or paste from | `select_register` | | `"` `<reg>` | Select a register to yank to or paste from | `select_register` |
| `>` | Indent selection | `indent` | | `>` | Indent selection | `indent` |
| `<` | Unindent selection | `unindent` | | `<` | Unindent selection | `unindent` |
| `=` | Format selection (currently nonfunctional/disabled) (**LSP**) | `format_selections` | | `=` | Format selection (currently nonfunctional/disabled) (**LSP**) | `format_selections` |
| `d` | Delete selection | `delete_selection` | | `d` | Delete selection | `delete_selection` |
| `Alt-d` | Delete selection, without yanking | `delete_selection_noyank` | | `Alt-d` | Delete selection, without yanking | `delete_selection_noyank` |
| `c` | Change selection (delete and enter insert mode) | `change_selection` | | `c` | Change selection (delete and enter insert mode) | `change_selection` |
| `Alt-c` | Change selection (delete and enter insert mode, without yanking) | `change_selection_noyank` | | `Alt-c` | Change selection (delete and enter insert mode, without yanking) | `change_selection_noyank` |
| `Ctrl-a` | Increment object (number) under cursor | `increment` | | `Ctrl-a` | Increment object (number) under cursor | `increment` |
| `Ctrl-x` | Decrement object (number) under cursor | `decrement` | | `Ctrl-x` | Decrement object (number) under cursor | `decrement` |
| `Q` | Start/stop macro recording to the selected register | `record_macro` | | `Q` | Start/stop macro recording to the selected register (experimental) | `record_macro` |
| `q` | Play back a recorded macro from the selected register | `replay_macro` | | `q` | Play back a recorded macro from the selected register (experimental) | `replay_macro` |
#### Shell #### Shell

@ -6031,6 +6031,7 @@ fn record_macro(cx: &mut Context) {
fn replay_macro(cx: &mut Context) { fn replay_macro(cx: &mut Context) {
let reg = cx.register.unwrap_or('@'); let reg = cx.register.unwrap_or('@');
// TODO: macro keys should be parsed one by one and not space delimited (see kak)
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() {
Ok(keys) => keys, Ok(keys) => keys,

Loading…
Cancel
Save