vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vile] perl write-hook causes problems


From: Mike Mackovitch
Subject: [vile] perl write-hook causes problems
Date: Thu, 13 Aug 2009 22:04:00 -0700

It appears that if you have a perl write-hook, then the buffer's modified state
does not get updated correctly.

With a simple perl hook like:

store-procedure a_write_hook
        perl "1;"
~endm
setv $write-hook a_write_hook

If you edit three files, modify them all, display the buffer list (*) to verify
they are all marked modified. and then write them all out (:ww)
the files get written out, the hooks get executed, but the buffers remain
marked modified.

If the write hook does not use perl, then it works fine.

It appears to be caused by vile's perl code's manipulation of curbp.
The problem can be avoided with this simple patch (attached)
which saves the curbp in filewrite() and filesave() to make sure
that the same buffer pointer gets passed to writeout() and unchg_buff().

I have not attempted to dig into the vile perl code itself to track the problem
down further.

Oh, and this is on various versions of MacOSX.  I haven't tried reproducing
on other platforms (but I suspect this wouldn't be a platform-specific bug).

Thanks.
--macko

Attachment: patch.vile-9.7t.write.hook.fix.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]