Closed jordwalke closed 11 years ago
It seems Vim normalizes motions to always be top-down. That makes sense. This one looks like a big feature.
BTW, if you try repeating in line 'three', you do get the expecter result, right?
Potential fix:
The first run of a command including downward motions would run normally. When repeating, we'd include an 'is_repeating' flag so 'vi_run' knows it must reverse the motion. I suppose that means we'd need to define antonyms for each downward motion too. This should work for visual line mode; not so sure about visual mode.
Then again, I haven't double-checked with Vim wether the reversal occurs in every mode. I suspect it might be only in visual line mode, which would be geat news.
I believe that if I try repeating at line three it does the correct thing (but I have to move my cursor there - it doesn't even remain at three when selecting bottom up - indenting moves my cursor down one extra line oddly)
This one seems pretty tough to solve. I need to think longer about how to reverse the motion's direction when repeating commands.
Insert:
Place your cursor in normal mode on the
three
. PressV
for linewise visual mode. Move up to theone
to select all three lines. Then press>
. Your cursor should remain at the top on lineone
- this is what vim does. The current cursor behavior of jumping back down messes up the repeat command.I notice that when selecting from the top down, and shifting with
>
, everything works.The Vim behavior seems to be: Always leave the cursor at the topmost part of the selection, regardless of where the selection began. Strange but works well and is engrained into my muscle memory.