From e96b269e72c34254e848811eca1633a1013ab55d Mon Sep 17 00:00:00 2001 From: Dustin Lacewell Date: Fri, 24 Aug 2012 15:37:50 -0500 Subject: [PATCH] now works correctly with the kill-ring --- base-keymap.json | 2 +- emax_commands.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/base-keymap.json b/base-keymap.json index 86b9a21..cd519f7 100644 --- a/base-keymap.json +++ b/base-keymap.json @@ -182,7 +182,7 @@ "args": { "forward": true }, - "command": "delete_word" + "command": "emax_delete_word" }, { "keys": ["meta+backspace"], diff --git a/emax_commands.py b/emax_commands.py index 0be0e1b..94baac3 100644 --- a/emax_commands.py +++ b/emax_commands.py @@ -272,6 +272,18 @@ def run(self, edit): ) set_clipboard(kill_ring.kill_ring.top()) +class EmaxDeleteWord(EmaxHelper): + """ + Mimic 'delete-word' also known as 'M-d'. + """ + + def run(self, edit, **kwargs): + self.deactivate_mark() + self.view.run_command( + "delete_word", + kwargs + ) + set_clipboard(kill_ring.kill_ring.top()) class EmaxYank(EmaxHelper):