Cyril Slobin wrote:
On 3/6/07, Bram Moolenaar <[EMAIL PROTECTED]> wrote:

It will help a lot to understand what you are talking about if you
include an example script.  Details might matter.

Well. In my _vimrc I set up an autocommand

autocmd BufWritePre * ks|call TimeStamp()|'s

I believe that content of TimeStamp is irrelevant, but just in case it matters:

function! TimeStamp()
 let lines = line("$") < 10 ? line("$") : 10
 let pattern1 = '\(Last [Cc]hange:\s\+\)\d\d\d\d \u\l\l \d\d'
 let replace1 = '\1' . strftime("%Y %b %d")
 execute printf('1,%ds/\C\m%s/%s/e', lines, pattern1, replace1)
 execute printf('$-%d+1,$s/\C\m%s/%s/e', lines, pattern1, replace1)
 let pattern2 = '\($Id: \f\+ \d\+\.\d\+\(\.\d\+\.\d\+\)*\)\(+\(\d\+\)\)\?'
 let replace2 = '\=submatch(1) . "+" . (submatch(4) + 1)'
 execute printf('1,%ds/\C\m%s/%s/e', lines, pattern2, replace2)
 execute printf('$-%d+1,$s/\C\m%s/%s/e', lines, pattern2, replace2)
endfunction

When I save buffer with :w -- it works.
When I save buffer with :wq -- it works.
But when I save buffer with :wqa -- it doesn't work.
Vim 7.0, not patched, win32 and dos32 versions.

My whole _vimrc is at http://45.free.net/~slobin/vim/_vimrc.html if this helps.


Unlike ":w" or ":wq", ":wqa" only triggers a write if the buffer is 'modified'. Are you sure that it was?

Best regards,
Tony.
--
Work Rule: Leave of Absence (for an Operation):
        We are no longer allowing this practice.  We wish to discourage
any thoughts that you may not need all of whatever you have, and you
should not consider having anything removed.  We hired you as you are,
and to have anything removed would certainly make you less than we
bargained for.

Reply via email to