autoevent when buffer window resized

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

autoevent when buffer window resized

iler.ml

Is there autoevent that's triggered when buffer window is resized ?
(vimresize event seems to be something else)

Yakov

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: autoevent when buffer window resized

Tony Mechelynck

On 18/04/09 10:48, Yakov wrote:
>
> Is there autoevent that's triggered when buffer window is resized ?
> (vimresize event seems to be something else)
>
> Yakov

No, there isn't. You could try to determine what causes the window to be
resized (e.g. if it's because another window is opened or closed, there
are several autocommand events for that); but a script still couldn't
determine that the user has dragged a statusline up or down or used the
^W_ or ^W= Normal-mode commands (where ^W is Ctrl-W).

Or you could trap a fairly frequent event or events (such as
CursorMoved, CursorMoverdI, CursorHold, CursorHoldI), quickly check
winheight() and/or winwidth() for the window in question, and do nothing
else unless they change. You could even do that (using buffer variables)
as a side-effect of a function called from a custom 'statusline' and
always returning the empty string.


Best regards,
Tony.
--
Liberty is always dangerous, but it is the safest thing we have.
                -- Harry Emerson Fosdick

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: autoevent when buffer window resized

iler.ml



On Apr 18, 1:42 pm, Tony Mechelynck <[hidden email]>
wrote:

> On 18/04/09 10:48, Yakov wrote:
>
>
>
> > Is there autoevent that's triggered when buffer window is resized ?
> > (vimresize event seems to be something else)
>
> > Yakov
>
> No, there isn't. You could try to determine what causes the window to be
> resized (e.g. if it's because another window is opened or closed, there
> are several autocommand events for that); but a script still couldn't
> determine that the user has dragged a statusline up or down or used the
> ^W_ or ^W= Normal-mode commands (where ^W is Ctrl-W).
>
> Or you could trap a fairly frequent event or events (such as
> CursorMoved, CursorMoverdI, CursorHold, CursorHoldI), quickly check
> winheight() and/or winwidth()

Oh, checking the winheight() in CursorHold is great idea. Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---