fix more vim issues (fixes #1930)
This commit is contained in:
parent
d05213cd92
commit
0155c67b1f
4 changed files with 19 additions and 8 deletions
|
|
@ -149,12 +149,13 @@ exports.handler = {
|
||||||
if (!isHandled && hashId !== -1)
|
if (!isHandled && hashId !== -1)
|
||||||
return;
|
return;
|
||||||
return {command: "null", passEvent: !isHandled};
|
return {command: "null", passEvent: !isHandled};
|
||||||
} // if no modifier || shift: wait for input.
|
|
||||||
else if (key.length == 1 && (hashId === 0 || hashId == 4)) {
|
|
||||||
return {command: "null", passEvent: true};
|
|
||||||
} else if (key == "esc" && hashId === 0) {
|
} else if (key == "esc" && hashId === 0) {
|
||||||
return {command: coreCommands.stop};
|
return {command: coreCommands.stop};
|
||||||
}
|
}
|
||||||
|
// if no modifier || shift: wait for input.
|
||||||
|
else if (hashId === 0 || hashId == 4) {
|
||||||
|
return {command: "null", passEvent: true};
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (key == "ctrl-w") {
|
if (key == "ctrl-w") {
|
||||||
return {command: "removewordleft"};
|
return {command: "removewordleft"};
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,12 @@ var actions = exports.actions = {
|
||||||
range.end.column++;
|
range.end.column++;
|
||||||
var text = editor.session.getTextRange(range);
|
var text = editor.session.getTextRange(range);
|
||||||
var toggled = text.toUpperCase();
|
var toggled = text.toUpperCase();
|
||||||
if (toggled == text)
|
if (toggled != text)
|
||||||
editor.navigateRight();
|
|
||||||
else
|
|
||||||
editor.session.replace(range, toggled);
|
editor.session.replace(range, toggled);
|
||||||
|
else if (text.toLowerCase() != text)
|
||||||
|
editor.session.replace(range, text.toLowerCase())
|
||||||
|
else
|
||||||
|
editor.navigateRight();
|
||||||
}, count || 1);
|
}, count || 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -342,6 +344,7 @@ var inputBuffer = exports.inputBuffer = {
|
||||||
currentCmd: null,
|
currentCmd: null,
|
||||||
//currentMode: 0,
|
//currentMode: 0,
|
||||||
currentCount: "",
|
currentCount: "",
|
||||||
|
pendingCount: "",
|
||||||
status: "",
|
status: "",
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
|
|
@ -442,8 +445,9 @@ var inputBuffer = exports.inputBuffer = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getCount: function() {
|
getCount: function() {
|
||||||
var count = this.currentCount;
|
var count = this.currentCount || this.pendingCount;
|
||||||
this.currentCount = "";
|
this.currentCount = "";
|
||||||
|
this.pendingCount = count;
|
||||||
return count && parseInt(count, 10);
|
return count && parseInt(count, 10);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -520,6 +524,7 @@ var inputBuffer = exports.inputBuffer = {
|
||||||
this.operator = null;
|
this.operator = null;
|
||||||
this.motion = null;
|
this.motion = null;
|
||||||
this.currentCount = "";
|
this.currentCount = "";
|
||||||
|
this.pendingCount = "";
|
||||||
this.status = "";
|
this.status = "";
|
||||||
this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
|
this.accepting = [NUMBER, OPERATOR, MOTION, ACTION];
|
||||||
this.idle = true;
|
this.idle = true;
|
||||||
|
|
|
||||||
|
|
@ -387,6 +387,7 @@ module.exports = {
|
||||||
param: true,
|
param: true,
|
||||||
handlesCount: true,
|
handlesCount: true,
|
||||||
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
||||||
|
if (param == "space") param = " ";
|
||||||
if (!isRepeat)
|
if (!isRepeat)
|
||||||
LAST_SEARCH_MOTION = {ch: "f", param: param};
|
LAST_SEARCH_MOTION = {ch: "f", param: param};
|
||||||
var cursor = editor.getCursorPosition();
|
var cursor = editor.getCursorPosition();
|
||||||
|
|
@ -402,6 +403,7 @@ module.exports = {
|
||||||
param: true,
|
param: true,
|
||||||
handlesCount: true,
|
handlesCount: true,
|
||||||
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
||||||
|
if (param == "space") param = " ";
|
||||||
if (!isRepeat)
|
if (!isRepeat)
|
||||||
LAST_SEARCH_MOTION = {ch: "F", param: param};
|
LAST_SEARCH_MOTION = {ch: "F", param: param};
|
||||||
var cursor = editor.getCursorPosition();
|
var cursor = editor.getCursorPosition();
|
||||||
|
|
@ -417,6 +419,7 @@ module.exports = {
|
||||||
param: true,
|
param: true,
|
||||||
handlesCount: true,
|
handlesCount: true,
|
||||||
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
||||||
|
if (param == "space") param = " ";
|
||||||
if (!isRepeat)
|
if (!isRepeat)
|
||||||
LAST_SEARCH_MOTION = {ch: "t", param: param};
|
LAST_SEARCH_MOTION = {ch: "t", param: param};
|
||||||
var cursor = editor.getCursorPosition();
|
var cursor = editor.getCursorPosition();
|
||||||
|
|
@ -435,6 +438,7 @@ module.exports = {
|
||||||
param: true,
|
param: true,
|
||||||
handlesCount: true,
|
handlesCount: true,
|
||||||
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
getPos: function(editor, range, count, param, isSel, isRepeat) {
|
||||||
|
if (param == "space") param = " ";
|
||||||
if (!isRepeat)
|
if (!isRepeat)
|
||||||
LAST_SEARCH_MOTION = {ch: "T", param: param};
|
LAST_SEARCH_MOTION = {ch: "T", param: param};
|
||||||
var cursor = editor.getCursorPosition();
|
var cursor = editor.getCursorPosition();
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,9 @@ module.exports = {
|
||||||
},
|
},
|
||||||
fn: function(editor, range, count, param) {
|
fn: function(editor, range, count, param) {
|
||||||
count = count || 1;
|
count = count || 1;
|
||||||
|
if (param && param.isLine)
|
||||||
|
param = "y";
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case param.isLine && param:
|
|
||||||
case "y":
|
case "y":
|
||||||
var pos = editor.getCursorPosition();
|
var pos = editor.getCursorPosition();
|
||||||
editor.selection.selectLine();
|
editor.selection.selectLine();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue