Lech Lorens wrote:
> The attached patch enhances the behaviour of CTRL-W_CTRL-_ in visual mode.
>
> If CTRL-W_CTRL-_ is pressed in visual mode, Vim will try to change the
> height of the current window to match the visual selection and scroll
> the text so that all of the selection is visible.
>
> I didn't know whether to document it in visual.txt or window.txt...
> Left it in window.txt along with documentation for the original
> CTRL-W_CTRL-_.
I like your patch, too, but I am not sure, if CTRL-W_CTRL-_ is the best key
binding for it.
Originally, CTRL-W_CTRL-_ sets the window height to some value or the largest
possible, if not given.
Given your patch, CTRL-W_CTRL-_ behaves completely different, if in visual mode,
because it ignores the numeric argument (the desired height) given to
CTRL-W_CTRL-_. But even if it recognized the numeric argument, it would scroll
the window content, if the selection is not completely visible in the window
(according to the semantics given in your documentation patch). Contrast this to
the original behaviour, where setting the window height to the current height is
a no-op.
For this, I'd suggest to introduce (yet another) key binding for your new
feature, for example CTRL-W_CTRL-= or CTRL-W_CTRL-+.
Cheers,
--
Andreas.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---