fix #1834 vim mode issues

This commit is contained in:
nightwing 2014-04-13 20:52:23 +04:00
commit d05213cd92
4 changed files with 20 additions and 2 deletions

View file

@ -164,6 +164,7 @@ var actions = exports.actions = {
fn: function(editor, range, count, param) {
var options = editor.getLastSearchOptions();
options.backwards = false;
options.start = null;
editor.selection.moveCursorRight();
editor.selection.clearSelection();
@ -180,6 +181,7 @@ var actions = exports.actions = {
fn: function(editor, range, count, param) {
var options = editor.getLastSearchOptions();
options.backwards = true;
options.start = null;
editor.findPrevious(options);
ensureScrollMargin(editor);
@ -497,7 +499,8 @@ var inputBuffer = exports.inputBuffer = {
else if (selectable) {
repeat(function() {
run(motionObj.sel);
operators[o.ch].fn(editor, editor.getSelectionRange(), o.count, param);
operators[o.ch].fn(editor, editor.getSelectionRange(),
o.count, motionObj.param ? motionObj : param);
}, o.count || 1);
}
this.reset();

View file

@ -350,6 +350,10 @@ module.exports = {
case "W":
editor.selection.selectAWord();
break;
case ")":
case "}":
case "]":
param = editor.session.$brackets[param];
case "(":
case "{":
case "[":
@ -656,7 +660,8 @@ module.exports = {
pos.column = line.length;
return pos;
}
}
},
isLine: true
})
};

View file

@ -116,6 +116,7 @@ module.exports = {
fn: function(editor, range, count, param) {
count = count || 1;
switch (param) {
case param.isLine && param:
case "y":
var pos = editor.getCursorPosition();
editor.selection.selectLine();

View file

@ -133,6 +133,15 @@ var Keys = (function() {
// workaround for firefox bug
ret[173] = '-';
(function() {
var mods = ["cmd", "ctrl", "alt", "shift"];
for (var i = Math.pow(2, mods.length); i--;) {
ret.KEY_MODS[i] = mods.filter(function(x) {
return i & ret.KEY_MODS[x];
}).join("-") + "-";
}
})();
(function() {
var mods = ["cmd", "ctrl", "alt", "shift"];