Hi,

when I apply a reversed patch on an open file with 'diffpatch', gvim opens a
window with an empty buffer instead of the patched file. 'godlygeek' on IRC
suggested reporting this bug on this mailing list.

It seems, gvim automatically answers the questions from the patch program
'Reversed (or previously applied) patch detected!  Assume -R? [n]'
and
'Apply anyway? [n] '
with the default answer for me (as if I pressed 'Enter'), resulting in the empty
buffer.

I expected to be able to answer the questions myself :-) as it happens in vim.

How to reproduce:
- Have two files which differ, e.g. each contains a single but different line
  (eg., see attached files 'text' and 'text-new')
- Create patch:
  $ diff text text-new > patch
- Start vim with the newer file
  ./vim-7.2 -u NONE -U NONE -i NONE --noplugin -N -g text-new
- in gvim, try to apply patch file:
  :diffpatch patch

Result is empty file instead of (reversely) patched file because gvim does not
allow me to answer patch questions 'Assume -R?' and 'Apply anyway?'.

Note, the bug only appears if gui (-g) AND non-compatible mode (-N) are enabled.
If not in gui mode, the bug never appears (either compatible or non-compatible
mode).  If in gui mode and in compatible mode, the bug only appears when ':set
nocompatible' is executed before the diffpatch command.

vim-7.2 is the freshly built vim from the tarball from the homepage
(ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2)

I added the '-u NONE -U NONE -i NONE --noplugin' flags only to keep
bugreport.txt small; the bug still appears when these flags are missing.

Cheers,

Andreas.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

uname -a
Linux lava 2.6.24-23-generic #1 SMP Mon Jan 26 00:13:11 UTC 2009 i686 GNU/Linux


VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Feb  4 2009 10:08:29)
Compiled by berna...@lava
Normal version with GTK2 GUI.  Features included (+) or not (-):
-arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+cryptv -cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic 
-emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path 
+float +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand 
+jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap 
+menu +mksession +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm 
-mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte 
+multi_lang
 -mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript +printer 
-profile -python +quickfix +reltime -rightleft -ruby +scrollbind +signs 
+smartindent -sniff +statusline -sun_workshop +syntax +tag_binary 
+tag_old_static 
-tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar 
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace 
+wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact 
+xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/home/bernauer/tmp/vim-7.2/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 
-I/usr/include/pixman-1     -g -O2        
Linking: gcc   -L/usr/local/lib -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 
-lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 
-lgmodule-2.0 -lglib-2.0   -lXt -lm -lncurses -lselinux        
--- Directories and Files ---
$VIM = "/home/bernauer/tmp/vim-7.2/share/vim"
directory "/home/bernauer/tmp/vim-7.2/share/vim" exists
$VIMRUNTIME = "/home/bernauer/tmp/vim-7.2/share/vim/vim72"
directory "/home/bernauer/tmp/vim-7.2/share/vim/vim72" exists
"/home/bernauer/tmp/vim-7.2/share/vim/vim72/doc/help.txt" is readable
"/home/bernauer/tmp/vim-7.2/share/vim/vim72/doc/tags" is readable
"/home/bernauer/tmp/vim-7.2/share/vim/vim72/menu.vim" is readable
"/home/bernauer/tmp/vim-7.2/share/vim/vim72/filetype.vim" is readable
"/home/bernauer/tmp/vim-7.2/share/vim/vim72/syntax/synload.vim" is readable
--- Scripts sourced ---
  1: /home/bernauer/tmp/vim-7.2/share/vim/vim72/menu.vim
  2: /home/bernauer/tmp/vim-7.2/share/vim/vim72/autoload/paste.vim
  3: /home/bernauer/tmp/vim-7.2/share/vim/vim72/bugreport.vim
--- Options ---
  ambiwidth=single    foldmethod=manual   mousehide           swapfile
noautochdir           foldminlines=1      mousemodel=extend   swapsync=fsync
noautoindent          foldnestmax=20      mousetime=500       switchbuf=
noautoread            formatexpr=       nonumber              synmaxcol=3000
noautowrite           formatoptions=tcq   numberwidth=4       syntax=
noautowriteall        formatprg=          omnifunc=           tabline=
  background=light    fsync               operatorfunc=       tabpagemax=10
  backspace=        nogdefault          nopaste               tabstop=8
