javigon / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Diff mode does not update when a context line is changed. #242

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open up a file, change at least one line.
2. ":saveas tmp"
2. ":diffsplit original-file"
3. Modify one of the context lines.

What is the expected output? What do you see instead?

The line in the original file should be highlighted with DiffChange; the 
modified file should have that line highlighted with DiffChange and DiffText 
where the change occurred. Instead, nothing happens.

What version of the product are you using? On what operating system?

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 24 2014 17:37:05)
Included patches: 1-383
Compiled by admin@scott-pc
Normal version with GTK2 GUI.  Features included (+) or not (-):
+acl             -farsi           -mouse_netterm   +syntax
-arabic          +file_in_path    -mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
+balloon_eval    +float           -mouse_urxvt     -tag_any_white
+browse          +folding         +mouse_xterm     -tcl
+builtin_terms   -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
+clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      +toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    -keymap          +postscript      +virtualedit
+comments        -langmap         +printer         +visual
-conceal         +libcall         -profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
-cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  -lua             -rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      +X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
-emacs_tags      +mouseshape      -sniff           +xsmp_interact
+eval            -mouse_dec       +startuptime     +xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread 
-I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include 
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 
-I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include 
-I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/harfbuzz     -O2 
-fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 
-lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 
-lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 
-lfreetype   -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -ldl  

Please provide any additional information below.

The solution on vim.wikia.com [1] is to add :diffupdate as an auto-command on 
every BufWrite, but that seems inefficient and obviously not what vim does when 
one adds or removes a line in diff mode. For example:

1. Open up a file, change at least one line.
2. ":saveas tmp"
2. ":diffsplit original-file"
3. Modify one of the context lines and then hit enter.

Observe that while the diff of the original updates to highlight the new line 
with DiffDelete, but that the modified line above it does not change. If 
:diffupdate had been called, both changes would be noted by vim.

[1]: http://vim.wikia.com/wiki/Update_the_diff_view_automatically

Original issue reported on code.google.com by Splinter...@gmail.com on 29 Jul 2014 at 6:46

GoogleCodeExporter commented 9 years ago
Vim does not update the differences very often, because it uses an external 
program and it's slow.  There is a todo item to use a builtin diff mechanism, 
but I haven't found a good one yet.

Original comment by brammool...@gmail.com on 30 Jul 2014 at 9:45