On 06/04/09 07:58, François Ingelrest wrote:
>
> 2009/4/5 Bram Moolenaar<b...@moolenaar.net>:
>>> In my status line, I display the number of lines in the corresponding
>>> buffer. If I split the window, so that I have the same buffer into two
>>> visible windows, only the status line of the active window is updated.
>>> For instance, if I add some new lines to the buffer, the number of
>>> lines in the inactive windows remains the same.
>>>
>>> Even more confusing: If I change the file type, the syntax
>>> highlighting is updated in both windows, but only the file type in the
>>> status line of the active window is updated, not the other one.
>>>
>>> Is it the expected behavior? I would have expected the other status
>>> line to be updated, even if the corresponding window is inactive,
>>> since it's the same buffer I'm modifying.
>>>
>>> BTW, I'm using Vim 7.2.148 on Ubuntu Linux.
>>
>> It appears you have a custom statusline.  This is not guaranteed to be
>> updated on every little change in Vim's status.  It's a trade off
>> between updating the status line too often, which consumes time and
>> performance, and the status line being slightly outdated.
>>
>> The ideal solution would be to inspect the statusline, find out what it
>> depends on exactly and have the redraw trigger when one of the
>> dependencies changes.  But that's very complicated, since the status
>> line can depend on very many values.
>
> Isn't it possible to compute the status line for the active window,
> cache it, and then just 'copy it' over the status lines of visible
> windows showing the same buffer? I guess most of the time there will
> be at most only 1 or maybe 2 other visible windows with the same
> buffer.
>
> Maybe it's not possible, I don't know much about Vim's internals.

It would be invalid in the case of custom 'statusline's including, for 
instance, the window number, or maybe the number of visible lines and 
columns in the window, as part of what is displayed. Also, the cursor's 
line, column and virtual column (which are even displayed by the 
_default_ statusline when 'ruler' is set) can also differ among windows 
on a common buffer.

I prefer the present status (where :redraw or Ctrl-L can make the error 
disappear) than a copy-over among windows of a common buffer, where 
:redraw or Ctrl-L would _not_ make the error disappear.


Best regards,
Tony.
-- 
To the systems programmer, users and applications serve only to provide
a test load.

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

Reply via email to