--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.117
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.117
+Problem: Can't check wether Vim was compiled with Gnome. (Tony Mechelynck)
+Solution: Add gui_gnome to the has() list.
+Files: src/eval.c
+
+
+*** ../vim-7.1.116/src/eval.c Mon Sep 17 22:19:43 2007
+--- src/eval.c Sun Sep 16 19:24:49 2007
+***************
+*** 10879,10884 ****
+--- 10883,10891 ----
+ "gui_gtk2",
+ # endif
+ #endif
++ #ifdef FEAT_GUI_GNOME
++ "gui_gnome",
++ #endif
+ #ifdef FEAT_GUI_MAC
+ "gui_mac",
+ #endif
+*** ../vim-7.1.116/src/version.c Mon Sep 17 22:38:49 2007
+--- src/version.c Tue Sep 25 12:48:59 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 117,
+ /**/
+
+--
+ARTHUR: No, hang on! Just answer the five questions ...
+GALAHAD: Three questions ...
+ARTHUR: Three questions ... And we shall watch ... and pray.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.118
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.118 (after 7.1.107)
+Problem: Compiler warning for Visual C compiler.
+Solution: Add typecast. (Mike Williams)
+Files: src/ops.c
+
+
+*** ../vim-7.1.117/src/ops.c Thu Sep 13 22:40:47 2007
+--- src/ops.c Mon Sep 24 18:30:09 2007
+***************
+*** 2605,2611 ****
+ /* Auto-indenting may have changed the indent. If the cursor was past
+ * the indent, exclude that indent change from the inserted text. */
+ firstline = ml_get(oap->start.lnum);
+! if (bd.textcol > pre_indent)
+ {
+ long new_indent = (long)(skipwhite(firstline) - firstline);
+
+--- 2605,2611 ----
+ /* Auto-indenting may have changed the indent. If the cursor was past
+ * the indent, exclude that indent change from the inserted text. */
+ firstline = ml_get(oap->start.lnum);
+! if (bd.textcol > (colnr_T)pre_indent)
+ {
+ long new_indent = (long)(skipwhite(firstline) - firstline);
+
+*** ../vim-7.1.117/src/version.c Tue Sep 25 12:50:00 2007
+--- src/version.c Tue Sep 25 14:18:37 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 118,
+ /**/
+
+--
+BRIDGEKEEPER: What is your favorite editor?
+GAWAIN: Emacs ... No, Viiiiiiiiiiimmmmmmm!
+ "Monty Python and the Holy editor wars" PYTHON (MONTY) SOFTWARE LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.119
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.119
+Problem: Crash when 'cmdheight' set to very large value. (A.Politz)
+Solution: Limit 'cmdheight' to 'lines' minus one. Store right value of
+ 'cmdheight' when running out of room.
+Files: src/option.c, src/window.c
+
+
+*** ../vim-7.1.118/src/option.c Thu Sep 6 16:33:47 2007
+--- src/option.c Tue Sep 25 12:17:35 2007
+***************
+*** 7824,7829 ****
+--- 7824,7831 ----
+ errmsg = e_positive;
+ p_ch = 1;
+ }
++ if (p_ch > Rows - min_rows() + 1)
++ p_ch = Rows - min_rows() + 1;
+
+ /* Only compute the new window layout when startup has been
+ * completed. Otherwise the frame sizes may be wrong. */
+*** ../vim-7.1.118/src/window.c Thu Sep 13 18:25:08 2007
+--- src/window.c Tue Sep 25 12:13:56 2007
+***************
+*** 5523,5528 ****
+--- 5523,5529 ----
+ {
+ EMSG(_(e_noroom));
+ p_ch = old_p_ch;
++ curtab->tp_ch_used = p_ch;
+ cmdline_row = Rows - p_ch;
+ break;
+ }
+*** ../vim-7.1.118/src/version.c Tue Sep 25 14:19:35 2007
+--- src/version.c Tue Sep 25 14:48:14 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 119,
+ /**/
+
+--
+Q: Why does /dev/null accept only integers?
+A: You can't sink a float.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.120
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.120
+Problem: Can't properly check memory leaks while running tests.
+Solution: Add an argument to garbagecollect(). Delete functions and
+ variables in the test scripts.
+Files: runtime/doc/eval.txt, src/eval.c, src/globals.h, src/main.c,
+ src/testdir/Makefile, src/testdir/test14.in,
+ src/testdir/test26.in, src/testdir/test34.in,
+ src/testdir/test45.in, src/testdir/test47.in,
+ src/testdir/test49.in, src/testdir/test55.in,
+ src/testdir/test56.in, src/testdir/test58.in,
+ src/testdir/test59.in, src/testdir/test60.in,
+ src/testdir/test60.vim, src/testdir/test62.in,
+ src/testdir/test63.in, src/testdir/test64.in
+
+
+*** ../vim-7.1.119/runtime/doc/eval.txt Thu Jul 26 22:55:11 2007
+--- runtime/doc/eval.txt Tue Sep 25 17:40:30 2007
+***************
+*** 1,4 ****
+! *eval.txt* For Vim version 7.1. Last change: 2007 Jul 25
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+--- 1,4 ----
+! *eval.txt* For Vim version 7.1. Last change: 2007 Sep 25
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+***************
+*** 1603,1609 ****
+ foldtextresult( {lnum}) String text for closed fold at {lnum}
+ foreground( ) Number bring the Vim window to the foreground
+ function( {name}) Funcref reference to function {name}
+! garbagecollect() none free memory, breaking cyclic references
+ get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
+ get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
+ getbufline( {expr}, {lnum} [, {end}])
+--- 1603,1609 ----
+ foldtextresult( {lnum}) String text for closed fold at {lnum}
+ foreground( ) Number bring the Vim window to the foreground
+ function( {name}) Funcref reference to function {name}
+! garbagecollect( [at_exit]) none free memory, breaking cyclic references
+ get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
+ get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
+ getbufline( {expr}, {lnum} [, {end}])
+***************
+*** 2673,2679 ****
+ {name} can be a user defined function or an internal function.
+
+
+! garbagecollect() *garbagecollect()*
+ Cleanup unused |Lists| and |Dictionaries| that have circular
+ references. There is hardly ever a need to invoke this
+ function, as it is automatically done when Vim runs out of
+--- 2673,2679 ----
+ {name} can be a user defined function or an internal function.
+
+
+! garbagecollect([at_exit]) *garbagecollect()*
+ Cleanup unused |Lists| and |Dictionaries| that have circular
+ references. There is hardly ever a need to invoke this
+ function, as it is automatically done when Vim runs out of
+***************
+*** 2683,2688 ****
+--- 2683,2691 ----
+ This is useful if you have deleted a very big |List| and/or
+ |Dictionary| with circular references in a script that runs
+ for a long time.
++ When the optional "at_exit" argument is one, garbage
++ collection will also be done when exiting Vim, if it wasn't
++ done before. This is useful when checking for memory leaks.
+
+ get({list}, {idx} [, {default}]) *get()*
+ Get item {idx} from |List| {list}. When this item is not
+*** ../vim-7.1.119/src/eval.c Tue Sep 25 12:50:00 2007
+--- src/eval.c Sun Sep 16 19:24:49 2007
+***************
+*** 6128,6133 ****
+--- 6128,6134 ----
+ /* Only do this once. */
+ want_garbage_collect = FALSE;
+ may_garbage_collect = FALSE;
++ garbage_collect_at_exit = FALSE;
+
+ /*
+ * 1. Go through all accessible variables and mark all lists and dicts
+***************
+*** 7110,7116 ****
+ {"foldtextresult", 1, 1, f_foldtextresult},
+ {"foreground", 0, 0, f_foreground},
+ {"function", 1, 1, f_function},
+! {"garbagecollect", 0, 0, f_garbagecollect},
+ {"get", 2, 3, f_get},
+ {"getbufline", 2, 3, f_getbufline},
+ {"getbufvar", 2, 2, f_getbufvar},
+--- 7111,7117 ----
+ {"foldtextresult", 1, 1, f_foldtextresult},
+ {"foreground", 0, 0, f_foreground},
+ {"function", 1, 1, f_function},
+! {"garbagecollect", 0, 1, f_garbagecollect},
+ {"get", 2, 3, f_get},
+ {"getbufline", 2, 3, f_getbufline},
+ {"getbufvar", 2, 2, f_getbufvar},
+***************
+*** 9719,9724 ****
+--- 9720,9728 ----
+ /* This is postponed until we are back at the toplevel, because we may be
+ * using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". */
+ want_garbage_collect = TRUE;
++
++ if (argvars[0].v_type != VAR_UNKNOWN && get_tv_number(&argvars[0]) == 1)
++ garbage_collect_at_exit = TRUE;
+ }
+
+ /*
+*** ../vim-7.1.119/src/globals.h Thu Aug 30 13:51:52 2007
+--- src/globals.h Sun Sep 16 18:42:41 2007
+***************
+*** 301,313 ****
+ #endif
+
+ #ifdef FEAT_EVAL
+! /* Garbage collection can only take place when we are sure there are no Lists
+ * or Dictionaries being used internally. This is flagged with
+ * "may_garbage_collect" when we are at the toplevel.
+ * "want_garbage_collect" is set by the garbagecollect() function, which means
+! * we do garbage collection before waiting for a char at the toplevel. */
+ EXTERN int may_garbage_collect INIT(= FALSE);
+ EXTERN int want_garbage_collect INIT(= FALSE);
+
+ /* ID of script being sourced or was sourced to define the current function. */
+ EXTERN scid_T current_SID INIT(= 0);
+--- 301,317 ----
+ #endif
+
+ #ifdef FEAT_EVAL
+! /*
+! * Garbage collection can only take place when we are sure there are no Lists
+ * or Dictionaries being used internally. This is flagged with
+ * "may_garbage_collect" when we are at the toplevel.
+ * "want_garbage_collect" is set by the garbagecollect() function, which means
+! * we do garbage collection before waiting for a char at the toplevel.
+! * "garbage_collect_at_exit" indicates garbagecollect(1) was called.
+! */
+ EXTERN int may_garbage_collect INIT(= FALSE);
+ EXTERN int want_garbage_collect INIT(= FALSE);
++ EXTERN int garbage_collect_at_exit INIT(= FALSE);
+
+ /* ID of script being sourced or was sourced to define the current function. */
+ EXTERN scid_T current_SID INIT(= 0);
+*** ../vim-7.1.119/src/main.c Thu Sep 6 17:38:06 2007
+--- src/main.c Sun Sep 16 18:44:54 2007
+***************
+*** 1334,1339 ****
+--- 1334,1343 ----
+ #ifdef FEAT_CSCOPE
+ cs_end();
+ #endif
++ #ifdef FEAT_EVAL
++ if (garbage_collect_at_exit)
++ garbage_collect();
++ #endif
+
+ mch_exit(exitval);
+ }
+*** ../vim-7.1.119/src/testdir/Makefile Tue Aug 14 17:28:14 2007
+--- src/testdir/Makefile Mon Sep 17 20:04:13 2007
+***************
+*** 6,12 ****
+
+ # Uncomment this line for using valgrind.
+ # The output goes into a file "valgrind.$PID" (sorry, no test number).
+! # VALGRIND = valgrind --tool=memcheck --num-callers=15 --logfile=valgrind
+
+ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out test10.out test11.out \
+--- 6,12 ----
+
+ # Uncomment this line for using valgrind.
+ # The output goes into a file "valgrind.$PID" (sorry, no test number).
+! # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --logfile=valgrind
+
+ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out test10.out test11.out \
+***************
+*** 39,45 ****
+ $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
+
+ clean:
+! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* viminfo
+
+ test1.out: test1.in
+ -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
+--- 39,45 ----
+ $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
+
+ clean:
+! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo
+
+ test1.out: test1.in
+ -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
+***************
+*** 65,70 ****
+--- 65,74 ----
+ else echo $* NO OUTPUT >>test.log; \
+ fi"
+ -rm -rf X* test.ok viminfo
++
++ test49.out: test49.vim
++
++ test60.out: test60.vim
+
+ nolog:
+ -echo Test results: >test.log
+*** ../vim-7.1.119/src/testdir/test14.in Sun Jun 13 20:24:08 2004
+--- src/testdir/test14.in Sun Sep 16 15:57:54 2007
+***************
+*** 18,23 ****
+--- 18,24 ----
+ : let tt = "o\<C-V>65\<C-V>x42\<C-V>o103 \<C-V>33a\<C-V>xfg\<C-V>o78\<Esc>"
+ :endif
+ :exe "normal " . tt
++ :unlet tt
+ :.w >>test.out
+ :set vb
+ /^Piece
+*** ../vim-7.1.119/src/testdir/test26.in Sun Jun 13 17:05:48 2004
+--- src/testdir/test26.in Sun Sep 16 16:54:19 2007
+***************
+*** 37,42 ****
+--- 37,43 ----
+ : endif
+ : endif
+ :endwhile
++ :unlet i j
+ :'t,$w! test.out
+ :qa!
+ ENDTEST
+*** ../vim-7.1.119/src/testdir/test34.in Sun Apr 30 20:46:14 2006
+--- src/testdir/test34.in Sun Sep 16 21:25:47 2007
+***************
+*** 52,58 ****
+ ---*---
+ (one
+ (two
+! [(one again\e:$-5,$wq! test.out
+ ENDTEST
+
+ here
+--- 52,66 ----
+ ---*---
+ (one
+ (two
+! [(one again\e:$-5,$w! test.out
+! :delfunc Table
+! :delfunc Compute
+! :delfunc Expr1
+! :delfunc Expr2
+! :delfunc ListItem
+! :delfunc ListReset
+! :unlet retval counter
+! :q!
+ ENDTEST
+
+ here
+*** ../vim-7.1.119/src/testdir/test45.in Sun Jun 13 19:57:02 2004
+--- src/testdir/test45.in Sun Sep 16 18:27:20 2007
+***************
+*** 55,60 ****
+--- 55,61 ----
+ /kk$
+ :call append("$", foldlevel("."))
+ :/^last/+1,$w! test.out
++ :delfun Flvl
+ :qa!
+ ENDTEST
+
+*** ../vim-7.1.119/src/testdir/test47.in Sun Jun 13 18:40:29 2004
+--- src/testdir/test47.in Sun Sep 16 18:32:03 2007
+***************
+*** 34,39 ****
+--- 34,40 ----
+ :call append("$", two)
+ :call append("$", three)
+ :$-2,$w! test.out
++ :unlet one two three
+ :qa!
+ ENDTEST
+
+*** ../vim-7.1.119/src/testdir/test49.in Sun Jun 13 18:10:00 2004
+--- src/testdir/test49.in Sun Sep 16 23:30:35 2007
+***************
+*** 1,13 ****
+ This is a test of the script language.
+
+ If after adding a new test, the test output doesn't appear properly in
+! test49.failed, try to add one ore more "G"s at the line before ENDTEST.
+
+ STARTTEST
+ :so small.vim
+ :se nocp nomore viminfo+=nviminfo
+ :so test49.vim
+! GGGGGGGGGG"rp:.-,$wq! test.out
+ ENDTEST
+
+ Results of test49.vim:
+--- 1,29 ----
+ This is a test of the script language.
+
+ If after adding a new test, the test output doesn't appear properly in
+! test49.failed, try to add one ore more "G"s at the line ending in "test.out"
+
+ STARTTEST
+ :so small.vim
+ :se nocp nomore viminfo+=nviminfo
+ :so test49.vim
+! GGGGGGGGGGGGGG"rp:.-,$w! test.out
+! :"
+! :" make valgrind happy
+! :redir => funclist
+! :silent func
+! :redir END
+! :for line in split(funclist, "\n")
+! : let name = matchstr(line, 'function \zs[A-Z]\w*\ze(')
+! : if name != ''
+! : exe "delfunc " . name
+! : endif
+! :endfor
+! :for v in keys(g:)
+! : silent! exe "unlet " . v
+! :endfor
+! :unlet v
+! :qa!
+ ENDTEST
+
+ Results of test49.vim:
+*** ../vim-7.1.119/src/testdir/test55.in Sat May 5 20:03:56 2007
+--- src/testdir/test55.in Mon Sep 17 19:53:48 2007
+***************
+*** 345,350 ****
+--- 345,354 ----
+ :endfun
+ :call Test(1, 2, [3, 4], {5: 6}) " This may take a while
+ :"
++ :delfunc Test
++ :unlet dict
++ :call garbagecollect(1)
++ :"
+ :/^start:/,$wq! test.out
+ ENDTEST
+
+*** ../vim-7.1.119/src/testdir/test56.in Tue Sep 5 13:36:02 2006
+--- src/testdir/test56.in Sun Sep 16 17:54:20 2007
+***************
+*** 17,21 ****
+ fun s:DoNothing()
+ call append(line('$'), "nothing line")
+ endfun
+! nnoremap <buffer> _x :call <SID>DoNothing()<bar>call <SID>DoLast()<cr>
+ end:
+--- 17,21 ----
+ fun s:DoNothing()
+ call append(line('$'), "nothing line")
+ endfun
+! nnoremap <buffer> _x :call <SID>DoNothing()<bar>call <SID>DoLast()<bar>delfunc <SID>DoNothing<bar>delfunc <SID>DoLast<cr>
+ end:
+*** ../vim-7.1.119/src/testdir/test58.in Wed Apr 5 22:38:56 2006
+--- src/testdir/test58.in Sun Sep 16 18:17:03 2007
+***************
+*** 86,91 ****
+--- 86,92 ----
+ :$put =str
+ `m]s:let [str, a] = spellbadword()
+ :$put =str
++ :unlet str a
+ :"
+ :" Postponed prefixes
+ :call TestOne('2', '1')
+***************
+*** 99,104 ****
+--- 100,109 ----
+ :"
+ :" NOSLITSUGS
+ :call TestOne('8', '8')
++ :"
++ :" clean up for valgrind
++ :delfunc TestOne
++ :set spl= enc=latin1
+ :"
+ gg:/^test output:/,$wq! test.out
+ ENDTEST
+*** ../vim-7.1.119/src/testdir/test59.in Wed Apr 5 22:27:11 2006
+--- src/testdir/test59.in Sun Sep 16 18:17:23 2007
+***************
+*** 90,95 ****
+--- 90,96 ----
+ :$put =str
+ `m]s:let [str, a] = spellbadword()
+ :$put =str
++ :unlet str a
+ :"
+ :" Postponed prefixes
+ :call TestOne('2', '1')
+***************
+*** 100,105 ****
+--- 101,110 ----
+ :call TestOne('5', '5')
+ :call TestOne('6', '6')
+ :call TestOne('7', '7')
++ :"
++ :" clean up for valgrind
++ :delfunc TestOne
++ :set spl= enc=latin1
+ :"
+ gg:/^test output:/,$wq! test.out
+ ENDTEST
+*** ../vim-7.1.119/src/testdir/test60.in Fri May 5 23:11:11 2006
+--- src/testdir/test60.in Mon Sep 17 19:58:43 2007
+***************
+*** 569,574 ****
+--- 569,577 ----
+ redir END
+ endfunction
+ :call TestExists()
++ :delfunc TestExists
++ :delfunc RunTest
++ :delfunc TestFuncArg
+ :edit! test.out
+ :set ff=unix
+ :w
+*** ../vim-7.1.119/src/testdir/test60.vim Fri Jan 13 00:14:55 2006
+--- src/testdir/test60.vim Mon Sep 17 19:56:02 2007
+***************
+*** 94,97 ****
+--- 94,98 ----
+ else
+ echo "FAILED"
+ endif
++ unlet str
+
+*** ../vim-7.1.119/src/testdir/test62.in Sun Apr 30 20:28:14 2006
+--- src/testdir/test62.in Sun Sep 16 17:24:04 2007
+***************
+*** 7,12 ****
+--- 7,13 ----
+ :let nr = tabpagenr()
+ :q
+ :call append(line('$'), 'tab page ' . nr)
++ :unlet nr
+ :"
+ :" Open three tab pages and use ":tabdo"
+ :0tabnew
+***************
+*** 23,28 ****
+--- 24,30 ----
+ :q!
+ :call append(line('$'), line1)
+ :call append(line('$'), line2)
++ :unlet line1 line2
+ :"
+ :"
+ :/^Results/,$w! test.out
+*** ../vim-7.1.119/src/testdir/test63.in Thu Jul 26 22:55:11 2007
+--- src/testdir/test63.in Sun Sep 16 17:11:07 2007
+***************
+*** 60,66 ****
+ :else
+ : let @r .= "FAILED\n"
+ :endif
+! :" --- Check that "matchdelete()" returns 0 if succesfull and otherwise -1.
+ :let @r .= "*** Test 6: "
+ :let m = matchadd("MyGroup1", "TODO")
+ :let r1 = matchdelete(m)
+--- 60,66 ----
+ :else
+ : let @r .= "FAILED\n"
+ :endif
+! :" --- Check that "matchdelete()" returns 0 if successful and otherwise -1.
+ :let @r .= "*** Test 6: "
+ :let m = matchadd("MyGroup1", "TODO")
+ :let r1 = matchdelete(m)
+***************
+*** 117,123 ****
+ :" --- Check that "setmatches()" will not add two matches with the same ID. The
+ :" --- expected behaviour (for now) is to add the first match but not the
+ :" --- second and to return 0 (even though it is a matter of debate whether
+! :" --- this can be considered succesfull behaviour).
+ :let @r .= "*** Test 9: "
+ :let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])
+ :if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}] && r1 == 0
+--- 117,123 ----
+ :" --- Check that "setmatches()" will not add two matches with the same ID. The
+ :" --- expected behaviour (for now) is to add the first match but not the
+ :" --- second and to return 0 (even though it is a matter of debate whether
+! :" --- this can be considered successful behaviour).
+ :let @r .= "*** Test 9: "
+ :let r1 = setmatches([{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 'pattern': 'FIXME', 'priority': 10, 'id': 1}])
+ :if getmatches() == [{'group': 'MyGroup1', 'pattern': 'TODO', 'priority': 10, 'id': 1}] && r1 == 0
+***************
+*** 127,133 ****
+ :endif
+ :call clearmatches()
+ :unlet r1
+! :" --- Check that "setmatches()" returns 0 if succesfull and otherwise -1.
+ :" --- (A range of valid and invalid input values are tried out to generate the
+ :" --- return values.)
+ :let @r .= "*** Test 10: "
+--- 127,133 ----
+ :endif
+ :call clearmatches()
+ :unlet r1
+! :" --- Check that "setmatches()" returns 0 if successful and otherwise -1.
+ :" --- (A range of valid and invalid input values are tried out to generate the
+ :" --- return values.)
+ :let @r .= "*** Test 10: "
+*** ../vim-7.1.119/src/testdir/test64.in Tue Aug 14 17:28:14 2007
+--- src/testdir/test64.in Sun Sep 16 17:43:03 2007
+***************
+*** 44,51 ****
+--- 44,53 ----
+ : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
+ : endif
+ : endfor
++ : unlet i
+ : endif
+ :endfor
++ :unlet t tl e l
+ :/^Results/,$wq! test.out
+ ENDTEST
+
+*** ../vim-7.1.119/src/version.c Tue Sep 25 14:50:19 2007
+--- src/version.c Tue Sep 25 17:36:22 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 120,
+ /**/
+
+--
+BEDEVERE: How do you know so much about swallows?
+ARTHUR: Well you have to know these things when you're a king, you know.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.121
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.121
+Problem: Using ":cd %:h" when editing a file in the current directory
+ results in an error message for using an empty string.
+Solution: When "%:h" results in an empty string use ".".
+Files: src/eval.c
+
+
+*** ../vim-7.1.120/src/eval.c Tue Sep 25 17:54:41 2007
+--- src/eval.c Sun Sep 16 19:24:49 2007
+***************
+*** 21308,21321 ****
+ *usedlen += 2;
+ s = get_past_head(*fnamep);
+ while (tail > s && after_pathsep(s, tail))
+! --tail;
+ *fnamelen = (int)(tail - *fnamep);
+ #ifdef VMS
+ if (*fnamelen > 0)
+ *fnamelen += 1; /* the path separator is part of the path */
+ #endif
+! while (tail > s && !after_pathsep(s, tail))
+! mb_ptr_back(*fnamep, tail);
+ }
+
+ /* ":8" - shortname */
+--- 21308,21334 ----
+ *usedlen += 2;
+ s = get_past_head(*fnamep);
+ while (tail > s && after_pathsep(s, tail))
+! mb_ptr_back(*fnamep, tail);
+ *fnamelen = (int)(tail - *fnamep);
+ #ifdef VMS
+ if (*fnamelen > 0)
+ *fnamelen += 1; /* the path separator is part of the path */
+ #endif
+! if (*fnamelen == 0)
+! {
+! /* Result is empty. Turn it into "." to make ":cd %:h" work. */
+! p = vim_strsave((char_u *)".");
+! if (p == NULL)
+! return -1;
+! vim_free(*bufp);
+! *bufp = *fnamep = tail = p;
+! *fnamelen = 1;
+! }
+! else
+! {
+! while (tail > s && !after_pathsep(s, tail))
+! mb_ptr_back(*fnamep, tail);
+! }
+ }
+
+ /* ":8" - shortname */
+*** ../vim-7.1.120/src/version.c Tue Sep 25 17:54:41 2007
+--- src/version.c Tue Sep 25 20:38:08 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 121,
+ /**/
+
+--
+It is illegal for anyone to try and stop a child from playfully jumping over
+puddles of water.
+ [real standing law in California, United States of America]
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.122
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.122
+Problem: Mac: building Vim.app fails. Using wrong architecture.
+Solution: Use line continuation for the gui_bundle dependency. Detect the
+ system architecture with "uname -a".
+Files: src/main.aap
+
+
+*** ../vim-7.1.121/src/main.aap Thu May 10 18:48:19 2007
+--- src/main.aap Tue Sep 25 21:26:03 2007
+***************
+*** 56,64 ****
+ config {virtual} auto/config.h auto/config.aap :
+ auto/configure.aap configure.aap
+ config.arg config.h.in config.aap.in
+ :sys CONFIG_STATUS=auto/config.status
+ ./configure.aap `file2string("config.arg")`
+! --with-mac-arch=ppc
+ --cache-file=auto/config.cache
+
+ # Configure arguments: create an empty "config.arg" file when its missing
+--- 56,71 ----
+ config {virtual} auto/config.h auto/config.aap :
+ auto/configure.aap configure.aap
+ config.arg config.h.in config.aap.in
++ # Use "uname -a" to detect the architecture of the system.
++ @ok, uname = redir_system('uname -a', 0)
++ @if string.find(uname, "i386") >= 0:
++ @ arch = "i386"
++ @else:
++ @ arch = "ppc"
++ :print Building for $arch system
+ :sys CONFIG_STATUS=auto/config.status
+ ./configure.aap `file2string("config.arg")`
+! --with-mac-arch=$arch
+ --cache-file=auto/config.cache
+
+ # Configure arguments: create an empty "config.arg" file when its missing
+***************
+*** 1167,1173 ****
+ :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime
+ # TODO: Create the vimtutor application.
+
+! gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info
+ bundle-resource bundle-language
+
+ bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET)
+--- 1174,1180 ----
+ :symlink `os.getcwd()`/../runtime $RESDIR/vim/runtime
+ # TODO: Create the vimtutor application.
+
+! gui_bundle {virtual}: $(RESDIR) bundle-dir bundle-executable bundle-info \
+ bundle-resource bundle-language
+
+ bundle-dir {virtual}: $(APPDIR)/Contents $(VIMTARGET)
+***************
+*** 1187,1193 ****
+ :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
+
+ bundle-resource {virtual}: bundle-dir bundle-rsrc
+! :copy {force} $(RSRC_DIR)/*.icns $(RESDIR)
+
+ ### Classic resources
+ # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
+--- 1194,1200 ----
+ :sys m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
+
+ bundle-resource {virtual}: bundle-dir bundle-rsrc
+! :copy {force} $(RSRC_DIR)/*.icns $(RESDIR)
+
+ ### Classic resources
+ # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
+*** ../vim-7.1.121/src/version.c Tue Sep 25 20:39:14 2007
+--- src/version.c Tue Sep 25 22:12:16 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 122,
+ /**/
+
+--
+Men may not be seen publicly in any kind of strapless gown.
+ [real standing law in Florida, United States of America]
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.123
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.123
+Problem: Win32: ":edit foo ~ foo" expands "~".
+Solution: Change the call to expand_env().
+Files: src/ex_docmd.c, src/misc1.c, src/proto/misc1.pro, src/option.c
+
+
+*** ../vim-7.1.122/src/ex_docmd.c Sun Aug 19 22:42:27 2007
+--- src/ex_docmd.c Wed Sep 26 20:29:36 2007
+***************
+*** 4403,4409 ****
+ || vim_strchr(eap->arg, '~') != NULL)
+ {
+ expand_env_esc(eap->arg, NameBuff, MAXPATHL,
+! TRUE, NULL);
+ has_wildcards = mch_has_wildcard(NameBuff);
+ p = NameBuff;
+ }
+--- 4402,4408 ----
+ || vim_strchr(eap->arg, '~') != NULL)
+ {
+ expand_env_esc(eap->arg, NameBuff, MAXPATHL,
+! TRUE, TRUE, NULL);
+ has_wildcards = mch_has_wildcard(NameBuff);
+ p = NameBuff;
+ }
+*** ../vim-7.1.122/src/misc1.c Tue Aug 14 22:15:53 2007
+--- src/misc1.c Tue Sep 25 17:30:01 2007
+***************
+*** 3506,3514 ****
+ #endif
+
+ /*
+ * Expand environment variable with path name.
+ * "~/" is also expanded, using $HOME. For Unix "~user/" is expanded.
+! * Skips over "\ ", "\~" and "\$".
+ * If anything fails no expansion is done and dst equals src.
+ */
+ void
+--- 3506,3543 ----
+ #endif
+
+ /*
++ * Call expand_env() and store the result in an allocated string.
++ * This is not very memory efficient, this expects the result to be freed
++ * again soon.
++ */
++ char_u *
++ expand_env_save(src)
++ char_u *src;
++ {
++ return expand_env_save_opt(src, FALSE);
++ }
++
++ /*
++ * Idem, but when "one" is TRUE handle the string as one file name, only
++ * expand "~" at the start.
++ */
++ char_u *
++ expand_env_save_opt(src, one)
++ char_u *src;
++ int one;
++ {
++ char_u *p;
++
++ p = alloc(MAXPATHL);
++ if (p != NULL)
++ expand_env_esc(src, p, MAXPATHL, FALSE, one, NULL);
++ return p;
++ }
++
++ /*
+ * Expand environment variable with path name.
+ * "~/" is also expanded, using $HOME. For Unix "~user/" is expanded.
+! * Skips over "\ ", "\~" and "\$" (not for Win32 though).
+ * If anything fails no expansion is done and dst equals src.
+ */
+ void
+***************
+*** 3517,3531 ****
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+ {
+! expand_env_esc(src, dst, dstlen, FALSE, NULL);
+ }
+
+ void
+! expand_env_esc(srcp, dst, dstlen, esc, startstr)
+ char_u *srcp; /* input string e.g. "$HOME/vim.hlp" */
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+ int esc; /* escape spaces in expanded variables */
+ char_u *startstr; /* start again after this (can be NULL) */
+ {
+ char_u *src;
+--- 3546,3561 ----
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+ {
+! expand_env_esc(src, dst, dstlen, FALSE, FALSE, NULL);
+ }
+
+ void
+! expand_env_esc(srcp, dst, dstlen, esc, one, startstr)
+ char_u *srcp; /* input string e.g. "$HOME/vim.hlp" */
+ char_u *dst; /* where to put the result */
+ int dstlen; /* maximum length of the result */
+ int esc; /* escape spaces in expanded variables */
++ int one; /* "srcp" is one file name */
+ char_u *startstr; /* start again after this (can be NULL) */
+ {
+ char_u *src;
+***************
+*** 3766,3771 ****
+--- 3796,3803 ----
+ {
+ /*
+ * Recognize the start of a new name, for '~'.
++ * Don't do this when "one" is TRUE, to avoid expanding "~" in
++ * ":edit foo ~ foo".
+ */
+ at_start = FALSE;
+ if (src[0] == '\\' && src[1] != NUL)
+***************
+*** 3773,3779 ****
+ *dst++ = *src++;
+ --dstlen;
+ }
+! else if (src[0] == ' ' || src[0] == ',')
+ at_start = TRUE;
+ *dst++ = *src++;
+ --dstlen;
+--- 3805,3811 ----
+ *dst++ = *src++;
+ --dstlen;
+ }
+! else if ((src[0] == ' ' || src[0] == ',') && !one)
+ at_start = TRUE;
+ *dst++ = *src++;
+ --dstlen;
+***************
+*** 4070,4092 ****
+ }
+
+ /*
+- * Call expand_env() and store the result in an allocated string.
+- * This is not very memory efficient, this expects the result to be freed
+- * again soon.
+- */
+- char_u *
+- expand_env_save(src)
+- char_u *src;
+- {
+- char_u *p;
+-
+- p = alloc(MAXPATHL);
+- if (p != NULL)
+- expand_env(src, p, MAXPATHL);
+- return p;
+- }
+-
+- /*
+ * Our portable version of setenv.
+ */
+ void
+--- 4102,4107 ----
+***************
+*** 9139,9145 ****
+ */
+ if (vim_strpbrk(p, (char_u *)"$~") != NULL)
+ {
+! p = expand_env_save(p);
+ if (p == NULL)
+ p = pat[i];
+ #ifdef UNIX
+--- 9154,9160 ----
+ */
+ if (vim_strpbrk(p, (char_u *)"$~") != NULL)
+ {
+! p = expand_env_save_opt(p, TRUE);
+ if (p == NULL)
+ p = pat[i];
+ #ifdef UNIX
+*** ../vim-7.1.122/src/proto/misc1.pro Sat May 5 20:15:33 2007
+--- src/proto/misc1.pro Tue Sep 25 17:22:36 2007
+***************
+*** 48,57 ****
+ void vim_beep __ARGS((void));
+ void init_homedir __ARGS((void));
+ void free_homedir __ARGS((void));
+ void expand_env __ARGS((char_u *src, char_u *dst, int dstlen));
+! void expand_env_esc __ARGS((char_u *srcp, char_u *dst, int dstlen, int esc, char_u *startstr));
+ char_u *vim_getenv __ARGS((char_u *name, int *mustfree));
+- char_u *expand_env_save __ARGS((char_u *src));
+ void vim_setenv __ARGS((char_u *name, char_u *val));
+ char_u *get_env_name __ARGS((expand_T *xp, int idx));
+ void home_replace __ARGS((buf_T *buf, char_u *src, char_u *dst, int dstlen, int one));
+--- 48,58 ----
+ void vim_beep __ARGS((void));
+ void init_homedir __ARGS((void));
+ void free_homedir __ARGS((void));
++ char_u *expand_env_save __ARGS((char_u *src));
++ char_u *expand_env_save_opt __ARGS((char_u *src, int one));
+ void expand_env __ARGS((char_u *src, char_u *dst, int dstlen));
+! void expand_env_esc __ARGS((char_u *srcp, char_u *dst, int dstlen, int esc, int one, char_u *startstr));
+ char_u *vim_getenv __ARGS((char_u *name, int *mustfree));
+ void vim_setenv __ARGS((char_u *name, char_u *val));
+ char_u *get_env_name __ARGS((expand_T *xp, int idx));
+ void home_replace __ARGS((buf_T *buf, char_u *src, char_u *dst, int dstlen, int one));
+*** ../vim-7.1.122/src/option.c Tue Sep 25 14:50:19 2007
+--- src/option.c Tue Sep 25 17:20:05 2007
+***************
+*** 4996,5002 ****
+ * For 'spellsuggest' expand after "file:".
+ */
+ expand_env_esc(val, NameBuff, MAXPATHL,
+! (char_u **)options[opt_idx].var == &p_tags,
+ #ifdef FEAT_SPELL
+ (char_u **)options[opt_idx].var == &p_sps ? (char_u *)"file:" :
+ #endif
+--- 4996,5002 ----
+ * For 'spellsuggest' expand after "file:".
+ */
+ expand_env_esc(val, NameBuff, MAXPATHL,
+! (char_u **)options[opt_idx].var == &p_tags, FALSE,
+ #ifdef FEAT_SPELL
+ (char_u **)options[opt_idx].var == &p_sps ? (char_u *)"file:" :
+ #endif
+*** ../vim-7.1.122/src/version.c Tue Sep 25 22:13:14 2007
+--- src/version.c Wed Sep 26 22:30:59 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 123,
+ /**/
+
+--
+So when I saw the post to comp.editors, I rushed over to the FTP site to
+grab it. So I yank apart the tarball, light x candles, where x= the
+vim version multiplied by the md5sum of the source divided by the MAC of
+my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
+wave a dead chicken over the hard drive, and summon the power of GNU GCC
+with the magic words "make config ; make!".
+ [Jason Spence, compiling Vim 5.0]
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.124
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.124 (extra)
+Problem: Mac: When dropping a file on Vim.app that is already in the buffer
+ list (from .viminfo) results in editing an empty, unnamed buffer.
+ (Axel Kielhorn) Also: warning for unused variable.
+Solution: Move to the buffer of the first agument. Delete unused variable.
+Files: src/gui_mac.c
+
+
+*** ../vim-7.1.123/src/gui_mac.c Thu Aug 30 12:50:00 2007
+--- src/gui_mac.c Sat Sep 29 13:12:26 2007
+***************
+*** 1046,1051 ****
+--- 1046,1052 ----
+ {
+ int i;
+ char_u *p;
++ int fnum = -1;
+
+ /* these are the initial files dropped on the Vim icon */
+ for (i = 0 ; i < numFiles; i++)
+***************
+*** 1055,1060 ****
+--- 1056,1073 ----
+ mch_exit(2);
+ else
+ alist_add(&global_alist, p, 2);
++ if (fnum == -1)
++ fnum = GARGLIST[GARGCOUNT - 1].ae_fnum;
++ }
++
++ /* If the file name was already in the buffer list we need to switch
++ * to it. */
++ if (curbuf->b_fnum != fnum)
++ {
++ char_u cmd[30];
++
++ vim_snprintf((char *)cmd, 30, "silent %dbuffer", fnum);
++ do_cmdline_cmd(cmd);
+ }
+
+ /* Change directory to the location of the first file. */
+***************
+*** 2920,2926 ****
+ /* TODO: Move most of this stuff toward gui_mch_init */
+ Rect windRect;
+ MenuHandle pomme;
+- long gestalt_rc;
+ EventTypeSpec eventTypeSpec;
+ EventHandlerRef mouseWheelHandlerRef;
+ #ifdef USE_CARBONKEYHANDLER
+--- 2933,2938 ----
+*** ../vim-7.1.123/src/version.c Wed Sep 26 22:35:06 2007
+--- src/version.c Sat Sep 29 13:13:16 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 124,
+ /**/
+
+--
+ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
+ KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
+ HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
+ LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
+ BROTHER MAYNARD
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.125
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.125
+Problem: The TermResponse autocommand event is not always triggered. (Aron
+ Griffis)
+Solution: When unblocking autocommands check if v:termresponse changed and
+ trigger the event then.
+Files: src/buffer.c, src/diff.c, src/ex_getln.c, src/fileio.c,
+ src/globals.h, src/misc2.c, src/proto/fileio.pro, src/window.c
+
+
+*** ../vim-7.1.124/src/buffer.c Sun Aug 12 15:50:26 2007
+--- src/buffer.c Wed Sep 26 20:05:38 2007
+***************
+*** 5515,5525 ****
+
+ #ifdef FEAT_AUTOCMD
+ if (!aucmd) /* Don't trigger BufDelete autocommands here. */
+! ++autocmd_block;
+ #endif
+ close_buffer(NULL, buf, DOBUF_WIPE);
+ #ifdef FEAT_AUTOCMD
+ if (!aucmd)
+! --autocmd_block;
+ #endif
+ }
+--- 5512,5522 ----
+
+ #ifdef FEAT_AUTOCMD
+ if (!aucmd) /* Don't trigger BufDelete autocommands here. */
+! block_autocmds();
+ #endif
+ close_buffer(NULL, buf, DOBUF_WIPE);
+ #ifdef FEAT_AUTOCMD
+ if (!aucmd)
+! unblock_autocmds();
+ #endif
+ }
+*** ../vim-7.1.124/src/diff.c Tue Feb 20 04:43:13 2007
+--- src/diff.c Tue Sep 25 22:01:40 2007
+***************
+*** 840,850 ****
+ tmp_orig, tmp_new);
+ append_redir(cmd, p_srr, tmp_diff);
+ #ifdef FEAT_AUTOCMD
+! ++autocmd_block; /* Avoid ShellCmdPost stuff */
+ #endif
+ (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT);
+ #ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ #endif
+ vim_free(cmd);
+ }
+--- 840,850 ----
+ tmp_orig, tmp_new);
+ append_redir(cmd, p_srr, tmp_diff);
+ #ifdef FEAT_AUTOCMD
+! block_autocmds(); /* Avoid ShellCmdPost stuff */
+ #endif
+ (void)call_shell(cmd, SHELL_FILTER|SHELL_SILENT|SHELL_DOOUT);
+ #ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ #endif
+ vim_free(cmd);
+ }
+***************
+*** 949,959 ****
+ # endif
+ eap->arg);
+ #ifdef FEAT_AUTOCMD
+! ++autocmd_block; /* Avoid ShellCmdPost stuff */
+ #endif
+ (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED);
+ #ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ #endif
+ }
+
+--- 949,959 ----
+ # endif
+ eap->arg);
+ #ifdef FEAT_AUTOCMD
+! block_autocmds(); /* Avoid ShellCmdPost stuff */
+ #endif
+ (void)call_shell(buf, SHELL_FILTER | SHELL_COOKED);
+ #ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ #endif
+ }
+
+*** ../vim-7.1.124/src/ex_getln.c Thu Sep 13 18:25:08 2007
+--- src/ex_getln.c Tue Sep 25 22:03:05 2007
+***************
+*** 5925,5931 ****
+
+ # ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while creating the window. */
+! ++autocmd_block;
+ # endif
+ /* don't use a new tab page */
+ cmdmod.tab = 0;
+--- 5925,5931 ----
+
+ # ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while creating the window. */
+! block_autocmds();
+ # endif
+ /* don't use a new tab page */
+ cmdmod.tab = 0;
+***************
+*** 5934,5939 ****
+--- 5934,5942 ----
+ if (win_split((int)p_cwh, WSP_BOT) == FAIL)
+ {
+ beep_flush();
++ # ifdef FEAT_AUTOCMD
++ unblock_autocmds();
++ # endif
+ return K_IGNORE;
+ }
+ cmdwin_type = ccline.cmdfirstc;
+***************
+*** 5956,5962 ****
+
+ # ifdef FEAT_AUTOCMD
+ /* Do execute autocommands for setting the filetype (load syntax). */
+! --autocmd_block;
+ # endif
+
+ /* Showing the prompt may have set need_wait_return, reset it. */
+--- 5959,5965 ----
+
+ # ifdef FEAT_AUTOCMD
+ /* Do execute autocommands for setting the filetype (load syntax). */
+! unblock_autocmds();
+ # endif
+
+ /* Showing the prompt may have set need_wait_return, reset it. */
+***************
+*** 6110,6116 ****
+
+ # ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while deleting the window. */
+! ++autocmd_block;
+ # endif
+ wp = curwin;
+ bp = curbuf;
+--- 6113,6119 ----
+
+ # ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while deleting the window. */
+! block_autocmds();
+ # endif
+ wp = curwin;
+ bp = curbuf;
+***************
+*** 6122,6128 ****
+ win_size_restore(&winsizes);
+
+ # ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ # endif
+ }
+
+--- 6125,6131 ----
+ win_size_restore(&winsizes);
+
+ # ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ # endif
+ }
+
+*** ../vim-7.1.124/src/fileio.c Sun Aug 12 15:50:26 2007
+--- src/fileio.c Wed Sep 26 20:02:54 2007
+***************
+*** 7165,7170 ****
+--- 7187,7193 ----
+
+ static event_T last_event;
+ static int last_group;
++ static int autocmd_blocked = 0; /* block all autocmds */
+
+ /*
+ * Show the autocommands for one AutoPat.
+***************
+*** 8454,8460 ****
+ * Quickly return if there are no autocommands for this event or
+ * autocommands are blocked.
+ */
+! if (first_autopat[(int)event] == NULL || autocmd_block > 0)
+ goto BYPASS_AU;
+
+ /*
+--- 8477,8483 ----
+ * Quickly return if there are no autocommands for this event or
+ * autocommands are blocked.
+ */
+! if (first_autopat[(int)event] == NULL || autocmd_blocked > 0)
+ goto BYPASS_AU;
+
+ /*
+***************
+*** 8766,8771 ****
+--- 8789,8828 ----
+ aubuflocal_remove(buf);
+
+ return retval;
++ }
++
++ # ifdef FEAT_EVAL
++ static char_u *old_termresponse = NULL;
++ # endif
++
++ /*
++ * Block triggering autocommands until unblock_autocmd() is called.
++ * Can be used recursively, so long as it's symmetric.
++ */
++ void
++ block_autocmds()
++ {
++ # ifdef FEAT_EVAL
++ /* Remember the value of v:termresponse. */
++ if (autocmd_blocked == 0)
++ old_termresponse = get_vim_var_str(VV_TERMRESPONSE);
++ # endif
++ ++autocmd_blocked;
++ }
++
++ void
++ unblock_autocmds()
++ {
++ --autocmd_blocked;
++
++ # ifdef FEAT_EVAL
++ /* When v:termresponse was set while autocommands were blocked, trigger
++ * the autocommands now. Esp. useful when executing a shell command
++ * during startup (vimdiff). */
++ if (autocmd_blocked == 0
++ && get_vim_var_str(VV_TERMRESPONSE) != old_termresponse)
++ apply_autocmds(EVENT_TERMRESPONSE, NULL, NULL, FALSE, curbuf);
++ # endif
+ }
+
+ /*
+*** ../vim-7.1.124/src/globals.h Tue Sep 25 17:54:41 2007
+--- src/globals.h Tue Sep 25 22:03:39 2007
+***************
+*** 366,372 ****
+ EXTERN int autocmd_busy INIT(= FALSE); /* Is apply_autocmds() busy? */
+ EXTERN int autocmd_no_enter INIT(= FALSE); /* *Enter autocmds disabled */
+ EXTERN int autocmd_no_leave INIT(= FALSE); /* *Leave autocmds disabled */
+- EXTERN int autocmd_block INIT(= 0); /* block all autocmds */
+ EXTERN int modified_was_set; /* did ":set modified" */
+ EXTERN int did_filetype INIT(= FALSE); /* FileType event found */
+ EXTERN int keep_filetype INIT(= FALSE); /* value for did_filetype when
+--- 366,371 ----
+*** ../vim-7.1.124/src/misc2.c Thu May 10 19:58:47 2007
+--- src/misc2.c Tue Sep 25 22:04:39 2007
+***************
+*** 972,978 ****
+ return;
+ entered = TRUE;
+
+! ++autocmd_block; /* don't want to trigger autocommands here */
+
+ #ifdef FEAT_WINDOWS
+ /* close all tabs and windows */
+--- 973,979 ----
+ return;
+ entered = TRUE;
+
+! block_autocmds(); /* don't want to trigger autocommands here */
+
+ #ifdef FEAT_WINDOWS
+ /* close all tabs and windows */
+*** ../vim-7.1.124/src/proto/fileio.pro Thu Jun 28 21:57:08 2007
+--- src/proto/fileio.pro Wed Sep 26 20:05:02 2007
+***************
+*** 40,45 ****
+--- 41,48 ----
+ int trigger_cursorhold __ARGS((void));
+ int has_cursormoved __ARGS((void));
+ int has_cursormovedI __ARGS((void));
++ void block_autocmds __ARGS((void));
++ void unblock_autocmds __ARGS((void));
+ int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
+ char_u *get_augroup_name __ARGS((expand_T *xp, int idx));
+ char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd));
+*** ../vim-7.1.124/src/window.c Tue Sep 25 14:50:19 2007
+--- src/window.c Tue Sep 25 22:05:45 2007
+***************
+*** 1291,1297 ****
+ * Don't execute autocommands while creating the windows. Must do that
+ * when putting the buffers in the windows.
+ */
+! ++autocmd_block;
+ #endif
+
+ /* todo is number of windows left to create */
+--- 1291,1297 ----
+ * Don't execute autocommands while creating the windows. Must do that
+ * when putting the buffers in the windows.
+ */
+! block_autocmds();
+ #endif
+
+ /* todo is number of windows left to create */
+***************
+*** 1313,1319 ****
+ }
+
+ #ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ #endif
+
+ /* return actual number of windows */
+--- 1313,1319 ----
+ }
+
+ #ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ #endif
+
+ /* return actual number of windows */
+***************
+*** 3415,3421 ****
+ * Don't execute autocommands while creating the tab pages. Must do that
+ * when putting the buffers in the windows.
+ */
+! ++autocmd_block;
+ #endif
+
+ for (todo = count - 1; todo > 0; --todo)
+--- 3415,3421 ----
+ * Don't execute autocommands while creating the tab pages. Must do that
+ * when putting the buffers in the windows.
+ */
+! block_autocmds();
+ #endif
+
+ for (todo = count - 1; todo > 0; --todo)
+***************
+*** 3423,3429 ****
+ break;
+
+ #ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ #endif
+
+ /* return actual number of tab pages */
+--- 3423,3429 ----
+ break;
+
+ #ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ #endif
+
+ /* return actual number of tab pages */
+***************
+*** 4162,4168 ****
+ /* Don't execute autocommands while the window is not properly
+ * initialized yet. gui_create_scrollbar() may trigger a FocusGained
+ * event. */
+! ++autocmd_block;
+ #endif
+ /*
+ * link the window in the window list
+--- 4162,4168 ----
+ /* Don't execute autocommands while the window is not properly
+ * initialized yet. gui_create_scrollbar() may trigger a FocusGained
+ * event. */
+! block_autocmds();
+ #endif
+ /*
+ * link the window in the window list
+***************
+*** 4207,4213 ****
+ foldInitWin(newwin);
+ #endif
+ #ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ #endif
+ #ifdef FEAT_SEARCH_EXTRA
+ newwin->w_match_head = NULL;
+--- 4207,4213 ----
+ foldInitWin(newwin);
+ #endif
+ #ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ #endif
+ #ifdef FEAT_SEARCH_EXTRA
+ newwin->w_match_head = NULL;
+***************
+*** 4232,4238 ****
+ #ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while the window is halfway being deleted.
+ * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
+! ++autocmd_block;
+ #endif
+
+ #ifdef FEAT_MZSCHEME
+--- 4232,4238 ----
+ #ifdef FEAT_AUTOCMD
+ /* Don't execute autocommands while the window is halfway being deleted.
+ * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */
+! block_autocmds();
+ #endif
+
+ #ifdef FEAT_MZSCHEME
+***************
+*** 4295,4301 ****
+ vim_free(wp);
+
+ #ifdef FEAT_AUTOCMD
+! --autocmd_block;
+ #endif
+ }
+
+--- 4295,4301 ----
+ vim_free(wp);
+
+ #ifdef FEAT_AUTOCMD
+! unblock_autocmds();
+ #endif
+ }
+
+*** ../vim-7.1.124/src/version.c Sat Sep 29 13:15:29 2007
+--- src/version.c Sat Sep 29 14:08:31 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 125,
+ /**/
+
+--
+MICHAEL PALIN PLAYED: 1ST SOLDIER WITH A KEEN INTEREST IN BIRDS, DENNIS, MR
+ DUCK (A VILLAGE CARPENTER WHO IS ALMOST KEENER THAN
+ ANYONE ELSE TO BURN WITCHES), THREE-HEADED KNIGHT, SIR
+ GALAHAD, KING OF SWAMP CASTLE, BROTHER MAYNARD'S ROOMATE
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.126
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.126
+Problem: ":vimgrep */*" fails when a BufRead autocommand changes directory.
+ (Bernhard Kuhn)
+Solution: Change back to the original directory after loading a file.
+ Also: use shorten_fname1() to avoid duplicating code.
+Files: src/buffer.c, src/ex_docmd.c, src/fileio.c, src/gui_gtk.c,
+ src/gui_w48.c, src/proto/ex_docmd.pro, src/proto/fileio.pro,
+ src/quickfix.c
+
+
+*** ../vim-7.1.125/src/buffer.c Sat Sep 29 14:15:00 2007
+--- src/buffer.c Wed Sep 26 20:05:38 2007
+***************
+*** 4261,4272 ****
+ do_arg_all(count, forceit, keep_tabs)
+ int count;
+ int forceit; /* hide buffers in current windows */
+! int keep_tabs; /* keep curren tabs, for ":tab drop file" */
+ {
+ int i;
+ win_T *wp, *wpnext;
+ char_u *opened; /* array of flags for which args are open */
+! int opened_len; /* lenght of opened[] */
+ int use_firstwin = FALSE; /* use first window for arglist */
+ int split_ret = OK;
+ int p_ea_save;
+--- 4261,4272 ----
+ do_arg_all(count, forceit, keep_tabs)
+ int count;
+ int forceit; /* hide buffers in current windows */
+! int keep_tabs; /* keep current tabs, for ":tab drop file" */
+ {
+ int i;
+ win_T *wp, *wpnext;
+ char_u *opened; /* array of flags for which args are open */
+! int opened_len; /* length of opened[] */
+ int use_firstwin = FALSE; /* use first window for arglist */
+ int split_ret = OK;
+ int p_ea_save;
+***************
+*** 4946,4955 ****
+ /* Expand "~/" in the file name at "line + 1" to a full path.
+ * Then try shortening it by comparing with the current directory */
+ expand_env(xline, NameBuff, MAXPATHL);
+! mch_dirname(IObuff, IOSIZE);
+! sfname = shorten_fname(NameBuff, IObuff);
+! if (sfname == NULL)
+! sfname = NameBuff;
+
+ buf = buflist_new(NameBuff, sfname, (linenr_T)0, BLN_LISTED);
+ if (buf != NULL) /* just in case... */
+--- 4946,4952 ----
+ /* Expand "~/" in the file name at "line + 1" to a full path.
+ * Then try shortening it by comparing with the current directory */
+ expand_env(xline, NameBuff, MAXPATHL);
+! sfname = shorten_fname1(NameBuff);
+
+ buf = buflist_new(NameBuff, sfname, (linenr_T)0, BLN_LISTED);
+ if (buf != NULL) /* just in case... */
+*** ../vim-7.1.125/src/ex_docmd.c Wed Sep 26 22:35:06 2007
+--- src/ex_docmd.c Wed Sep 26 20:29:36 2007
+***************
+*** 276,282 ****
+ static void ex_swapname __ARGS((exarg_T *eap));
+ static void ex_syncbind __ARGS((exarg_T *eap));
+ static void ex_read __ARGS((exarg_T *eap));
+- static void ex_cd __ARGS((exarg_T *eap));
+ static void ex_pwd __ARGS((exarg_T *eap));
+ static void ex_equal __ARGS((exarg_T *eap));
+ static void ex_sleep __ARGS((exarg_T *eap));
+--- 276,281 ----
+***************
+*** 7778,7784 ****
+ /*
+ * ":cd", ":lcd", ":chdir" and ":lchdir".
+ */
+! static void
+ ex_cd(eap)
+ exarg_T *eap;
+ {
+--- 7777,7783 ----
+ /*
+ * ":cd", ":lcd", ":chdir" and ":lchdir".
+ */
+! void
+ ex_cd(eap)
+ exarg_T *eap;
+ {
+*** ../vim-7.1.125/src/fileio.c Sat Sep 29 14:15:00 2007
+--- src/fileio.c Wed Sep 26 20:02:54 2007
+***************
+*** 114,120 ****
+ {
+ int bw_fd; /* file descriptor */
+ char_u *bw_buf; /* buffer with data to be written */
+! int bw_len; /* lenght of data */
+ #ifdef HAS_BW_FLAGS
+ int bw_flags; /* FIO_ flags */
+ #endif
+--- 114,120 ----
+ {
+ int bw_fd; /* file descriptor */
+ char_u *bw_buf; /* buffer with data to be written */
+! int bw_len; /* length of data */
+ #ifdef HAS_BW_FLAGS
+ int bw_flags; /* FIO_ flags */
+ #endif
+***************
+*** 5552,5557 ****
+--- 5553,5579 ----
+ return (int)(p - buf);
+ }
+ #endif
++
++ /*
++ * Try to find a shortname by comparing the fullname with the current
++ * directory.
++ * Returns "full_path" or pointer into "full_path" if shortened.
++ */
++ char_u *
++ shorten_fname1(full_path)
++ char_u *full_path;
++ {
++ char_u dirname[MAXPATHL];
++ char_u *p = full_path;
++
++ if (mch_dirname(dirname, MAXPATHL) == OK)
++ {
++ p = shorten_fname(full_path, dirname);
++ if (p == NULL || *p == NUL)
++ p = full_path;
++ }
++ return p;
++ }
+
+ /*
+ * Try to find a shortname by comparing the fullname with the current
+*** ../vim-7.1.125/src/gui_gtk.c Tue Aug 14 14:59:41 2007
+--- src/gui_gtk.c Wed Sep 26 20:07:58 2007
+***************
+*** 1272,1278 ****
+ GtkWidget *fc;
+ #endif
+ char_u dirbuf[MAXPATHL];
+- char_u *p;
+
+ # ifdef HAVE_GTK2
+ title = CONVERT_TO_UTF8(title);
+--- 1272,1277 ----
+***************
+*** 1363,1373 ****
+ return NULL;
+
+ /* shorten the file name if possible */
+! mch_dirname(dirbuf, MAXPATHL);
+! p = shorten_fname(gui.browse_fname, dirbuf);
+! if (p == NULL)
+! p = gui.browse_fname;
+! return vim_strsave(p);
+ }
+
+ #if defined(HAVE_GTK2) || defined(PROTO)
+--- 1362,1368 ----
+ return NULL;
+
+ /* shorten the file name if possible */
+! return vim_strsave(shorten_fname1(gui.browse_fname));
+ }
+
+ #if defined(HAVE_GTK2) || defined(PROTO)
+***************
+*** 1427,1437 ****
+ return NULL;
+
+ /* shorten the file name if possible */
+! mch_dirname(dirbuf, MAXPATHL);
+! p = shorten_fname(dirname, dirbuf);
+! if (p == NULL || *p == NUL)
+! p = dirname;
+! p = vim_strsave(p);
+ g_free(dirname);
+ return p;
+
+--- 1422,1428 ----
+ return NULL;
+
+ /* shorten the file name if possible */
+! p = vim_strsave(shorten_fname1(dirname));
+ g_free(dirname);
+ return p;
+
+*** ../vim-7.1.125/src/gui_w48.c Thu May 10 19:17:07 2007
+--- src/gui_w48.c Wed Sep 26 20:09:33 2007
+***************
+*** 3301,3311 ****
+ SetFocus(s_hwnd);
+
+ /* Shorten the file name if possible */
+! mch_dirname(IObuff, IOSIZE);
+! p = shorten_fname((char_u *)fileBuf, IObuff);
+! if (p == NULL)
+! p = (char_u *)fileBuf;
+! return vim_strsave(p);
+ }
+ # endif /* FEAT_MBYTE */
+
+--- 3301,3307 ----
+ SetFocus(s_hwnd);
+
+ /* Shorten the file name if possible */
+! return vim_strsave(shorten_fname1((char_u *)fileBuf));
+ }
+ # endif /* FEAT_MBYTE */
+
+***************
+*** 3450,3460 ****
+ SetFocus(s_hwnd);
+
+ /* Shorten the file name if possible */
+! mch_dirname(IObuff, IOSIZE);
+! p = shorten_fname((char_u *)fileBuf, IObuff);
+! if (p == NULL)
+! p = (char_u *)fileBuf;
+! return vim_strsave(p);
+ }
+ #endif /* FEAT_BROWSE */
+
+--- 3446,3452 ----
+ SetFocus(s_hwnd);
+
+ /* Shorten the file name if possible */
+! return vim_strsave(shorten_fname1((char_u *)fileBuf));
+ }
+ #endif /* FEAT_BROWSE */
+
+*** ../vim-7.1.125/src/proto/ex_docmd.pro Sun May 6 14:46:22 2007
+--- src/proto/ex_docmd.pro Wed Sep 26 20:30:10 2007
+***************
+*** 39,44 ****
+--- 39,45 ----
+ void tabpage_new __ARGS((void));
+ void do_exedit __ARGS((exarg_T *eap, win_T *old_curwin));
+ void free_cd_dir __ARGS((void));
++ void ex_cd __ARGS((exarg_T *eap));
+ void do_sleep __ARGS((long msec));
+ int vim_mkdir_emsg __ARGS((char_u *name, int prot));
+ FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode));
+*** ../vim-7.1.125/src/proto/fileio.pro Sat Sep 29 14:15:00 2007
+--- src/proto/fileio.pro Wed Sep 26 20:05:02 2007
+***************
+*** 6,11 ****
+--- 6,12 ----
+ int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering));
+ void msg_add_fname __ARGS((buf_T *buf, char_u *fname));
+ void msg_add_lines __ARGS((int insert_space, long lnum, long nchars));
++ char_u *shorten_fname1 __ARGS((char_u *full_path));
+ char_u *shorten_fname __ARGS((char_u *full_path, char_u *dir_name));
+ void shorten_fnames __ARGS((int force));
+ void shorten_filenames __ARGS((char_u **fnames, int count));
+*** ../vim-7.1.125/src/quickfix.c Sun Sep 16 13:26:56 2007
+--- src/quickfix.c Sun Sep 30 13:58:38 2007
+***************
+*** 2972,2977 ****
+--- 2972,2978 ----
+ regmmatch_T regmatch;
+ int fcount;
+ char_u **fnames;
++ char_u *fname;
+ char_u *s;
+ char_u *p;
+ int fi;
+***************
+*** 2995,3000 ****
+--- 2996,3004 ----
+ int flags = 0;
+ colnr_T col;
+ long tomatch;
++ char_u dirname_start[MAXPATHL];
++ char_u dirname_now[MAXPATHL];
++ char_u *target_dir = NULL;
+
+ switch (eap->cmdidx)
+ {
+***************
+*** 3069,3085 ****
+ goto theend;
+ }
+
+ seconds = (time_t)0;
+ for (fi = 0; fi < fcount && !got_int && tomatch > 0; ++fi)
+ {
+ if (time(NULL) > seconds)
+ {
+! /* Display the file name every second or so. */
+ seconds = time(NULL);
+ msg_start();
+! p = msg_strtrunc(fnames[fi], TRUE);
+ if (p == NULL)
+! msg_outtrans(fnames[fi]);
+ else
+ {
+ msg_outtrans(p);
+--- 3073,3095 ----
+ goto theend;
+ }
+
++ /* Remember the current directory, because a BufRead autocommand that does
++ * ":lcd %:p:h" changes the meaning of short path names. */
++ mch_dirname(dirname_start, MAXPATHL);
++
+ seconds = (time_t)0;
+ for (fi = 0; fi < fcount && !got_int && tomatch > 0; ++fi)
+ {
++ fname = shorten_fname1(fnames[fi]);
+ if (time(NULL) > seconds)
+ {
+! /* Display the file name every second or so, show the user we are
+! * working on it. */
+ seconds = time(NULL);
+ msg_start();
+! p = msg_strtrunc(fname, TRUE);
+ if (p == NULL)
+! msg_outtrans(fname);
+ else
+ {
+ msg_outtrans(p);
+***************
+*** 3111,3117 ****
+
+ /* Load file into a buffer, so that 'fileencoding' is detected,
+ * autocommands applied, etc. */
+! buf = load_dummy_buffer(fnames[fi]);
+
+ p_mls = save_mls;
+ #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+--- 3121,3139 ----
+
+ /* Load file into a buffer, so that 'fileencoding' is detected,
+ * autocommands applied, etc. */
+! buf = load_dummy_buffer(fname);
+!
+! /* When autocommands changed directory: go back. We assume it was
+! * ":lcd %:p:h". */
+! mch_dirname(dirname_now, MAXPATHL);
+! if (STRCMP(dirname_start, dirname_now) != 0)
+! {
+! exarg_T ea;
+!
+! ea.arg = dirname_start;
+! ea.cmdidx = CMD_lcd;
+! ex_cd(&ea);
+! }
+
+ p_mls = save_mls;
+ #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
+***************
+*** 3125,3131 ****
+ if (buf == NULL)
+ {
+ if (!got_int)
+! smsg((char_u *)_("Cannot open file \"%s\""), fnames[fi]);
+ }
+ else
+ {
+--- 3147,3153 ----
+ if (buf == NULL)
+ {
+ if (!got_int)
+! smsg((char_u *)_("Cannot open file \"%s\""), fname);
+ }
+ else
+ {
+***************
+*** 3139,3147 ****
+ while (vim_regexec_multi(®match, curwin, buf, lnum,
+ col) > 0)
+ {
+ if (qf_add_entry(qi, &prevp,
+ NULL, /* dir */
+! fnames[fi],
+ 0,
+ ml_get_buf(buf,
+ regmatch.startpos[0].lnum + lnum, FALSE),
+--- 3161,3170 ----
+ while (vim_regexec_multi(®match, curwin, buf, lnum,
+ col) > 0)
+ {
++ ;
+ if (qf_add_entry(qi, &prevp,
+ NULL, /* dir */
+! fname,
+ 0,
+ ml_get_buf(buf,
+ regmatch.startpos[0].lnum + lnum, FALSE),
+***************
+*** 3209,3214 ****
+--- 3232,3244 ----
+
+ if (buf != NULL)
+ {
++ /* If the buffer is still loaded we need to use the
++ * directory we jumped to below. */
++ if (buf == first_match_buf
++ && target_dir == NULL
++ && STRCMP(dirname_start, dirname_now) != 0)
++ target_dir = vim_strsave(dirname_now);
++
+ /* The buffer is still loaded, the Filetype autocommands
+ * need to be done now, in that buffer. And the modelines
+ * need to be done (again). But not the window-local
+***************
+*** 3252,3257 ****
+--- 3282,3297 ----
+ /* If we jumped to another buffer redrawing will already be
+ * taken care of. */
+ redraw_for_dummy = FALSE;
++
++ /* Jump to the directory used after loading the buffer. */
++ if (curbuf == first_match_buf && target_dir != NULL)
++ {
++ exarg_T ea;
++
++ ea.arg = target_dir;
++ ea.cmdidx = CMD_lcd;
++ ex_cd(&ea);
++ }
+ }
+ }
+ else
+***************
+*** 3269,3274 ****
+--- 3309,3315 ----
+ }
+
+ theend:
++ vim_free(target_dir);
+ vim_free(regmatch.regprog);
+ }
+
+*** ../vim-7.1.125/src/version.c Sat Sep 29 14:15:00 2007
+--- src/version.c Sun Sep 30 13:41:30 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 126,
+ /**/
+
+--
+The MS-Windows registry is no more hostile than any other bunch of state
+information... that is held in a binary format... a format that nobody
+understands... and is replicated and cached in a complex and largely
+undocumented way... and contains large amounts of duplicate and obfuscated
+information... (Ben Peterson)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: About patch 7.1.127
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.127
+Problem: Memory leak when doing cmdline completion. (Dominique Pelle)
+Solution: Free "orig" argument of ExpandOne() when it's not used.
+Files: src/ex_getln.c
+
+
+*** ../vim-7.1.126/src/ex_getln.c Sat Sep 29 14:15:00 2007
+--- src/ex_getln.c Sun Sep 30 17:55:47 2007
+***************
+*** 3316,3321 ****
+--- 3316,3325 ----
+ * Return a pointer to alloced memory containing the new string.
+ * Return NULL for failure.
+ *
++ * "orig" is the originally expanded string, copied to allocated memory. It
++ * should either be kept in orig_save or freed. When "mode" is WILD_NEXT or
++ * WILD_PREV "orig" should be NULL.
++ *
+ * Results are cached in xp->xp_files and xp->xp_numfiles, except when "mode"
+ * is WILD_EXPAND_FREE or WILD_ALL.
+ *
+***************
+*** 3400,3406 ****
+ return NULL;
+ }
+
+! /* free old names */
+ if (xp->xp_numfiles != -1 && mode != WILD_ALL && mode != WILD_LONGEST)
+ {
+ FreeWild(xp->xp_numfiles, xp->xp_files);
+--- 3404,3410 ----
+ return NULL;
+ }
+
+! /* free old names */
+ if (xp->xp_numfiles != -1 && mode != WILD_ALL && mode != WILD_LONGEST)
+ {
+ FreeWild(xp->xp_numfiles, xp->xp_files);
+***************
+*** 3540,3545 ****
+--- 3544,3553 ----
+
+ if (mode == WILD_EXPAND_FREE || mode == WILD_ALL)
+ ExpandCleanup(xp);
++
++ /* Free "orig" if it wasn't stored in "orig_save". */
++ if (orig != orig_save)
++ vim_free(orig);
+
+ return ss;
+ }
+*** ../vim-7.1.126/src/version.c Sun Sep 30 14:00:41 2007
+--- src/version.c Sun Sep 30 14:20:14 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 127,
+ /**/
+
+--
+A M00se once bit my sister ...
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: About patch 7.1.128 (extra)
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.128 (extra)
+Problem: Build problems with new version of Cygwin.
+Solution: Remove -D__IID_DEFINED__, like with MingW. (Guopeng Wen)
+Files: src/Make_cyg.mak
+
+
+*** ../vim-7.1.127/src/Make_cyg.mak Sun Apr 30 20:46:49 2006
+--- src/Make_cyg.mak Sat Sep 29 13:09:34 2007
+***************
+*** 1,6 ****
+ #
+ # Makefile for VIM on Win32, using Cygnus gcc
+! # Last updated by Dan Sharp. Last Change: 2006 Apr 30
+ #
+ # Also read INSTALLpc.txt!
+ #
+--- 1,6 ----
+ #
+ # Makefile for VIM on Win32, using Cygnus gcc
+! # Last updated by Dan Sharp. Last Change: 2007 Sep 29
+ #
+ # Also read INSTALLpc.txt!
+ #
+***************
+*** 503,509 ****
+ $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
+
+ $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
+! $(CC) -c $(CFLAGS) -D__IID_DEFINED__ if_ole.cpp -o $(OUTDIR)/if_ole.o
+
+ if_perl.c: if_perl.xs typemap
+ $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
+--- 503,509 ----
+ $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
+
+ $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
+! $(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o
+
+ if_perl.c: if_perl.xs typemap
+ $(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
+*** ../vim-7.1.127/src/version.c Sun Sep 30 22:10:45 2007
+--- src/version.c Sun Sep 30 22:27:51 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 128,
+ /**/
+
+--
+Mynd you, m00se bites Kan be pretty nasti ...
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: About patch 7.1.129 (extra)
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.129 (extra)
+Problem: Win32: Can't get the user name when it is longer than 15
+ characters.
+Solution: Use UNLEN instead of MAX_COMPUTERNAME_LENGTH. (Alexei Alexandrov)
+Files: src/os_win32.c
+
+
+*** ../vim-7.1.128/src/os_win32.c Thu May 10 19:22:59 2007
+--- src/os_win32.c Mon Oct 1 20:07:24 2007
+***************
+*** 2378,2384 ****
+ char_u *s,
+ int len)
+ {
+! char szUserName[MAX_COMPUTERNAME_LENGTH + 1];
+ DWORD cch = sizeof szUserName;
+
+ if (GetUserName(szUserName, &cch))
+--- 2378,2384 ----
+ char_u *s,
+ int len)
+ {
+! char szUserName[256 + 1]; /* UNLEN is 256 */
+ DWORD cch = sizeof szUserName;
+
+ if (GetUserName(szUserName, &cch))
+*** ../vim-7.1.128/src/version.c Sun Sep 30 22:28:08 2007
+--- src/version.c Mon Oct 1 20:32:52 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 129,
+ /**/
+
+--
+ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of Camelot.
+ King of all Britons, defeator of the Saxons, sovereign of all England!
+ [Pause]
+SOLDIER: Get away!
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: About patch 7.1.130
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.130
+Problem: Crash with specific order of undo and redo. (A.Politz)
+Solution: Clear and adjust pointers properly. Add u_check() for debugging.
+Files: src/undo.c, src/structs.h
+
+
+*** ../vim-7.1.129/src/undo.c Thu May 10 20:01:43 2007
+--- src/undo.c Mon Oct 1 22:49:16 2007
+***************
+*** 76,81 ****
+--- 76,87 ----
+ * buffer is unloaded.
+ */
+
++ /* Uncomment the next line for including the u_check() function. This warns
++ * for errors in the debug information. */
++ /* #define U_DEBUG 1 */
++ #define UH_MAGIC 0x18dade /* value for uh_magic when in use */
++ #define UE_MAGIC 0xabc123 /* value for ue_magic when in use */
++
+ #include "vim.h"
+
+ /* See below: use malloc()/free() for memory management. */
+***************
+*** 113,118 ****
+--- 119,213 ----
+ */
+ static int undo_undoes = FALSE;
+
++ #ifdef U_DEBUG
++ /*
++ * Check the undo structures for being valid. Print a warning when something
++ * looks wrong.
++ */
++ static int seen_b_u_curhead;
++ static int seen_b_u_newhead;
++ static int header_count;
++
++ static void
++ u_check_tree(u_header_T *uhp,
++ u_header_T *exp_uh_next,
++ u_header_T *exp_uh_alt_prev)
++ {
++ u_entry_T *uep;
++
++ if (uhp == NULL)
++ return;
++ ++header_count;
++ if (uhp == curbuf->b_u_curhead && ++seen_b_u_curhead > 1)
++ {
++ EMSG("b_u_curhead found twice (looping?)");
++ return;
++ }
++ if (uhp == curbuf->b_u_newhead && ++seen_b_u_newhead > 1)
++ {
++ EMSG("b_u_newhead found twice (looping?)");
++ return;
++ }
++
++ if (uhp->uh_magic != UH_MAGIC)
++ EMSG("uh_magic wrong (may be using freed memory)");
++ else
++ {
++ /* Check pointers back are correct. */
++ if (uhp->uh_next != exp_uh_next)
++ {
++ EMSG("uh_next wrong");
++ smsg((char_u *)"expected: 0x%x, actual: 0x%x",
++ exp_uh_next, uhp->uh_next);
++ }
++ if (uhp->uh_alt_prev != exp_uh_alt_prev)
++ {
++ EMSG("uh_alt_prev wrong");
++ smsg((char_u *)"expected: 0x%x, actual: 0x%x",
++ exp_uh_alt_prev, uhp->uh_alt_prev);
++ }
++
++ /* Check the undo tree at this header. */
++ for (uep = uhp->uh_entry; uep != NULL; uep = uep->ue_next)
++ {
++ if (uep->ue_magic != UE_MAGIC)
++ {
++ EMSG("ue_magic wrong (may be using freed memory)");
++ break;
++ }
++ }
++
++ /* Check the next alt tree. */
++ u_check_tree(uhp->uh_alt_next, uhp->uh_next, uhp);
++
++ /* Check the next header in this branch. */
++ u_check_tree(uhp->uh_prev, uhp, NULL);
++ }
++ }
++
++ void
++ u_check(int newhead_may_be_NULL)
++ {
++ seen_b_u_newhead = 0;
++ seen_b_u_curhead = 0;
++ header_count = 0;
++
++ u_check_tree(curbuf->b_u_oldhead, NULL, NULL);
++
++ if (seen_b_u_newhead == 0 && curbuf->b_u_oldhead != NULL
++ && !(newhead_may_be_NULL && curbuf->b_u_newhead == NULL))
++ EMSGN("b_u_newhead invalid: 0x%x", curbuf->b_u_newhead);
++ if (curbuf->b_u_curhead != NULL && seen_b_u_curhead == 0)
++ EMSGN("b_u_curhead invalid: 0x%x", curbuf->b_u_curhead);
++ if (header_count != curbuf->b_u_numhead)
++ {
++ EMSG("b_u_numhead invalid");
++ smsg((char_u *)"expected: %ld, actual: %ld",
++ (long)header_count, (long)curbuf->b_u_numhead);
++ }
++ }
++ #endif
++
+ /*
+ * Save the current line for both the "u" and "U" command.
+ * Returns OK or FAIL.
+***************
+*** 243,248 ****
+--- 338,346 ----
+ if (!undo_allowed())
+ return FAIL;
+
++ #ifdef U_DEBUG
++ u_check(FALSE);
++ #endif
+ #ifdef FEAT_NETBEANS_INTG
+ /*
+ * Netbeans defines areas that cannot be modified. Bail out here when
+***************
+*** 294,299 ****
+--- 392,400 ----
+ uhp = (u_header_T *)U_ALLOC_LINE((unsigned)sizeof(u_header_T));
+ if (uhp == NULL)
+ goto nomem;
++ #ifdef U_DEBUG
++ uhp->uh_magic = UH_MAGIC;
++ #endif
+ }
+ else
+ uhp = NULL;
+***************
+*** 316,323 ****
+ {
+ u_header_T *uhfree = curbuf->b_u_oldhead;
+
+! /* If there is no branch only free one header. */
+! if (uhfree->uh_alt_next == NULL)
+ u_freeheader(curbuf, uhfree, &old_curhead);
+ else
+ {
+--- 417,427 ----
+ {
+ u_header_T *uhfree = curbuf->b_u_oldhead;
+
+! if (uhfree == old_curhead)
+! /* Can't reconnect the branch, delete all of it. */
+! u_freebranch(curbuf, uhfree, &old_curhead);
+! else if (uhfree->uh_alt_next == NULL)
+! /* There is no branch, only free one header. */
+ u_freeheader(curbuf, uhfree, &old_curhead);
+ else
+ {
+***************
+*** 326,331 ****
+--- 430,438 ----
+ uhfree = uhfree->uh_alt_next;
+ u_freebranch(curbuf, uhfree, &old_curhead);
+ }
++ #ifdef U_DEBUG
++ u_check(TRUE);
++ #endif
+ }
+
+ if (uhp == NULL) /* no undo at all */
+***************
+*** 478,483 ****
+--- 585,593 ----
+ uep = (u_entry_T *)U_ALLOC_LINE((unsigned)sizeof(u_entry_T));
+ if (uep == NULL)
+ goto nomem;
++ #ifdef U_DEBUG
++ uep->ue_magic = UE_MAGIC;
++ #endif
+
+ uep->ue_size = size;
+ uep->ue_top = top;
+***************
+*** 525,530 ****
+--- 635,643 ----
+ curbuf->b_u_synced = FALSE;
+ undo_undoes = FALSE;
+
++ #ifdef U_DEBUG
++ u_check(FALSE);
++ #endif
+ return OK;
+
+ nomem:
+***************
+*** 955,960 ****
+--- 1068,1076 ----
+ int empty_buffer; /* buffer became empty */
+ u_header_T *curhead = curbuf->b_u_curhead;
+
++ #ifdef U_DEBUG
++ u_check(FALSE);
++ #endif
+ old_flags = curhead->uh_flags;
+ new_flags = (curbuf->b_changed ? UH_CHANGED : 0) +
+ ((curbuf->b_ml.ml_flags & ML_EMPTY) ? UH_EMPTYBUF : 0);
+***************
+*** 1186,1191 ****
+--- 1302,1310 ----
+ /* The timestamp can be the same for multiple changes, just use the one of
+ * the undone/redone change. */
+ curbuf->b_u_seq_time = curhead->uh_time;
++ #ifdef U_DEBUG
++ u_check(FALSE);
++ #endif
+ }
+
+ /*
+***************
+*** 1515,1521 ****
+ }
+
+ /*
+! * Free one header and its entry list and adjust the pointers.
+ */
+ static void
+ u_freeheader(buf, uhp, uhpp)
+--- 1634,1640 ----
+ }
+
+ /*
+! * Free one header "uhp" and its entry list and adjust the pointers.
+ */
+ static void
+ u_freeheader(buf, uhp, uhpp)
+***************
+*** 1523,1528 ****
+--- 1642,1649 ----
+ u_header_T *uhp;
+ u_header_T **uhpp; /* if not NULL reset when freeing this header */
+ {
++ u_header_T *uhap;
++
+ /* When there is an alternate redo list free that branch completely,
+ * because we can never go there. */
+ if (uhp->uh_alt_next != NULL)
+***************
+*** 1540,1546 ****
+ if (uhp->uh_prev == NULL)
+ buf->b_u_newhead = uhp->uh_next;
+ else
+! uhp->uh_prev->uh_next = uhp->uh_next;
+
+ u_freeentries(buf, uhp, uhpp);
+ }
+--- 1661,1668 ----
+ if (uhp->uh_prev == NULL)
+ buf->b_u_newhead = uhp->uh_next;
+ else
+! for (uhap = uhp->uh_prev; uhap != NULL; uhap = uhap->uh_alt_next)
+! uhap->uh_next = uhp->uh_next;
+
+ u_freeentries(buf, uhp, uhpp);
+ }
+***************
+*** 1585,1590 ****
+--- 1707,1714 ----
+ /* Check for pointers to the header that become invalid now. */
+ if (buf->b_u_curhead == uhp)
+ buf->b_u_curhead = NULL;
++ if (buf->b_u_newhead == uhp)
++ buf->b_u_newhead = NULL; /* freeing the newest entry */
+ if (uhpp != NULL && uhp == *uhpp)
+ *uhpp = NULL;
+
+***************
+*** 1594,1599 ****
+--- 1718,1726 ----
+ u_freeentry(uep, uep->ue_size);
+ }
+
++ #ifdef U_DEBUG
++ uhp->uh_magic = 0;
++ #endif
+ U_FREE_LINE((char_u *)uhp);
+ --buf->b_u_numhead;
+ }
+***************
+*** 1609,1614 ****
+--- 1736,1744 ----
+ while (n > 0)
+ U_FREE_LINE(uep->ue_array[--n]);
+ U_FREE_LINE((char_u *)uep->ue_array);
++ #ifdef U_DEBUG
++ uep->ue_magic = 0;
++ #endif
+ U_FREE_LINE((char_u *)uep);
+ }
+
+*** ../vim-7.1.129/src/structs.h Sun Aug 12 15:50:26 2007
+--- src/structs.h Sat Sep 29 15:03:38 2007
+***************
+*** 278,283 ****
+--- 278,286 ----
+ linenr_T ue_lcount; /* linecount when u_save called */
+ char_u **ue_array; /* array of lines in undo block */
+ long ue_size; /* number of lines in ue_array */
++ #ifdef U_DEBUG
++ int ue_magic; /* magic number to check allocation */
++ #endif
+ };
+
+ struct u_header
+***************
+*** 300,305 ****
+--- 303,311 ----
+ visualinfo_T uh_visual; /* Visual areas before undo/after redo */
+ #endif
+ time_t uh_time; /* timestamp when the change was made */
++ #ifdef U_DEBUG
++ int uh_magic; /* magic number to check allocation */
++ #endif
+ };
+
+ /* values for uh_flags */
+*** ../vim-7.1.129/src/version.c Mon Oct 1 20:33:45 2007
+--- src/version.c Mon Oct 1 22:50:23 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 130,
+ /**/
+
+--
+FIRST SOLDIER: So they wouldn't be able to bring a coconut back anyway.
+SECOND SOLDIER: Wait a minute! Suppose two swallows carried it together?
+FIRST SOLDIER: No, they'd have to have it on a line.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.131
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.131
+Problem: ":mksession" always adds ":setlocal autoread". (Christian J.
+ Robinson)
+Solution: Skip boolean global/local option using global value.
+Files: src/option.c
+
+
+*** ../vim-7.1.130/src/option.c Wed Sep 26 22:35:06 2007
+--- src/option.c Sun Sep 30 16:21:08 2007
+***************
+*** 8753,8758 ****
+--- 8753,8760 ----
+ char *name;
+ int value;
+ {
++ if (value < 0) /* global/local option using global value */
++ return OK;
+ if (fprintf(fd, "%s %s%s", cmd, value ? "" : "no", name) < 0
+ || put_eol(fd) < 0)
+ return FAIL;
+*** ../vim-7.1.130/src/version.c Mon Oct 1 22:53:27 2007
+--- src/version.c Tue Oct 2 20:39:02 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 131,
+ /**/
+
+--
+ARTHUR: Old woman!
+DENNIS: Man!
+ARTHUR: Man. I'm sorry. Old man, What knight live in that castle over there?
+DENNIS: I'm thirty-seven.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.132
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.132
+Problem: getpos("'>") may return a negative column number for a Linewise
+ selection. (A.Politz)
+Solution: Don't add one to MAXCOL.
+Files: src/eval.c
+
+
+*** ../vim-7.1.131/src/eval.c Tue Sep 25 20:39:14 2007
+--- src/eval.c Mon Oct 1 20:56:09 2007
+***************
+*** 10388,10394 ****
+ list_append_number(l, (varnumber_T)0);
+ list_append_number(l, (fp != NULL) ? (varnumber_T)fp->lnum
+ : (varnumber_T)0);
+! list_append_number(l, (fp != NULL) ? (varnumber_T)fp->col + 1
+ : (varnumber_T)0);
+ list_append_number(l,
+ #ifdef FEAT_VIRTUALEDIT
+--- 10388,10395 ----
+ list_append_number(l, (varnumber_T)0);
+ list_append_number(l, (fp != NULL) ? (varnumber_T)fp->lnum
+ : (varnumber_T)0);
+! list_append_number(l, (fp != NULL)
+! ? (varnumber_T)(fp->col == MAXCOL ? MAXCOL : fp->col + 1)
+ : (varnumber_T)0);
+ list_append_number(l,
+ #ifdef FEAT_VIRTUALEDIT
+*** ../vim-7.1.131/src/version.c Tue Oct 2 20:40:01 2007
+--- src/version.c Tue Oct 2 22:07:17 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 132,
+ /**/
+
+--
+"The future's already arrived - it's just not evenly distributed yet."
+ -- William Gibson
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.133
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.133 (after 7.1.126)
+Problem: shorten_fname1() linked when it's not needed.
+Solution: Add #ifdef.
+Files: src/fileio.c
+
+
+*** ../vim-7.1.132/src/fileio.c Sun Sep 30 14:00:41 2007
+--- src/fileio.c Sun Sep 30 16:32:43 2007
+***************
+*** 5553,5558 ****
+--- 5554,5561 ----
+ }
+ #endif
+
++ #if defined(FEAT_VIMINFO) || defined(FEAT_BROWSE) || \
++ defined(FEAT_QUICKFIX) || defined(PROTO)
+ /*
+ * Try to find a shortname by comparing the fullname with the current
+ * directory.
+***************
+*** 5573,5578 ****
+--- 5576,5582 ----
+ }
+ return p;
+ }
++ #endif
+
+ /*
+ * Try to find a shortname by comparing the fullname with the current
+*** ../vim-7.1.132/src/version.c Tue Oct 2 22:07:58 2007
+--- src/version.c Wed Oct 3 12:46:59 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 133,
+ /**/
+
+--
+"Beware of bugs in the above code; I have only proved
+it correct, not tried it." -- Donald Knuth
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.134 (extra)
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.134 (extra)
+Problem: Win32: Can't build with VC8
+Solution: Detect the MSVC version instead of using NMAKE_VER.
+ (Mike Williams)
+Files: src/Make_mvc.mak
+
+
+*** ../vim-7.1.133/src/Make_mvc.mak Tue Feb 20 03:15:08 2007
+--- src/Make_mvc.mak Mon Oct 1 21:37:20 2007
+***************
+*** 92,97 ****
+--- 92,99 ----
+ # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
+ # doesn't work)
+ #
++ # Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
++ #
+ # You can combine any of these interfaces
+ #
+ # Example: To build the non-debug, GUI version with Perl interface:
+***************
+*** 101,107 ****
+ # This makefile gives a fineness of control which is not supported in
+ # Visual C++ configuration files. Therefore, debugging requires a bit of
+ # extra work.
+! # Make_dvc.mak is a Visual C++ project to access that support.
+ # To use Make_dvc.mak:
+ # 1) Build Vim with Make_mvc.mak.
+ # Use a "DEBUG=yes" argument to build Vim with debug support.
+--- 103,110 ----
+ # This makefile gives a fineness of control which is not supported in
+ # Visual C++ configuration files. Therefore, debugging requires a bit of
+ # extra work.
+! # Make_dvc.mak is a Visual C++ project to access that support. It may be
+! # badly out of date for the Visual C++ you are using...
+ # To use Make_dvc.mak:
+ # 1) Build Vim with Make_mvc.mak.
+ # Use a "DEBUG=yes" argument to build Vim with debug support.
+***************
+*** 198,211 ****
+ !if "$(DEBUG)" != "yes"
+ NODEBUG = 1
+ !else
+ MAKEFLAGS_GVIMEXT = DEBUG=yes
+ !endif
+
+
+! # Get all sorts of useful, standard macros from the SDK. (Note that
+! # MSVC 2.2 does not install <ntwin32.mak> in the \msvc20\include
+! # directory, but you can find it in \msvc20\include on the CD-ROM.
+! # You may also need <win32.mak> from the same place.)
+
+ !include <Win32.mak>
+
+--- 201,212 ----
+ !if "$(DEBUG)" != "yes"
+ NODEBUG = 1
+ !else
++ !undef NODEBUG
+ MAKEFLAGS_GVIMEXT = DEBUG=yes
+ !endif
+
+
+! # Get all sorts of useful, standard macros from the Platform SDK.
+
+ !include <Win32.mak>
+
+***************
+*** 272,283 ****
+
+ # Set which version of the CRT to use
+ !if defined(USE_MSVCRT)
+! CVARS = $(cvarsdll)
+ # !elseif defined(MULTITHREADED)
+ # CVARS = $(cvarsmt)
+ !else
+ # CVARS = $(cvars)
+! CVARS = $(cvarsmt)
+ !endif
+
+ # need advapi32.lib for GetUserName()
+--- 273,284 ----
+
+ # Set which version of the CRT to use
+ !if defined(USE_MSVCRT)
+! # CVARS = $(cvarsdll)
+ # !elseif defined(MULTITHREADED)
+ # CVARS = $(cvarsmt)
+ !else
+ # CVARS = $(cvars)
+! # CVARS = $(cvarsmt)
+ !endif
+
+ # need advapi32.lib for GetUserName()
+***************
+*** 320,326 ****
+--- 321,364 ----
+ INTDIR=$(OBJDIR)
+ OUTDIR=$(OBJDIR)
+
++ # Derive version of VC being used from nmake if not specified
++ !if "$(MSVCVER)" == ""
++ !if "$(_NMAKE_VER)" == ""
++ MSVCVER = 4.0
++ !endif
++ !if "$(_NMAKE_VER)" == "162"
++ MSVCVER = 5.0
++ !endif
++ !if "$(_NMAKE_VER)" == "6.00.8168.0"
++ MSVCVER = 6.0
++ !endif
++ !if "$(_NMAKE_VER)" == "7.00.9466"
++ MSVCVER = 7.0
++ !endif
++ !if "$(_NMAKE_VER)" == "7.10.3077"
++ MSVCVER = 7.1
++ !endif
++ !if "$(_NMAKE_VER)" == "8.00.50727.42"
++ MSVCVER = 8.0
++ !endif
++ !if "$(_NMAKE_VER)" == "8.00.50727.762"
++ MSVCVER = 8.0
++ !endif
++ !endif
++
++ # Abort bulding VIM if version of VC is unrecognised.
++ !ifndef MSVCVER
++ !message *** ERROR
++ !message Cannot determine Visual C version being used. If you are using the
++ !message Windows SDK then you must have the environment variable MSVCVER set to
++ !message your version of the VC compiler. If you are not using the Express
++ !message version of Visual C you van either set MSVCVER or update this makefile
++ !message to handle the new value for _NMAKE_VER.
++ !error Make aborted.
++ !endif
++
+ # Convert processor ID to MVC-compatible number
++ !if "$(MSVCVER)" != "8.0"
+ !if "$(CPUNR)" == "i386"
+ CPUARG = /G3
+ !elseif "$(CPUNR)" == "i486"
+***************
+*** 334,339 ****
+--- 372,386 ----
+ !else
+ CPUARG =
+ !endif
++ !else
++ # VC8 only allows specifying SSE architecture
++ !if "$(CPUNR)" == "pentium4"
++ CPUARG = /arch:SSE2
++ !endif
++ !endif
++
++ LIBC =
++ DEBUGINFO = /Zi
+
+ !ifdef NODEBUG
+ VIM = vim
+***************
+*** 344,384 ****
+ !else # MAXSPEED
+ OPTFLAG = /Ox
+ !endif
+ CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
+ RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
+ ! ifdef USE_MSVCRT
+! CFLAGS = $(CFLAGS) -MD
+ LIBC = msvcrt.lib
+- # CFLAGS = $(CFLAGS) $(cvarsdll)
+- # ! elseif defined(MULTITHREADED)
+- # LIBC = libcmt.lib
+- # CFLAGS = $(CFLAGS) $(cvarsmt)
+ ! else
+- # LIBC = libc.lib
+ LIBC = libcmt.lib
+! # CFLAGS = $(CFLAGS) $(cvars)
+ ! endif
+ !else # DEBUG
+ VIM = vimd
+ CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
+ RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
+ # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
+! ! if "$(_NMAKE_VER)" == ""
+ LIBC =
+ ! else
+ LIBC = /fixed:no
+ ! endif
+ ! ifdef USE_MSVCRT
+! CFLAGS = $(CFLAGS) -MDd
+ LIBC = $(LIBC) msvcrtd.lib
+- # CFLAGS = $(CFLAGS) $(cvarsdll)
+- # ! elseif defined(MULTITHREADED)
+- # LIBC = $(LIBC) libcmtd.lib
+- # CFLAGS = $(CFLAGS) $(cvarsmt)
+ ! else
+- # LIBC = $(LIBC) libcd.lib
+ LIBC = $(LIBC) libcmtd.lib
+! # CFLAGS = $(CFLAGS) $(cvars)
+ ! endif
+ !endif # DEBUG
+
+--- 391,430 ----
+ !else # MAXSPEED
+ OPTFLAG = /Ox
+ !endif
++ !if "$(MSVCVER)" == "8.0"
++ # Use link time code generation if not worried about size
++ !if "$(OPTIMIZE)" != "SPACE"
++ OPTFLAG = $(OPTFLAG) /GL
++ !endif
++ !endif
+ CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
+ RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
+ ! ifdef USE_MSVCRT
+! CFLAGS = $(CFLAGS) /MD
+ LIBC = msvcrt.lib
+ ! else
+ LIBC = libcmt.lib
+! CFLAGS = $(CFLAGS) /MT
+ ! endif
+ !else # DEBUG
+ VIM = vimd
++ ! if "$(CPU)" == "i386"
++ DEBUGINFO = /ZI
++ ! endif
+ CFLAGS = $(CFLAGS) -D_DEBUG -DDEBUG /Od
+ RCFLAGS = $(rcflags) $(rcvars) -D_DEBUG -DDEBUG
+ # The /fixed:no is needed for Quantify. Assume not 4.? as unsupported in VC4.0.
+! ! if "$(MSVCVER)" == "4.0"
+ LIBC =
+ ! else
+ LIBC = /fixed:no
+ ! endif
+ ! ifdef USE_MSVCRT
+! CFLAGS = $(CFLAGS) /MDd
+ LIBC = $(LIBC) msvcrtd.lib
+ ! else
+ LIBC = $(LIBC) libcmtd.lib
+! CFLAGS = $(CFLAGS) /MTd
+ ! endif
+ !endif # DEBUG
+
+***************
+*** 681,696 ****
+ #
+ # Always generate the .pdb file, so that we get debug symbols that can be used
+ # on a crash (doesn't add overhead to the executable).
+ #
+! CFLAGS = $(CFLAGS) /Zi /Fd$(OUTDIR)/
+! LINK_PDB = /PDB:$(VIM).pdb -debug # -debug:full -debugtype:cv,fixup
+
+ #
+ # End extra feature include
+ #
+ !message
+
+! conflags = /nologo /subsystem:$(SUBSYSTEM) /incremental:no
+
+ PATHDEF_SRC = $(OUTDIR)\pathdef.c
+
+--- 727,744 ----
+ #
+ # Always generate the .pdb file, so that we get debug symbols that can be used
+ # on a crash (doesn't add overhead to the executable).
++ # Generate edit-and-continue debug info when no optimization - allows to
++ # debug more conveniently (able to look at variables which are in registers)
+ #
+! CFLAGS = $(CFLAGS) /Fd$(OUTDIR)/ $(DEBUGINFO)
+! LINK_PDB = /PDB:$(VIM).pdb -debug
+
+ #
+ # End extra feature include
+ #
+ !message
+
+! conflags = /nologo /subsystem:$(SUBSYSTEM)
+
+ PATHDEF_SRC = $(OUTDIR)\pathdef.c
+
+***************
+*** 702,712 ****
+ conflags = $(conflags) /map /mapinfo:lines
+ !ENDIF
+
+! LINKARGS1 = $(linkdebug) $(conflags) /nodefaultlib:libc
+ LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
+ $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
+ $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
+
+ all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
+ GvimExt/gvimext.dll
+
+--- 750,769 ----
+ conflags = $(conflags) /map /mapinfo:lines
+ !ENDIF
+
+! LINKARGS1 = $(linkdebug) $(conflags)
+ LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
+ $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(RUBY_LIB) \
+ $(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
+
++ # Report link time code generation progress if used.
++ !ifdef NODEBUG
++ !if "$(MSVCVER)" == "8.0"
++ !if "$(OPTIMIZE)" != "SPACE"
++ LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
++ !endif
++ !endif
++ !endif
++
+ all: $(VIM).exe vimrun.exe install.exe uninstal.exe xxd/xxd.exe \
+ GvimExt/gvimext.dll
+
+***************
+*** 794,800 ****
+
+ # Create a default rule for transforming .c files to .obj files in $(OUTDIR)
+ # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
+! !IF "$(_NMAKE_VER)" == ""
+ .c{$(OUTDIR)/}.obj:
+ !ELSE
+ .c{$(OUTDIR)/}.obj::
+--- 851,857 ----
+
+ # Create a default rule for transforming .c files to .obj files in $(OUTDIR)
+ # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
+! !IF "$(MSVCVER)" == "4.0"
+ .c{$(OUTDIR)/}.obj:
+ !ELSE
+ .c{$(OUTDIR)/}.obj::
+***************
+*** 803,809 ****
+
+ # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
+ # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
+! !IF "$(_NMAKE_VER)" == ""
+ .cpp{$(OUTDIR)/}.obj:
+ !ELSE
+ .cpp{$(OUTDIR)/}.obj::
+--- 860,866 ----
+
+ # Create a default rule for transforming .cpp files to .obj files in $(OUTDIR)
+ # Batch compilation is supported by nmake 1.62 (part of VS 5.0) and later)
+! !IF "$(MSVCVER)" == "4.0"
+ .cpp{$(OUTDIR)/}.obj:
+ !ELSE
+ .cpp{$(OUTDIR)/}.obj::
+*** ../vim-7.1.133/src/version.c Wed Oct 3 12:49:24 2007
+--- src/version.c Wed Oct 3 13:23:51 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 134,
+ /**/
+
+--
+BLACK KNIGHT: The Black Knight always triumphs. Have at you!
+ ARTHUR takes his last leg off. The BLACK KNIGHT's body lands upright.
+BLACK KNIGHT: All right, we'll call it a draw.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: patch 7.1.135
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.135
+Problem: Win32: When editing a file c:\tmp\foo and c:\tmp\\foo we have two
+ buffers for the same file. (Suresh Govindachar)
+Solution: Invoke FullName_save() when a path contains "//" or "\\".
+Files: src/buffer.c
+
+
+*** ../vim-7.1.134/src/buffer.c Sun Sep 30 14:00:41 2007
+--- src/buffer.c Wed Oct 3 14:24:52 2007
+***************
+*** 4175,4203 ****
+ * mess up the full path name, even though it starts with a '/'.
+ * Also expand when there is ".." in the file name, try to remove it,
+ * because "c:/src/../README" is equal to "c:/README".
+ * For MS-Windows also expand names like "longna~1" to "longname".
+ */
+ #ifdef UNIX
+ return FullName_save(fname, TRUE);
+ #else
+! if (!vim_isAbsName(fname) || strstr((char *)fname, "..") != NULL
+! #if defined(MSWIN) || defined(DJGPP)
+ || vim_strchr(fname, '~') != NULL
+! #endif
+ )
+ return FullName_save(fname, FALSE);
+
+ fname = vim_strsave(fname);
+
+! #ifdef USE_FNAME_CASE
+! # ifdef USE_LONG_FNAME
+ if (USE_LONG_FNAME)
+! # endif
+ {
+ if (fname != NULL)
+ fname_case(fname, 0); /* set correct case for file name */
+ }
+! #endif
+
+ return fname;
+ #endif
+--- 4175,4209 ----
+ * mess up the full path name, even though it starts with a '/'.
+ * Also expand when there is ".." in the file name, try to remove it,
+ * because "c:/src/../README" is equal to "c:/README".
++ * Similarly "c:/src//file" is equal to "c:/src/file".
+ * For MS-Windows also expand names like "longna~1" to "longname".
+ */
+ #ifdef UNIX
+ return FullName_save(fname, TRUE);
+ #else
+! if (!vim_isAbsName(fname)
+! || strstr((char *)fname, "..") != NULL
+! || strstr((char *)fname, "//") != NULL
+! # ifdef BACKSLASH_IN_FILENAME
+! || strstr((char *)fname, "\\\\") != NULL
+! # endif
+! # if defined(MSWIN) || defined(DJGPP)
+ || vim_strchr(fname, '~') != NULL
+! # endif
+ )
+ return FullName_save(fname, FALSE);
+
+ fname = vim_strsave(fname);
+
+! # ifdef USE_FNAME_CASE
+! # ifdef USE_LONG_FNAME
+ if (USE_LONG_FNAME)
+! # endif
+ {
+ if (fname != NULL)
+ fname_case(fname, 0); /* set correct case for file name */
+ }
+! # endif
+
+ return fname;
+ #endif
+*** ../vim-7.1.134/src/version.c Wed Oct 3 13:28:40 2007
+--- src/version.c Wed Oct 3 14:26:54 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 135,
+ /**/
+
+--
+ A village. Sound of chanting of Latin canon, punctuated by short, sharp
+ cracks. It comes nearer. We see it is a line of MONKS ala SEVENTH SEAL
+ flagellation scene, chanting and banging themselves on the foreheads with
+ wooden boards.
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.136
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.136
+Problem: Memory leak when using Ruby syntax highlighting. (Dominique Pelle)
+Solution: Free the contained-in list.
+Files: src/syntax.c
+
+
+*** ../vim-7.1.135/src/syntax.c Thu Aug 30 19:36:52 2007
+--- src/syntax.c Sun Oct 7 15:10:54 2007
+***************
+*** 3354,3359 ****
+--- 3354,3360 ----
+ {
+ vim_free(SYN_ITEMS(buf)[i].sp_cont_list);
+ vim_free(SYN_ITEMS(buf)[i].sp_next_list);
++ vim_free(SYN_ITEMS(buf)[i].sp_syn.cont_in_list);
+ }
+ }
+
+*** ../vim-7.1.135/src/version.c Wed Oct 3 14:30:54 2007
+--- src/version.c Sun Oct 7 15:20:22 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 136,
+ /**/
+
+--
+Every engineer dreams about saving the universe and having sex with aliens.
+This is much more glamorous than the real life of an engineer, which consists
+of hiding from the universe and having sex without the participation of other
+life forms. (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.137
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.137
+Problem: Build failure when using EXITFREE. (Dominique Pelle)
+Solution: Add an #ifdef around using clip_exclude_prog.
+Files: src/misc2.c
+
+
+*** ../vim-7.1.136/src/misc2.c Sat Sep 29 14:15:00 2007
+--- src/misc2.c Sun Sep 30 18:00:09 2007
+***************
+*** 1037,1043 ****
+--- 1038,1046 ----
+
+ /* Free some global vars. */
+ vim_free(username);
++ # ifdef FEAT_CLIPBOARD
+ vim_free(clip_exclude_prog);
++ # endif
+ vim_free(last_cmdline);
+ vim_free(new_last_cmdline);
+ set_keep_msg(NULL, 0);
+*** ../vim-7.1.136/src/version.c Sun Oct 7 15:21:31 2007
+--- src/version.c Sun Oct 7 15:42:26 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 137,
+ /**/
+
+--
+For society, it's probably a good thing that engineers value function over
+appearance. For example, you wouldn't want engineers to build nuclear power
+plants that only _look_ like they would keep all the radiation inside.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.138
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.138
+Problem: The Perl Msg() function doesn't stop when "q" is typed at the more
+ prompt. (Hari Krishna Dara)
+Solution: Check got_int.
+Files: src/if_perl.xs
+
+
+*** ../vim-7.1.137/src/if_perl.xs Sat Sep 15 14:48:57 2007
+--- src/if_perl.xs Wed Oct 3 17:00:16 2007
+***************
+*** 445,457 ****
+ char *next;
+ char *token = (char *)s;
+
+! while ((next = strchr(token, '\n')))
+ {
+ *next++ = '\0'; /* replace \n with \0 */
+ msg_attr((char_u *)token, attr);
+ token = next;
+ }
+! if (*token)
+ msg_attr((char_u *)token, attr);
+ }
+
+--- 445,457 ----
+ char *next;
+ char *token = (char *)s;
+
+! while ((next = strchr(token, '\n')) && !got_int)
+ {
+ *next++ = '\0'; /* replace \n with \0 */
+ msg_attr((char_u *)token, attr);
+ token = next;
+ }
+! if (*token && !got_int)
+ msg_attr((char_u *)token, attr);
+ }
+
+*** ../vim-7.1.137/src/version.c Sun Oct 7 15:44:28 2007
+--- src/version.c Tue Oct 9 10:45:08 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 138,
+ /**/
+
+--
+A consultant is a person who takes your money and annoys your employees while
+tirelessly searching for the best way to extend the consulting contract.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.139
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.139
+Problem: When using marker folding and ending Insert mode with CTRL-C the
+ current fold is truncated. (Fred Kater)
+Solution: Ignore got_int while updating folds.
+Files: src/fold.c
+
+
+*** ../vim-7.1.138/src/fold.c Thu May 10 21:02:13 2007
+--- src/fold.c Sun Oct 14 15:27:13 2007
+***************
+*** 858,864 ****
+--- 858,871 ----
+ || foldmethodIsDiff(wp)
+ #endif
+ || foldmethodIsSyntax(wp))
++ {
++ int save_got_int = got_int;
++
++ /* reset got_int here, otherwise it won't work */
++ got_int = FALSE;
+ foldUpdateIEMS(wp, top, bot);
++ got_int |= save_got_int;
++ }
+ }
+
+ /* foldUpdateAll() {{{2 */
+*** ../vim-7.1.138/src/version.c Tue Oct 9 10:46:39 2007
+--- src/version.c Sun Oct 14 15:31:18 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 139,
+ /**/
+
+--
+If Pacman had affected us as kids we'd be running around in dark rooms,
+munching pills and listening to repetitive music.
+ -- Marcus Brigstocke
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.140
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.140
+Problem: v:count is set only after typing a non-digit, that makes it
+ difficult to make a nice mapping.
+Solution: Set v:count while still typing the count.
+Files: src/normal.c
+
+
+*** ../vim-7.1.139/src/normal.c Thu Sep 13 18:25:08 2007
+--- src/normal.c Sun Oct 14 17:15:36 2007
+***************
+*** 690,695 ****
+--- 690,702 ----
+ ca.count0 = ca.count0 * 10 + (c - '0');
+ if (ca.count0 < 0) /* got too large! */
+ ca.count0 = 999999999L;
++ #ifdef FEAT_EVAL
++ /* Set v:count here, when called from main() and not a stuffed
++ * command, so that v:count can be used in an expression mapping
++ * right after the count. */
++ if (toplevel && stuff_empty())
++ set_vcount(ca.count0, ca.count0 == 0 ? 1 : ca.count0);
++ #endif
+ if (ctrl_w)
+ {
+ ++no_mapping;
+*** ../vim-7.1.139/src/version.c Sun Oct 14 15:32:10 2007
+--- src/version.c Sun Oct 14 17:13:15 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 140,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+11. Specify that your drive-through order is "to go".
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.141
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.141
+Problem: GTK: -geom argument doesn't support a negative offset.
+Solution: Compute position from the right/lower corner.
+Files: src/gui_gtk_x11.c
+
+
+*** ../vim-7.1.140/src/gui_gtk_x11.c Sat Sep 15 14:06:41 2007
+--- src/gui_gtk_x11.c Mon Oct 8 21:26:50 2007
+***************
+*** 4044,4049 ****
+--- 4044,4051 ----
+ unsigned int w, h;
+ int x = 0;
+ int y = 0;
++ guint pixel_width;
++ guint pixel_height;
+
+ mask = XParseGeometry((char *)gui.geom, &x, &y, &w, &h);
+
+***************
+*** 4055,4066 ****
+--- 4057,4087 ----
+ p_window = h - 1;
+ Rows = h;
+ }
++
++ pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
++ pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
++
++ #ifdef HAVE_GTK2
++ pixel_width += get_menu_tool_width();
++ pixel_height += get_menu_tool_height();
++ #endif
++
+ if (mask & (XValue | YValue))
++ {
++ int w, h;
++ gui_mch_get_screen_dimensions(&w, &h);
++ h += p_ghr + get_menu_tool_height();
++ w += get_menu_tool_width();
++ if (mask & XNegative)
++ x += w - pixel_width;
++ if (mask & YNegative)
++ y += h - pixel_height;
+ #ifdef HAVE_GTK2
+ gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
+ #else
+ gtk_widget_set_uposition(gui.mainwin, x, y);
+ #endif
++ }
+ vim_free(gui.geom);
+ gui.geom = NULL;
+
+***************
+*** 4071,4084 ****
+ */
+ if (gtk_socket_id != 0 && (mask & WidthValue || mask & HeightValue))
+ {
+- guint pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
+- guint pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
+-
+- #ifdef HAVE_GTK2
+- pixel_width += get_menu_tool_width();
+- pixel_height += get_menu_tool_height();
+- #endif
+-
+ update_window_manager_hints(pixel_width, pixel_height);
+ init_window_hints_state = 1;
+ g_timeout_add(1000, check_startup_plug_hints, NULL);
+--- 4092,4097 ----
+*** ../vim-7.1.140/src/version.c Sun Oct 14 17:15:45 2007
+--- src/version.c Fri Oct 19 14:28:52 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 141,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+35. Your husband tells you he's had the beard for 2 months.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.142
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.142
+Problem: ":redir @A>" doesn't work.
+Solution: Ignore the extra ">" also when appending. (James Vega)
+Files: src/ex_docmd.c
+
+
+*** ../vim-7.1.141/src/ex_docmd.c Sun Sep 30 14:00:41 2007
+--- src/ex_docmd.c Tue Oct 9 11:09:09 2007
+***************
+*** 8426,8446 ****
+ || *arg == '"')
+ {
+ redir_reg = *arg++;
+! if (*arg == '>' && arg[1] == '>')
+ arg += 2;
+! else if ((*arg == NUL || (*arg == '>' && arg[1] == NUL)) &&
+! (islower(redir_reg)
+! # ifdef FEAT_CLIPBOARD
+! || redir_reg == '*'
+! || redir_reg == '+'
+! # endif
+! || redir_reg == '"'))
+ {
+ if (*arg == '>')
+ arg++;
+!
+! /* make register empty */
+! write_reg_contents(redir_reg, (char_u *)"", -1, FALSE);
+ }
+ }
+ if (*arg != NUL)
+--- 8426,8442 ----
+ || *arg == '"')
+ {
+ redir_reg = *arg++;
+! if (*arg == '>' && arg[1] == '>') /* append */
+ arg += 2;
+! else
+ {
++ /* Can use both "@a" and "@a>". */
+ if (*arg == '>')
+ arg++;
+! /* Make register empty when not using @A-@Z and the
+! * command is valid. */
+! if (*arg == NUL && !isupper(redir_reg))
+! write_reg_contents(redir_reg, (char_u *)"", -1, FALSE);
+ }
+ }
+ if (*arg != NUL)
+*** ../vim-7.1.141/src/version.c Fri Oct 19 14:32:50 2007
+--- src/version.c Fri Oct 19 16:18:36 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 142,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+36. You miss more than five meals a week downloading the latest games from
+ Apogee.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.143
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.143
+Problem: Uninitialized memory read when diffing three files. (Dominique
+ Pelle)
+Solution: Remove "+ !notset" so that we don't use fields that were not
+ computed.
+Files: src/diff.c
+
+
+*** ../vim-7.1.142/src/diff.c Sat Sep 29 14:15:00 2007
+--- src/diff.c Sun Oct 14 21:52:56 2007
+***************
+*** 1310,1316 ****
+ dp->df_count[idx_new] += -off;
+ off = 0;
+ }
+! for (i = idx_orig; i < idx_new + !notset; ++i)
+ if (curtab->tp_diffbuf[i] != NULL)
+ dp->df_count[i] = dpl->df_lnum[i] + dpl->df_count[i]
+ - dp->df_lnum[i] + off;
+--- 1310,1316 ----
+ dp->df_count[idx_new] += -off;
+ off = 0;
+ }
+! for (i = idx_orig; i < idx_new; ++i)
+ if (curtab->tp_diffbuf[i] != NULL)
+ dp->df_count[i] = dpl->df_lnum[i] + dpl->df_count[i]
+ - dp->df_lnum[i] + off;
+*** ../vim-7.1.142/src/version.c Fri Oct 19 16:20:09 2007
+--- src/version.c Fri Oct 19 17:32:18 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 143,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+37. You start looking for hot HTML addresses in public restrooms.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.144
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.144
+Problem: After ":diffup" cursor can be in the wrong position.
+Solution: Force recomputing the cursor position.
+Files: src/diff.c
+
+
+*** ../vim-7.1.143/src/diff.c Fri Oct 19 17:32:58 2007
+--- src/diff.c Fri Oct 19 18:54:13 2007
+***************
+*** 791,796 ****
+--- 791,799 ----
+ }
+ mch_remove(tmp_orig);
+
++ /* force updating cursor position on screen */
++ curwin->w_valid_cursor.lnum = 0;
++
+ diff_redraw(TRUE);
+
+ theend:
+*** ../vim-7.1.143/src/version.c Fri Oct 19 17:32:58 2007
+--- src/version.c Fri Oct 19 18:56:49 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 144,
+ /**/
+
+--
+He who laughs last, thinks slowest.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.145
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.1.145
+Problem: Insert mode completion: When using the popup menu, after
+ completing a word and typing a non-word character Vim is still
+ completing the same word, following CTRL-N doesn't work.
+ Insert mode Completion: When using CTRL-X O and there is only
+ "struct." before the cursor, typing one char to reduce the
+ matches, then BS completion stops.
+Solution: When typing a character that is not part of the item being
+ completed, stop complete mode. For whole line completion also
+ accept a space. For file name completion stop at a path
+ separator.
+ For omni completion stay in completion mode even if completing
+ with empty string.
+Files: src/edit.c
+
+
+*** ../vim-7.1.144/src/edit.c Thu Sep 13 18:25:08 2007
+--- src/edit.c Fri Oct 19 16:04:38 2007
+***************
+*** 129,134 ****
+--- 129,135 ----
+
+ static void ins_ctrl_x __ARGS((void));
+ static int has_compl_option __ARGS((int dict_opt));
++ static int ins_compl_accept_char __ARGS((int c));
+ static int ins_compl_add __ARGS((char_u *str, int len, int icase, char_u *fname, char_u **cptext, int cdir, int flags, int adup));
+ static int ins_compl_equal __ARGS((compl_T *match, char_u *str, int len));
+ static void ins_compl_longest_match __ARGS((compl_T *match));
+***************
+*** 754,761 ****
+ continue;
+ }
+
+! /* A printable, non-white character: Add to "compl_leader". */
+! if (vim_isprintc(c) && !vim_iswhite(c))
+ {
+ ins_compl_addleader(c);
+ continue;
+--- 755,763 ----
+ continue;
+ }
+
+! /* A non-white character that fits in with the current
+! * completion: Add to "compl_leader". */
+! if (ins_compl_accept_char(c))
+ {
+ ins_compl_addleader(c);
+ continue;
+***************
+*** 2053,2058 ****
+--- 2055,2094 ----
+ }
+
+ /*
++ * Return TRUE when character "c" is part of the item currently being
++ * completed. Used to decide whether to abandon complete mode when the menu
++ * is visible.
++ */
++ static int
++ ins_compl_accept_char(c)
++ int c;
++ {
++ if (ctrl_x_mode & CTRL_X_WANT_IDENT)
++ /* When expanding an identifier only accept identifier chars. */
++ return vim_isIDc(c);
++
++ switch (ctrl_x_mode)
++ {
++ case CTRL_X_FILES:
++ /* When expanding file name only accept file name chars. But not
++ * path separators, so that "proto/<Tab>" expands files in
++ * "proto", not "proto/" as a whole */
++ return vim_isfilec(c) && !vim_ispathsep(c);
++
++ case CTRL_X_CMDLINE:
++ case CTRL_X_OMNI:
++ /* Command line and Omni completion can work with just about any
++ * printable character, but do stop at white space. */
++ return vim_isprintc(c) && !vim_iswhite(c);
++
++ case CTRL_X_WHOLE_LINE:
++ /* For while line completion a space can be part of the line. */
++ return vim_isprintc(c);
++ }
++ return vim_iswordc(c);
++ }
++
++ /*
+ * This is like ins_compl_add(), but if 'ic' and 'inf' are set, then the
+ * case of the originally typed text is used, and the case of the completed
+ * text is inferred, ie this tries to work out what case you probably wanted
+***************
+*** 3128,3135 ****
+ p = line + curwin->w_cursor.col;
+ mb_ptr_back(line, p);
+
+! /* Stop completion when the whole word was deleted. */
+! if ((int)(p - line) - (int)compl_col <= 0)
+ return K_BS;
+
+ /* Deleted more than what was used to find matches or didn't finish
+--- 3164,3174 ----
+ p = line + curwin->w_cursor.col;
+ mb_ptr_back(line, p);
+
+! /* Stop completion when the whole word was deleted. For Omni completion
+! * allow the word to be deleted, we won't match everything. */
+! if ((int)(p - line) - (int)compl_col < 0
+! || ((int)(p - line) - (int)compl_col == 0
+! && (ctrl_x_mode & CTRL_X_OMNI) == 0))
+ return K_BS;
+
+ /* Deleted more than what was used to find matches or didn't finish
+***************
+*** 4591,4604 ****
+ curs_col = curwin->w_cursor.col;
+ compl_pending = 0;
+
+! /* if this same ctrl_x_mode has been interrupted use the text from
+ * "compl_startpos" to the cursor as a pattern to add a new word
+ * instead of expand the one before the cursor, in word-wise if
+! * "compl_startpos"
+! * is not in the same line as the cursor then fix it (the line has
+! * been split because it was longer than 'tw'). if SOL is set then
+! * skip the previous pattern, a word at the beginning of the line has
+! * been inserted, we'll look for that -- Acevedo. */
+ if ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT
+ && compl_cont_mode == ctrl_x_mode)
+ {
+--- 4630,4642 ----
+ curs_col = curwin->w_cursor.col;
+ compl_pending = 0;
+
+! /* If this same ctrl_x_mode has been interrupted use the text from
+ * "compl_startpos" to the cursor as a pattern to add a new word
+ * instead of expand the one before the cursor, in word-wise if
+! * "compl_startpos" is not in the same line as the cursor then fix it
+! * (the line has been split because it was longer than 'tw'). if SOL
+! * is set then skip the previous pattern, a word at the beginning of
+! * the line has been inserted, we'll look for that -- Acevedo. */
+ if ((compl_cont_status & CONT_INTRPT) == CONT_INTRPT
+ && compl_cont_mode == ctrl_x_mode)
+ {
+*** ../vim-7.1.144/src/version.c Fri Oct 19 18:57:33 2007
+--- src/version.c Fri Oct 19 20:38:21 2007
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 145,
+ /**/
+
+--
+Micro$oft: where do you want to go today?
+ Linux: where do you want to go tomorrow?
+ FreeBSD: are you guys coming, or what?
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ download, build and distribute -- http://www.A-A-P.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///