nobackup              guifont=            pastetoggle=        tagbsearch
  backupcopy=auto     guifontwide=        patchexpr=          taglength=0
  backupext=~         guiheadroom=50      patchmode=          tagrelative
  backupskip=/tmp/*   guipty            nopreserveindent      tags=./tags,tags
  balloondelay=600    guitablabel=        previewheight=12    tagstack
noballooneval         guitabtooltip=    nopreviewwindow       term=builtin_gui
  balloonexpr=        helpheight=20       printdevice=      noterse
nobinary              helplang=en         printencoding=      textauto
nobomb              nohidden              printfont=courier notextmode
  browsedir=last      history=20          printmbcharset=     textwidth=0
  bufhidden=        nohlsearch            printmbfont=        thesaurus=
  buflisted           icon                printoptions=     notildeop
  buftype=            iconstring=         prompt              timeout
  cdpath=,,         noignorecase          pumheight=0         timeoutlen=1000
  cedit=^F            imactivatekey=      quoteescape=\       title
  charconvert=      noimcmdline         noreadonly            titlelen=85
nocindent           noimdisable           redrawtime=2000     titlestring=
  cinoptions=         iminsert=2          remap             nottimeout
  cmdheight=1         imsearch=2          report=2            ttimeoutlen=-1
  cmdwinheight=7      includeexpr=      noruler               ttybuiltin
  columns=83        noincsearch           rulerformat=        ttyfast
nocompatible          indentexpr=         scroll=20           ttymouse=
  completefunc=     noinfercase         noscrollbind          ttyscroll=999
noconfirm           noinsertmode          scrolljump=1        undolevels=1000
nocopyindent          isprint=@,161-255   scrolloff=0         updatecount=200
  cpoptions=aABceFs   joinspaces        nosecure              updatetime=4000
nocursorcolumn        key=                selectmode=         verbose=0
nocursorline          keymodel=           shell=/bin/bash     verbosefile=
  debug=              keywordprg=man -s   shellcmdflag=-c     virtualedit=
nodelcombine          langmenu=           shellquote=       novisualbell
  dictionary=         laststatus=1        shelltemp           warn
nodiff              nolazyredraw          shellxquote=      noweirdinvert
  diffexpr=         nolinebreak         noshiftround          whichwrap=b,s
  diffopt=filler      lines=42            shiftwidth=8        wildchar=<Tab>
nodigraph             linespace=0       noshortname           wildcharm=0
  display=          nolisp                showbreak=          wildignore=
  eadirection=both  nolist              noshowcmd           nowildmenu
noedcompatible        listchars=eol:$   noshowfulltag         wildmode=full
  encoding=utf-8    noloadplugins       noshowmatch           wildoptions=
  endofline           magic               showmode            winaltkeys=menu
  equalalways         makeef=             showtabline=1       window=41
  equalprg=           makeprg=make        sidescroll=0        winheight=1
noerrorbells          matchtime=5         sidescrolloff=0   nowinfixheight
  esckeys             maxcombine=2      nosmartcase         nowinfixwidth
  eventignore=        maxfuncdepth=100  nosmartindent         winminheight=1
noexpandtab           maxmapdepth=1000  nosmarttab            winminwidth=1
noexrc                maxmem=1028732      softtabstop=0       winwidth=20
  fileformat=unix     maxmemtot=1028732 nospell               wrap
  filetype=           menuitems=25        spellfile=          wrapmargin=0
  foldclose=          modeline            spelllang=en        wrapscan
  foldcolumn=0        modelines=5         spellsuggest=best   write
  foldenable          modifiable        nosplitbelow        nowriteany
  foldexpr=0        nomodified          nosplitright          writebackup
  foldignore=#      nomore                startofline         writedelay=0
  foldlevel=0         mouse=a             statusline=
  foldlevelstart=-1 nomousefocus          suffixesadd=
  backupdir=.,~/tmp,~/
  breakat= ^...@*-+;:,./?
  casemap=internal,keepascii
  cinkeys=0{,0},0),:,0#,!^F,o,O,e
  cinwords=if,else,while,do,for,switch
  clipboard=autoselect,exclude:cons\|linux
  comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
  commentstring=/*%s*/
  complete=.,w,b,u,t,i
  completeopt=menu,preview
  define=^\s*#\s*define
  directory=.,~/tmp,/var/tmp,/tmp
  errorfile=errors.err
  errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared 
identifier is reported only once,%-G%f:%l: for each function it appears 
in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: 
Entering directory `%f',%X%*\a[%*\d]: Leaving directory `%f',%D%*\a: Entering 
directory `%f',%X%*\a: Leaving directory `%f',%DMaking %*\a in %f,%f|%l| %m
  fileencoding=utf-8
  fileencodings=ucs-bom,utf-8,default,latin1
  fileformats=unix,dos
  fillchars=vert:|,fold:-
  foldmarker={{{,}}}
  foldopen=block,hor,mark,percent,quickfix,search,tag,undo
  foldtext=foldtext()
  formatlistpat=^\s*\d\+[\]:.)}\t ]\s*
  grepformat=%f:%l:%m,%f:%l%m,%f  %l%m
  grepprg=grep -n $* /dev/null
  
