[vim] visual block basic

This is a basic patch to demostrate visual block mode implementation.
right.Was planning to do something earlier.


On Thu, Jun 12, 2014 at 11:08 PM, Yunchi Luo <notifications@github.com>
wrote:

> In keymap/vim.js:
>
> > @@ -2423,6 +2471,33 @@
> >      function escapeRegex(s) {
> >        return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1');
> >      }
> > +    function selectBlock(cm, selectionEnd) {
> > +      var doc = cm.doc, pos = [], ranges = cm.listSelections();
> > +      var start = ranges[0].anchor, dir = 1;
> > +      var end = ranges[0].head;
> > +      if (start.line > selectionEnd.line) {
> > +        dir = -1;
> > +        start = ranges.reverse()[0].anchor;
>
> This seems inefficient. It's equivalent to do ranges[ranges.length -
> 1].anchor
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/marijnh/CodeMirror/pull/2633/files#r13714859>.
>