From e69cba9ff310e56c4db38c6cd8b0ce1d7c02af2a Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 11 Oct 2008 06:27:07 +0000 Subject: [PATCH] Add "." --- content/buffer.js | 8 ++++++++ content/mappings.js | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/content/buffer.js b/content/buffer.js index 7082bce2..3f2ee3e6 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -467,6 +467,14 @@ liberator.Buffer = function () //{{{ var modes = liberator.config.browserModes || [liberator.modes.NORMAL]; + liberator.mappings.add(modes, ["."], + "Repeat the last key event", + function () + { + if (liberator.mappings.repeat) + liberator.mappings.repeat(); + }); + liberator.mappings.add(modes, ["i", ""], "Start caret mode", function () diff --git a/content/mappings.js b/content/mappings.js index bdfe469a..87295601 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -65,6 +65,10 @@ liberator.Map.prototype = { if (this.flags & liberator.Mappings.flags.ARGUMENT) args.push(argument); + let self = this; + // FIXME: Kludge. + if (this.names[0] != ".") + liberator.mappings.repeat = function () self.action.apply(self, args); return this.action.apply(this, args); }