guicursor=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
  guioptions=aegimrLtT
  helpfile=~/tmp/vim-7.2/share/vim/vim72/doc/help.txt
  
highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine
  include=^\s*#\s*include
  indentkeys=0{,0},:,0#,!^F,o,O,e
  isfname=@,48-57,/,.,-,_,+,,,#,$,%,~,=
  isident=@,48-57,_,192-255
  iskeyword=@,48-57,_,192-255
  
lispwords=defun,define,defmacro,set!,lambda,if,case,let,flet,let*,letrec,do,do*,define-syntax,let-syntax,letrec-syntax,destructuring-bind,defpackage,defparameter,defstruct,deftype,defvar,do-all-symbols,do-external-symbols,do-symbols,dolist,dotimes,ecase,etypecase,eval-when,labels,macrolet,multiple-value-bind,multiple-value-call,multiple-value-prog1,multiple-value-setq,prog1,progv,typecase,unless,unwind-protect,when,with-input-from-string,with-open-file,with-open-stream,with-output-to-string,with-package-iterator,define-condition,handler-bind,handler-case,restart-bind,restart-case,with-simple-restart,store-value,use-value,muffle-warning,abort,continue,with-slots,with-slots*,with-accessors,with-accessors*,defclass,defmethod,print-unreadable-object
  matchpairs=(:),{:},[:]
  maxmempattern=1000
  mkspellmem=460000,2000,500
  
mouseshape=i-r:beam,s:updown,sd:udsizing,vs:leftright,vd:lrsizing,m:no,ml:up-arrow,v:rightup-arrow
  nrformats=octal,hex
  paragraphs=IPLPPPQPP TPHPLIPpLpItpplpipbp
  path=.,/usr/include,,
  printexpr=system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' 
' . v:fname_in) . delete(v:fname_in) + v:shell_error
  printheader=%<%f%h%m%=Page %N
  
runtimepath=~/.vim,~/tmp/vim-7.2/share/vim/vimfiles,~/tmp/vim-7.2/share/vim/vim72,~/tmp/vim-7.2/share/vim/vimfiles/after,~/.vim/after
  scrollopt=ver,jump
  sections=SHNHH HUnhsh
  selection=inclusive
  sessionoptions=blank,buffers,curdir,folds,help,options,tabpages,winsize
  shellpipe=2>&1| tee
  shellredir=>%s 2>&1
  shortmess=filnxtToO
  spellcapcheck=[.?!]\_[\])'"^I ]\+
  suffixes=.bak,~,.o,.h,.info,.swp,.obj
  termencoding=utf-8
  titleold=Thanks for flying Vim
  toolbar=icons,tooltips
  toolbariconsize=small
  ttytype=builtin_gui
  viewdir=~/.vim/view
  viewoptions=folds,options,cursor
  viminfo='20,<50,s10,h
