Skip to content

Commit

Permalink
dev/refactoring register commands (#1815)
Browse files Browse the repository at this point in the history
* Move the text register commands to command classes

* Rename text register commands and contexts following the original Emacs command names

* Add messages

* Fix copyToRegister to set a new mark
  • Loading branch information
whitphx committed Jan 13, 2024
1 parent 6d788d8 commit c7c0053
Show file tree
Hide file tree
Showing 7 changed files with 624 additions and 966 deletions.
10 changes: 5 additions & 5 deletions keybinding-generator/generate-keybindings.mts
Original file line number Diff line number Diff line change
Expand Up @@ -311,18 +311,18 @@ export function generateKeybindingsForRegisterCommands(): KeyBinding[] {
for (const char of asciiPrintableChars) {
keybindings.push({
key: char,
when: "emacs-mcx.inRegisterSaveMode && editorTextFocus",
command: "emacs-mcx.RegisterSaveCommand",
args: [char],
when: "emacs-mcx.inRegisterCopyMode && editorTextFocus",
command: "emacs-mcx.copyToRegister",
args: char,
});
}

for (const char of asciiPrintableChars) {
keybindings.push({
key: char,
when: "emacs-mcx.inRegisterInsertMode && editorTextFocus",
command: "emacs-mcx.RegisterInsertCommand",
args: [char],
command: "emacs-mcx.insertRegister",
args: char,
});
}
return keybindings;
Expand Down
4 changes: 2 additions & 2 deletions keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,12 +758,12 @@
},
{
"key": "s", // ctrl+x r s
"command": "emacs-mcx.StartRegisterSaveCommand",
"command": "emacs-mcx.startRegisterCopyCommand",
"when": "emacs-mcx.acceptingRectCommand && editorTextFocus"
},
{
"key": "i", // ctrl+x r i
"command": "emacs-mcx.StartRegisterInsertCommand",
"command": "emacs-mcx.startRegisterInsertCommand",
"when": "emacs-mcx.acceptingRectCommand && editorTextFocus"
},
{
Expand Down
Loading

0 comments on commit c7c0053

Please sign in to comment.