From a3aa33d0d3ffb7a8286e4db01ef878b3cfd427e6 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 5 Aug 2011 17:00:28 -0400 Subject: [PATCH] Fallback to count of parent mapping in motion maps. 2dw == d2w == 8d2w. --- common/content/editor.js | 4 +++- common/content/events.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 1ea8a272..25b2de84 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -540,8 +540,10 @@ var Editor = Module("editor", { function addMotionMap(key, desc, select, cmd, mode) { mappings.add([modes.OPERATOR], [key], desc, - function ({ count, motion, command }) { + function ({ count, motion }) { modes.push(modes.OPERATOR, null, { + count: count, + leave: function leave(stack) { if (stack.push) return; diff --git a/common/content/events.js b/common/content/events.js index 117d64b5..02accd95 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -231,7 +231,7 @@ var KeyProcessor = Class("KeyProcessor", { countStr: "", command: "", - get count() this.countStr ? Number(this.countStr) : null, + get count() this.countStr ? Number(this.countStr) : this.main.params.count, append: function append(event) { this.events.push(event);