diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js index 5411a68d..bffcfaa4 100644 --- a/demo/kitchen-sink/demo.js +++ b/demo/kitchen-sink/demo.js @@ -768,10 +768,10 @@ var statusUpdate = lang.deferredCall(function() { }); env.editor.on("changeStatus", function() { - statusUpdate.schedule(200); + statusUpdate.schedule(50); }); env.editor.on("changeSelection", function() { - statusUpdate.schedule(200); + statusUpdate.schedule(50); }); diff --git a/lib/ace/editor.js b/lib/ace/editor.js index f8eb9636..584d1b48 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -475,6 +475,7 @@ var Editor = function(renderer, session) { this.$highlightBrackets(); this.$updateHighlightActiveLine(); + this._emit("changeSelection"); }; /** internal, hide diff --git a/lib/ace/keyboard/vim/maps/motions.js b/lib/ace/keyboard/vim/maps/motions.js index 9ae7bfc1..3f0830c3 100644 --- a/lib/ace/keyboard/vim/maps/motions.js +++ b/lib/ace/keyboard/vim/maps/motions.js @@ -390,10 +390,9 @@ module.exports = { param: true, handlesCount: true, nav: function(editor, range, count, param) { - count = parseInt(count, 10) || 1; var ed = editor; var cursor = ed.getCursorPosition(); - var column = util.getLeftNthChar(editor, cursor, param, count); + var column = util.getLeftNthChar(editor, cursor, param, count || 1); if (typeof column === "number") { ed.selection.clearSelection(); // Why does it select in the first place? @@ -473,16 +472,9 @@ module.exports = { editor.selection.selectLineEnd(); } }, - "0": { - nav: function(editor) { - var ed = editor; - ed.navigateTo(ed.selection.selectionLead.row, 0); - }, - sel: function(editor) { - var ed = editor; - ed.selectTo(ed.selection.selectionLead.row, 0); - } - }, + "0": new Motion(function(ed) { + return {row: ed.selection.lead.row, column: 0}; + }), "G": { nav: function(editor, range, count, param) { if (!count && count !== 0) { // Stupid JS