On Friday, October 11, 2013 2:40:36 AM UTC-5, [email protected] wrote: > What steps will reproduce the problem? > 1. Open file1.txt in gvim > 2. :diffsplit file2.txt > > What is the expected output? What do you see instead? > I expect the diffsplit command to show the differences between file1.txt and > file2.txt in two windows. I get two errors instead and the two windows show > no differences. > > E810: Cannot read or write temp files > E97: Cannot create diffs > > What version of the product are you using? On what operating system? > I recently (yesterday) installed gvim74.exe on Windows XP SP3. This problem > did not happen with vim 7.3. It started happening immediately after replacing > it by installing vim 7.4. > > Please provide any additional information below. > In the MyDiff() function of the _vimrc that is distributed with the > gvim74.exe installer, I changed single quotes to double quotes on line 13 of > the function, and the problem was fixed. This allowed the pattern in the IF > test to match. > > So change original: (single quotes) > if &sh =~ '\<cmd' (fails) > > To: (double quotes) > if &sh =~ "\<cmd" (works) > > Or keep single quotes but escape the backslash: > if &sh =~ '\\<cmd' (also works) > > Oddly, from what I understand of literal strings from vim:help, the original > line is technically correct. It seems like there is a bug in vim 7.4 that is > swapping the meaning of single and double quotes, at least in this context. >
Your "fix" and root cause are wrong as I explained in your vim_use post. Vim does NOT confuse single and double quotes. You're confusing which code is running. I confirm the following is present in dosinst.c which apparently creates the default _vimrc: > 1 function MyDiff() > 2 let opt = '-a --binary ' > 3 if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif > 4 if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif > 5 let arg1 = v:fname_in > 6 if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif > 7 let arg2 = v:fname_new > 8 if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif > 9 let arg3 = v:fname_out > 10 if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif > 11 let eq = '' > 12 if $VIMRUNTIME =~ ' ' > 13>>> if &sh =~ '\<cmd' <<< CHANGE TO DOUBLE QUOTES > 14 let cmd = '""' . $VIMRUNTIME . '\diff"' > 15 let eq = '"' These two lines are WRONG with current default settings. They are a workaround for the issue fixed with external windows commands by the new shellxquote default value. Bram, these lines need to get removed. > 16 else > 17 let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' This is the line that is now actually running. I guess this method works fine in Windows XP with current defaults? > 18 endif > 19 else > 20 let cmd = $VIMRUNTIME . '\diff' > 21 endif > 22 silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 > . eq > 23 endfunction > > (Credit to [email protected], > http://code.google.com/p/vim/issues/detail?id=28#c6) fvelasqu posted that to a thread on a completely unrelated problem. THAT problem report deals with adding text in a new Vim with the default empty buffer shown. His post has to do with creating diffs. And as mentioned the "fix" is a garbage workaround that effectively forces the first if condition to never execute. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