--- Terminal codes ---
  t_AB=               t_DL=^[|%p1%dD      t_nd=^L             t_us=^[|8h
  t_AF=               t_dl=^[|d           t_op=               t_vb=^[|f
  t_AL=^[|%p1%dI      t_fs=               t_RI=               t_ve=
  t_al=^[|i           t_IE=               t_RV=               t_vi=
  t_bc=               t_IS=               t_Sb=               t_vs=
  t_cd=               t_ke=               t_Sf=               t_WP=
  t_ce=^[|$           t_ks=               t_se=^[|16H         t_WS=
  t_cl=^[|C           t_le=^H             t_so=^[|16h         t_SI=
  t_Co=               t_mb=               t_sr=               t_EI=
  t_CS=               t_md=^[|2h          t_ts=               t_xs=
  t_ut=y              t_me=^[|31H         t_te=               t_ZH=^[|4h
  t_da=               t_mr=^[|1h          t_ti=               t_ZR=^[|4H
  t_db=               t_ms=y              t_ue=^[|8H
  t_cm=^[|%p1%d;%p2%dM
  t_cs=^[|%p1%d;%p2%dR
  t_CV=^[|%p1%d;%p2%dV
--- Auto-Commands ---
buffer_list  BufAdd
    *         call <SID>BMAdd()
buffer_list  BufDelete
    *         call <SID>BMRemove()
buffer_list  BufFilePost
    *         call <SID>BMAdd()
buffer_list  BufFilePre
    *         call <SID>BMRemove()
SpellPopupMenu  MenuPopup
    *         call <SID>SpellPopup()
--- Normal/Visual mode mappings ---

No mapping found
--- Insert/Command-line mode mappings ---

No mapping found
--- Abbreviations ---

No abbreviation found
--- Highlighting ---
SpecialKey     xxx term=bold ctermfg=4 guifg=Blue
NonText        xxx term=bold cterm=bold ctermfg=4 gui=bold guifg=Blue
Directory      xxx term=bold ctermfg=4 guifg=Blue
ErrorMsg       xxx term=standout cterm=bold ctermfg=7 ctermbg=1 guifg=White
                   guibg=Red
IncSearch      xxx term=reverse cterm=reverse gui=reverse
Search         xxx term=reverse ctermfg=0 ctermbg=3 guibg=Yellow
MoreMsg        xxx term=bold ctermfg=2 gui=bold guifg=SeaGreen
ModeMsg        xxx term=bold cterm=bold gui=bold
LineNr         xxx term=underline ctermfg=3 guifg=Brown
Question       xxx term=standout ctermfg=2 gui=bold guifg=SeaGreen
StatusLine     xxx term=bold,reverse cterm=bold,reverse gui=bold,reverse
StatusLineNC   xxx term=reverse cterm=reverse gui=reverse
VertSplit      xxx term=reverse cterm=reverse gui=reverse
Title          xxx term=bold ctermfg=5 gui=bold guifg=Magenta
Visual         xxx term=reverse cterm=reverse guibg=LightGrey
VisualNOS      xxx term=bold,underline cterm=bold,underline gui=bold,underline
WarningMsg     xxx term=standout ctermfg=1 guifg=Red
WildMenu       xxx term=standout ctermfg=0 ctermbg=3 guifg=Black guibg=Yellow
Folded         xxx term=standout ctermfg=4 ctermbg=7 guifg=DarkBlue
                   guibg=LightGrey
FoldColumn     xxx term=standout ctermfg=4 ctermbg=7 guifg=DarkBlue guibg=Grey
DiffAdd        xxx term=bold ctermbg=4 guibg=LightBlue
DiffChange     xxx term=bold ctermbg=5 guibg=LightMagenta
DiffDelete     xxx term=bold cterm=bold ctermfg=4 ctermbg=6 gui=bold guifg=Blue
                   guibg=LightCyan
DiffText       xxx term=reverse cterm=bold ctermbg=1 gui=bold guibg=Red
SignColumn     xxx term=standout ctermfg=4 ctermbg=7 guifg=DarkBlue guibg=Grey
SpellBad       xxx term=reverse ctermbg=1 gui=undercurl guisp=Red
SpellCap       xxx term=reverse ctermbg=4 gui=undercurl guisp=Blue
SpellRare      xxx term=reverse ctermbg=5 gui=undercurl guisp=Magenta
SpellLocal     xxx term=underline ctermbg=6 gui=undercurl guisp=DarkCyan
Pmenu          xxx ctermbg=5 guibg=LightMagenta
PmenuSel       xxx ctermbg=7 guibg=Grey
PmenuSbar      xxx ctermbg=7 guibg=Grey
PmenuThumb     xxx cterm=reverse gui=reverse
TabLine        xxx term=underline cterm=underline ctermfg=0 ctermbg=7
                   gui=underline guibg=LightGrey
TabLineSel     xxx term=bold cterm=bold gui=bold
TabLineFill    xxx term=reverse cterm=reverse gui=reverse
CursorColumn   xxx term=reverse ctermbg=7 guibg=Grey90
CursorLine     xxx term=underline cterm=underline guibg=Grey90
Cursor         xxx guifg=bg guibg=fg
lCursor        xxx guifg=bg guibg=fg
MatchParen     xxx term=reverse ctermbg=6 guibg=Cyan
Normal         xxx font=Monospace 10
--- Variables ---
did_install_default_menus #1
did_toolbar_tmenu     #1
bmenu_priority        #60
ctags_command          ctags -R .
paste#paste_cmd       {'v': '"-c<Esc>:call paste#Paste()<CR>', 'i': 
'x<BS><Esc>:call paste#Paste()<CR>gi', 'n': ':call paste#Paste()<CR>'}
more_save             #1
bmenu_max_pathlen     #35
b:changedtick         #3
v:version             #702
v:beval_winnr         #0
v:lnum                #0
v:scrollstart          /home/bernauer/tmp/vim-7.2/share/vim/vim72/bugreport.vim 
line 20
v:dying               #0
v:lang                 en_US.UTF-8
v:count               #0
v:progname             vim-7.2
v:cmdbang             #0
v:foldlevel           #0
v:ctype                en_US.UTF-8
v:prevcount           #0
v:mouse_win           #0
v:count1              #1
v:foldstart           #0
v:foldend             #0
v:profiling           #0
v:beval_col           #0
v:errmsg               E328: Menu only exists in another mode
v:beval_lnum          #0
v:mouse_lnum          #0
v:beval_bufnr         #0
v:shell_error         #0
v:servername           VIM-7
v:lc_time              en_US.UTF-8
v:searchforward       #1
v:mouse_col           #0
v:statusmsg            No abbreviation found
1c1
< var=1
---
> var=2
var=1
var=2

Raspunde prin e-mail lui