sublimehq/Vintage — pull request #98 by skyronic (2012-03-24 08:05:29+00:00)
Title: Fix behavior of commands like '4>' and '4<'

Previous Behavior:

Let's assume we have a code block, and we have selected the entire block:

foo()
{
bar()
}

Selecting the entire block and entering the command '>>' results in the output

foo()
{
bar()
}

Which is the same as vim. But if we select the original block and issue the command '3>', we see the result:

foo()
{
bar()
}

Wheras, the same command issued through vim would result in:

foo()
{
bar()
}

After doing a little investigating, I realized that "3>" calls the "vi_indent" command three times.

The first time, it indents the entire block of text and deselects it. Since the caret is only on the first line for the second and third time the "vi_indent" function is called, only the first line gets indented.

The real proper fix for this bug would be to not call "transform_selection_regions" until the last call of vi_indent but this seemed like a simpler hack.