On Jul 10, 4:16 am, Sylvain Chouleur <[email protected]>
wrote:
> Hi List,
>
> I'm looking for a sort of auto-diffupdate, I explain:
>
> When editing in diff mode, if I modify a line that hasn't differences
> with the other file, the highlight of the new differences doesn't
> appears. I have to do a diffupdate to view the highlight.
>
> Is there an option or something that refresh the highlight when editing ?
>

No option that I know of, but you can partially accomplish this using
autocmds.

Try putting the following in your .vimrc:

augroup AutoDiffUpdate
  au!
  autocmd InsertLeave * if &diff | diffupdate | let b:old_changedtick
= b:changedtick | endif
  autocmd CursorHold *
        \ if &diff &&
        \    (!exists('b:old_changedtick') || b:old_changedtick !=
b:changedtick) |
        \   let b:old_changedtick = b:changedtick | diffupdate |
        \ endif
augroup END

This will automatically update the diff whenever you leave insertmode,
or when you haven't moved the cursor for a while and changes have been
made to the buffer since the last time this automatic diffupdate
fired.

I may run with this for a while, though I imagine it might get
annoying because of the auto-diffupdate firing after using commands
like dp and do...maybe I'll add mappings for those commands to update
the old_changedtick as well.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to