vim {} motions

This commit is contained in:
nightwing 2012-09-06 23:28:07 +04:00
commit e00da55c92

View file

@ -598,6 +598,25 @@ module.exports = {
return match; return match;
}), }),
"{": new Motion(function(ed) {
var session = ed.session;
var row = session.selection.lead.row;
while(row > 0 && !/\S/.test(session.getLine(row)))
row--;
while(/\S/.test(session.getLine(row)))
row--;
return {column: 0, row: row};
}),
"}": new Motion(function(ed) {
var session = ed.session;
var l = session.getLength();
var row = session.selection.lead.row;
while(row < l && !/\S/.test(session.getLine(row)))
row++;
while(/\S/.test(session.getLine(row)))
row++;
return {column: 0, row: row};
}),
"ctrl-d": { "ctrl-d": {
nav: function(editor, range, count, param) { nav: function(editor, range, count, param) {
editor.selection.clearSelection(); editor.selection.clearSelection();