TailMinusF Plugin

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

TailMinusF Plugin

jason heddings-2
Hello-

I have attempted to create a plugin that watches a file in real-time and
displays it in the preview window.  I would appretiate any feedback or
improvements.

http://www.vim.org/scripts/script.php?script_id=1374

Thanks!
--jah

Reply | Threaded
Open this post in threaded view
|

Re: TailMinusF Plugin

Gareth Oakes-2
Hi there,

> I have attempted to create a plugin that watches a file in real-time and
> displays it in the preview window.  I would appretiate any feedback or
> improvements.
>
> http://www.vim.org/scripts/script.php?script_id=1374

I don't really have time to explore your code, as I'm still pretty
newbie at Vim scripting.  However, your plugin doesn't quite work
ideally.  It seems that the TailMinusF preview window only gets updated
when you "do something" to Vim, such as restore focus, move cursor, etc.
  I'm sure you're aware of this limitation, but thought it's worth
pointing out.

Besides from that it seems to work pretty well!

Cheers,
-G
Reply | Threaded
Open this post in threaded view
|

Re: TailMinusF Plugin

A.J.Mechelynck
Gareth Oakes wrote:

> Hi there,
>
>> I have attempted to create a plugin that watches a file in real-time and
>> displays it in the preview window.  I would appretiate any feedback or
>> improvements.
>>
>> http://www.vim.org/scripts/script.php?script_id=1374
>
> I don't really have time to explore your code, as I'm still pretty
> newbie at Vim scripting.  However, your plugin doesn't quite work
> ideally.  It seems that the TailMinusF preview window only gets updated
> when you "do something" to Vim, such as restore focus, move cursor, etc.
>  I'm sure you're aware of this limitation, but thought it's worth
> pointing out.
>
> Besides from that it seems to work pretty well!
>
> Cheers,
> -G

To have it updated oftener, you might (untested) try calling the update
from a function in a "custom" status line (setting 'statusline' locally
for the preview window). Let's say a function which always returns the
empty string, and makes its job as a side-effect in the context of the
preview window. You might want to display the preview at the top (rather
than the bottom) of the Vim screen in order to be sure that it always
has a status line regardless of the 'laststatus' setting.

Best regards,
Tony.