aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Jahns2013-10-11 21:29:20 (EDT)
committerBogdan Gheorghe2013-11-08 17:05:52 (EST)
commitab339f11029b6812d7d9766e2b69241bce1cca8d (patch)
treebe9e72c64074f1deca2316ad1095b5a751b46c70
parent066dfe000b256e03a956813dbf5206b0dad6b682 (diff)
downloadorg.eclipse.orion.client-ab339f11029b6812d7d9766e2b69241bce1cca8d.zip
org.eclipse.orion.client-ab339f11029b6812d7d9766e2b69241bce1cca8d.tar.gz
org.eclipse.orion.client-ab339f11029b6812d7d9766e2b69241bce1cca8d.tar.bz2
[Bug 418968] Vi Keybindings - 'u' triggers repeated undo when prefixed with a number --Signed-off-by: Steve Jahns <s.t.jahns@gmail.com>v20131108-2205
-rw-r--r--bundles/org.eclipse.orion.client.editor/web/orion/editor/actions.js22
1 files changed, 18 insertions, 4 deletions
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/actions.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/actions.js
index 31297c3..5954694 100644
--- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/actions.js
+++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/actions.js
@@ -49,17 +49,31 @@ define("orion/editor/actions", [ //$NON-NLS-0$
};
textView.addEventListener("ModelChanged", this._lastEditListener.onModelChanged); //$NON-NLS-0$
- textView.setAction("undo", function() { //$NON-NLS-0$
+ textView.setAction("undo", function(data) { //$NON-NLS-0$
if (this.undoStack) {
- this.undoStack.undo();
+ var count = 1;
+ if (data && data.count) {
+ count = data.count;
+ }
+ while (count > 0) {
+ this.undoStack.undo();
+ --count;
+ }
return true;
}
return false;
}.bind(this), {name: messages.undo});
- textView.setAction("redo", function() { //$NON-NLS-0$
+ textView.setAction("redo", function(data) { //$NON-NLS-0$
if (this.undoStack) {
- this.undoStack.redo();
+ var count = 1;
+ if (data && data.count) {
+ count = data.count;
+ }
+ while (count > 0) {
+ this.undoStack.redo();
+ --count;
+ }
return true;
}
return false;