From ef6a52f01c21092e89d81c78d52261d2a7c35510 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Fri, 5 Nov 2010 01:10:13 +1100 Subject: [PATCH] Make use of dactyl.assert in t_ and v_d actions. --HG-- extra : rebase_source : 7c7275d3695e98034f542c29fda8dafee2378253 --- common/content/editor.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 5523b959..2dab052e 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -588,10 +588,8 @@ const Editor = Module("editor", { mappings.add([modes.INSERT], [""], "Edit text field in Vi mode", function () { - if (!editor.isTextEdit) - modes.push(modes.TEXT_EDIT); - else - dactyl.beep(); + dactyl.assert(!editor.isTextEdit) + modes.push(modes.TEXT_EDIT); }); mappings.add([modes.INSERT], @@ -686,12 +684,9 @@ const Editor = Module("editor", { mappings.add([modes.VISUAL], ["d"], "Delete selected text", function (count) { - if (editor.isTextEdit) { - editor.executeCommand("cmd_cut"); - modes.pop(); - } - else - dactyl.beep(); + dactyl.assert(editor.isTextEdit); + editor.executeCommand("cmd_cut"); + modes.pop(); }); mappings.add([modes.VISUAL],