Merge remote-tracking branch 'remotes/pull/2281'

This commit is contained in:
nightwing 2014-12-21 13:47:50 +04:00
commit 724b66857d
2 changed files with 13 additions and 1 deletions

View file

@ -2118,7 +2118,11 @@ dom.importCssString(".normal-mode .ace_cursor{\
newHead = copyCursor(origHead);
}
if (vim.visualMode) {
newHead = clipCursorToContent(cm, newHead, vim.visualBlock);
if (!(vim.visualBlock && motion === "moveToEol")) {
newHead = clipCursorToContent(cm, newHead, vim.visualBlock);
}
if (newAnchor) {
newAnchor = clipCursorToContent(cm, newAnchor, true);
}

View file

@ -1957,6 +1957,14 @@ testVim('visual_line', function(cm, vim, helpers) {
helpers.doKeys('l', 'V', 'l', 'j', 'j', 'd');
eq(' 4\n 5', cm.getValue());
}, { value: ' 1\n 2\n 3\n 4\n 5' });
testVim('visual_block_move_to_eol', function(cm, vim, helpers) {
// moveToEol should move all block cursors to end of line
cm.setCursor(0, 0);
helpers.doKeys('<C-v>', 'G', '$');
var selections = cm.getSelections().join();
console.log(selections);
eq("123,45,6", selections);
}, {value: '123\n45\n6'});
testVim('visual_block_different_line_lengths', function(cm, vim, helpers) {
// test the block selection with lines of different length
// i.e. extending the selection