>> Is there any way to turn off warning W11 without turning on autoread?
> Something similar to
>
> http://vim.wikia.com/wiki/File_no_longer_available_-_mark_buffer_modified
>
> should work.
Thanks, Ben! That's very helpful.
For now, I'm going to try:
au FileChangedShell * call FCSHandler(expand("<afile>:p"))
function FCSHandler(name)
let msg = 'File "'.a:name.'"'
let v:fcs_choice = ''
if v:fcs_reason == "deleted"
let msg .= " no longer available - 'modified' set"
call setbufvar(expand(a:name), '&modified', '1')
echohl WarningMsg
elseif v:fcs_reason == "time"
let msg .= " timestamp changed"
elseif v:fcs_reason == "mode"
let msg .= " permissions changed"
elseif v:fcs_reason == "changed"
"let msg .= " contents changed"
"let v:fcs_choice = "ask"
let msg .= " contents changed - 'modified' set"
call setbufvar(expand(a:name), '&modified', '1')
echohl WarningMsg
elseif v:fcs_reason == "conflict"
"let msg .= " CONFLICT --"
"let msg .= " is modified, but"
"let msg .= " was changed outside Vim"
"let v:fcs_choice = "ask"
"echohl ErrorMsg
let msg .= " CONFLICT --"
let msg .= " is modified, but"
let msg .= " was changed outside Vim"
call setbufvar(expand(a:name), '&modified', '1')
echohl WarningMsg
else " unknown values (future Vim versions?)
let msg .= " FileChangedShell reason="
let msg .= v:fcs_reason
let v:fcs_choice = "ask"
echohl ErrorMsg
endif
redraw!
echomsg msg
echohl None
endfunction
I may decide that I want "conflict" handled in the old way. I may decide
that I don't want modified to get set when the file changes. I haven't
decided, but this at least gets rid of the ugly W11 (that at least makes
me want to take my hands of the keyboard :( ).
Thanks, again --
Ted
--
Ted Pavlic <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---