--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.245
+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.245
+Problem: Pressing CTRL-\ three times causes Vim to quit. (Ranganath Rao).
+ Also for f CTRL-\ CTRL-\.
+Solution: When going to cooked mode in mch_delay() set a flag to ignore
+ SIGQUIT.
+Files: src/os_unix.c
+
+
+*** ../vim-7.1.244/src/os_unix.c Sun Jan 13 16:30:23 2008
+--- src/os_unix.c Sun Feb 10 22:07:27 2008
+***************
+*** 195,200 ****
+--- 195,201 ----
+ static int show_shell_mess = TRUE;
+ #endif
+ static int deadly_signal = 0; /* The signal we caught */
++ static int in_mch_delay = FALSE; /* sleeping in mch_delay() */
+
+ static int curr_tmode = TMODE_COOK; /* contains current terminal mode */
+
+***************
+*** 538,544 ****
+ if (ignoreinput)
+ {
+ /* Go to cooked mode without echo, to allow SIGINT interrupting us
+! * here */
+ old_tmode = curr_tmode;
+ if (curr_tmode == TMODE_RAW)
+ settmode(TMODE_SLEEP);
+--- 539,547 ----
+ if (ignoreinput)
+ {
+ /* Go to cooked mode without echo, to allow SIGINT interrupting us
+! * here. But we don't want QUIT to kill us (CTRL-\ used in a
+! * shell may produce SIGQUIT). */
+! in_mch_delay = TRUE;
+ old_tmode = curr_tmode;
+ if (curr_tmode == TMODE_RAW)
+ settmode(TMODE_SLEEP);
+***************
+*** 602,607 ****
+--- 605,611 ----
+ #endif
+
+ settmode(old_tmode);
++ in_mch_delay = FALSE;
+ }
+ else
+ WaitForChar(msec);
+***************
+*** 922,927 ****
+--- 926,939 ----
+ #endif
+
+ #ifdef SIGHASARG
++ # ifdef SIGQUIT
++ /* While in mch_delay() we go to cooked mode to allow a CTRL-C to
++ * interrupt us. But in cooked mode we may also get SIGQUIT, e.g., when
++ * pressing CTRL-\, but we don't want Vim to exit then. */
++ if (in_mch_delay && sigarg == SIGQUIT)
++ SIGRETURN;
++ # endif
++
+ /* When SIGHUP, SIGQUIT, etc. are blocked: postpone the effect and return
+ * here. This avoids that a non-reentrant function is interrupted, e.g.,
+ * free(). Calling free() again may then cause a crash. */
+*** ../vim-7.1.244/src/version.c Wed Feb 6 17:33:19 2008
+--- src/version.c Sun Feb 10 22:04:09 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 245,
+ /**/
+
+--
+Me? A skeptic? I trust you have proof.
+
+ /// 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.246
+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.246
+Problem: Configure hangs when the man pager is something strange. (lorien)
+Solution: Set MANPAGER and PAGER to "cat". (Micah Cowan)
+Files: src/auto/configure, src/configure.in
+
+
+*** ../vim-7.1.245/src/auto/configure Tue Jan 1 16:25:33 2008
+--- src/auto/configure Wed Feb 13 10:22:56 2008
+***************
+*** 14259,14265 ****
+ echo "$as_me:$LINENO: checking how to run man with a section nr" >&5
+ echo $ECHO_N "checking how to run man with a section nr... $ECHO_C" >&6
+ MANDEF="man"
+! (eval man -s 2 read) < /dev/null > /dev/null 2>&5 && MANDEF="man -s"
+ echo "$as_me:$LINENO: result: $MANDEF" >&5
+ echo "${ECHO_T}$MANDEF" >&6
+ if test "$MANDEF" = "man -s"; then
+--- 14259,14265 ----
+ echo "$as_me:$LINENO: checking how to run man with a section nr" >&5
+ echo $ECHO_N "checking how to run man with a section nr... $ECHO_C" >&6
+ MANDEF="man"
+! (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&5 && MANDEF="man -s"
+ echo "$as_me:$LINENO: result: $MANDEF" >&5
+ echo "${ECHO_T}$MANDEF" >&6
+ if test "$MANDEF" = "man -s"; then
+*** ../vim-7.1.245/src/configure.in Tue Jan 1 16:25:33 2008
+--- src/configure.in Fri Jan 25 20:51:51 2008
+***************
+*** 2726,2732 ****
+ dnl Check how we can run man with a section number
+ AC_MSG_CHECKING(how to run man with a section nr)
+ MANDEF="man"
+! (eval man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
+ AC_MSG_RESULT($MANDEF)
+ if test "$MANDEF" = "man -s"; then
+ AC_DEFINE(USEMAN_S)
+--- 2726,2732 ----
+ dnl Check how we can run man with a section number
+ AC_MSG_CHECKING(how to run man with a section nr)
+ MANDEF="man"
+! (eval MANPAGER=cat PAGER=cat man -s 2 read) < /dev/null > /dev/null 2>&AC_FD_CC && MANDEF="man -s"
+ AC_MSG_RESULT($MANDEF)
+ if test "$MANDEF" = "man -s"; then
+ AC_DEFINE(USEMAN_S)
+*** ../vim-7.1.245/src/version.c Sun Feb 10 22:25:12 2008
+--- src/version.c Wed Feb 13 10:26:47 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 246,
+ /**/
+
+--
+Anyone who is capable of getting themselves made President should on no
+account be allowed to do the job.
+ -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
+
+ /// 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.247
+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.247
+Problem: When using Netbeans backspacing in Insert mode skips a character
+ now and then. (Ankit Jain)
+Solution: Avoid calling netbeans_removed(), it frees the line pointer.
+ (partly by Dominique Pelle).
+Files: src/misc1.c
+
+
+*** ../vim-7.1.246/src/misc1.c Sat Jan 19 15:55:51 2008
+--- src/misc1.c Wed Feb 13 10:56:16 2008
+***************
+*** 2270,2282 ****
+ /*
+ * If the old line has been allocated the deletion can be done in the
+ * existing line. Otherwise a new line has to be allocated
+ */
+- was_alloced = ml_line_alloced(); /* check if oldp was allocated */
+ #ifdef FEAT_NETBEANS_INTG
+! if (was_alloced && usingNetbeans)
+! netbeans_removed(curbuf, lnum, col, count);
+! /* else is handled by ml_replace() */
+ #endif
+ if (was_alloced)
+ newp = oldp; /* use same allocated memory */
+ else
+--- 2270,2285 ----
+ /*
+ * If the old line has been allocated the deletion can be done in the
+ * existing line. Otherwise a new line has to be allocated
++ * Can't do this when using Netbeans, because we would need to invoke
++ * netbeans_removed(), which deallocates the line. Let ml_replace() take
++ * care of notifiying Netbeans.
+ */
+ #ifdef FEAT_NETBEANS_INTG
+! if (usingNetbeans)
+! was_alloced = FALSE;
+! else
+ #endif
++ was_alloced = ml_line_alloced(); /* check if oldp was allocated */
+ if (was_alloced)
+ newp = oldp; /* use same allocated memory */
+ else
+***************
+*** 3978,3984 ****
+ /* remove trailing path separator */
+ #ifndef MACOS_CLASSIC
+ /* With MacOS path (with colons) the final colon is required */
+! /* to avoid confusion between absoulute and relative path */
+ if (pend > p && after_pathsep(p, pend))
+ --pend;
+ #endif
+--- 3981,3987 ----
+ /* remove trailing path separator */
+ #ifndef MACOS_CLASSIC
+ /* With MacOS path (with colons) the final colon is required */
+! /* to avoid confusion between absolute and relative path */
+ if (pend > p && after_pathsep(p, pend))
+ --pend;
+ #endif
+***************
+*** 5689,5695 ****
+ else if (lookfor_ctor_init || class_or_struct)
+ {
+ /* we have something found, that looks like the start of
+! * cpp-base-class-declaration or contructor-initialization */
+ cpp_base_class = TRUE;
+ lookfor_ctor_init = class_or_struct = FALSE;
+ *col = 0;
+--- 5692,5698 ----
+ else if (lookfor_ctor_init || class_or_struct)
+ {
+ /* we have something found, that looks like the start of
+! * cpp-base-class-declaration or constructor-initialization */
+ cpp_base_class = TRUE;
+ lookfor_ctor_init = class_or_struct = FALSE;
+ *col = 0;
+***************
+*** 6146,6152 ****
+ pos_T our_paren_pos;
+ char_u *start;
+ int start_brace;
+! #define BRACE_IN_COL0 1 /* '{' is in comumn 0 */
+ #define BRACE_AT_START 2 /* '{' is at start of line */
+ #define BRACE_AT_END 3 /* '{' is at end of line */
+ linenr_T ourscope;
+--- 6149,6155 ----
+ pos_T our_paren_pos;
+ char_u *start;
+ int start_brace;
+! #define BRACE_IN_COL0 1 /* '{' is in column 0 */
+ #define BRACE_AT_START 2 /* '{' is at start of line */
+ #define BRACE_AT_END 3 /* '{' is at end of line */
+ linenr_T ourscope;
+***************
+*** 6369,6375 ****
+ if (curwin->w_cursor.lnum > 1)
+ {
+ /* If the start comment string matches in the previous
+! * line, use the indent of that line pluss offset. If
+ * the middle comment string matches in the previous
+ * line, use the indent of that line. XXX */
+ look = skipwhite(ml_get(curwin->w_cursor.lnum - 1));
+--- 6372,6378 ----
+ if (curwin->w_cursor.lnum > 1)
+ {
+ /* If the start comment string matches in the previous
+! * line, use the indent of that line plus offset. If
+ * the middle comment string matches in the previous
+ * line, use the indent of that line. XXX */
+ look = skipwhite(ml_get(curwin->w_cursor.lnum - 1));
+***************
+*** 8222,8228 ****
+
+ if (*that && *that != ';') /* not a comment line */
+ {
+! /* test *that != '(' to accomodate first let/do
+ * argument if it is more than one line */
+ if (!vi_lisp && *that != '(' && *that != '[')
+ firsttry++;
+--- 8225,8231 ----
+
+ if (*that && *that != ';') /* not a comment line */
+ {
+! /* test *that != '(' to accommodate first let/do
+ * argument if it is more than one line */
+ if (!vi_lisp && *that != '(' && *that != '[')
+ firsttry++;
+*** ../vim-7.1.246/src/version.c Wed Feb 13 10:27:28 2008
+--- src/version.c Wed Feb 13 10:56:42 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 247,
+ /**/
+
+--
+Far back in the mists of ancient time, in the great and glorious days of the
+former Galactic Empire, life was wild, rich and largely tax free.
+Mighty starships plied their way between exotic suns, seeking adventure and
+reward among the furthest reaches of Galactic space. In those days, spirits
+were brave, the stakes were high, men were real men, women were real women
+and small furry creatures from Alpha Centauri were real small furry creatures
+from Alpha Centauri. And all dared to brave unknown terrors, to do mighty
+deeds, to boldly split infinitives that no man had split before -- and thus
+was the Empire forged.
+ -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
+
+ /// 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.248
+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.248
+Problem: Can't set the '" mark. Can't know if setpos() was successful.
+Solution: Allow setting the '" mark with setpos(). Have setpos() return a
+ value indicating success/failure.
+Files: runtime/doc/eval.txt, src/eval.c, src/mark.c
+
+
+*** ../vim-7.1.247/runtime/doc/eval.txt Sat Jan 12 16:45:25 2008
+--- runtime/doc/eval.txt Wed Feb 13 11:49:16 2008
+***************
+*** 1,4 ****
+! *eval.txt* For Vim version 7.1. Last change: 2008 Jan 11
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+--- 1,4 ----
+! *eval.txt* For Vim version 7.1. Last change: 2008 Feb 13
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+***************
+*** 4523,4528 ****
+--- 4528,4536 ----
+ character. E.g., a position within a <Tab> or after the last
+ character.
+
++ Returns 0 when the position could be set, -1 otherwise.
++ An error message is given if {expr} is invalid.
++
+ Also see |getpos()|
+
+ This does not restore the preferred column for moving
+*** ../vim-7.1.247/src/eval.c Tue Jan 22 11:58:41 2008
+--- src/eval.c Wed Feb 13 11:54:09 2008
+***************
+*** 14776,14799 ****
+ int fnum;
+ char_u *name;
+
+ name = get_tv_string_chk(argvars);
+ if (name != NULL)
+ {
+ if (list2fpos(&argvars[1], &pos, &fnum) == OK)
+ {
+ --pos.col;
+! if (name[0] == '.') /* cursor */
+ {
+ if (fnum == curbuf->b_fnum)
+ {
+ curwin->w_cursor = pos;
+ check_cursor();
+ }
+ else
+ EMSG(_(e_invarg));
+ }
+! else if (name[0] == '\'') /* mark */
+! (void)setmark_pos(name[1], &pos, fnum);
+ else
+ EMSG(_(e_invarg));
+ }
+--- 14778,14808 ----
+ int fnum;
+ char_u *name;
+
++ rettv->vval.v_number = -1;
+ name = get_tv_string_chk(argvars);
+ if (name != NULL)
+ {
+ if (list2fpos(&argvars[1], &pos, &fnum) == OK)
+ {
+ --pos.col;
+! if (name[0] == '.' && name[1] == NUL)
+ {
++ /* set cursor */
+ if (fnum == curbuf->b_fnum)
+ {
+ curwin->w_cursor = pos;
+ check_cursor();
++ rettv->vval.v_number = 0;
+ }
+ else
+ EMSG(_(e_invarg));
+ }
+! else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
+! {
+! /* set mark */
+! if (setmark_pos(name[1], &pos, fnum) == OK)
+! rettv->vval.v_number = 0;
+! }
+ else
+ EMSG(_(e_invarg));
+ }
+*** ../vim-7.1.247/src/mark.c Thu Jan 3 20:21:34 2008
+--- src/mark.c Wed Feb 13 11:42:30 2008
+***************
+*** 79,84 ****
+--- 79,90 ----
+ return OK;
+ }
+
++ if (c == '"')
++ {
++ curbuf->b_last_cursor = *pos;
++ return OK;
++ }
++
+ /* Allow setting '[ and '] for an autocommand that simulates reading a
+ * file. */
+ if (c == '[')
+*** ../vim-7.1.247/src/version.c Wed Feb 13 10:57:11 2008
+--- src/version.c Wed Feb 13 12:39:23 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 248,
+ /**/
+
+--
+"Making it up? Why should I want to make anything up? Life's bad enough
+as it is without wanting to invent any more of it."
+ -- Marvin, the Paranoid Android in Douglas Adams'
+ "The Hitchhiker's Guide to the Galaxy"
+
+ /// 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.249
+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.249
+Problem: After "U" the cursor can be past end of line. (Adri Verhoef)
+Solution: Adjust the cursor position in u_undoline().
+Files: src/undo.c
+
+
+*** ../vim-7.1.248/src/undo.c Sat Nov 10 22:50:20 2007
+--- src/undo.c Wed Feb 13 15:17:54 2008
+***************
+*** 1814,1826 ****
+ if (undo_off)
+ return;
+
+! if (curbuf->b_u_line_ptr == NULL ||
+! curbuf->b_u_line_lnum > curbuf->b_ml.ml_line_count)
+ {
+ beep_flush();
+ return;
+ }
+! /* first save the line for the 'u' command */
+ if (u_savecommon(curbuf->b_u_line_lnum - 1,
+ curbuf->b_u_line_lnum + 1, (linenr_T)0) == FAIL)
+ return;
+--- 1814,1827 ----
+ if (undo_off)
+ return;
+
+! if (curbuf->b_u_line_ptr == NULL
+! || curbuf->b_u_line_lnum > curbuf->b_ml.ml_line_count)
+ {
+ beep_flush();
+ return;
+ }
+!
+! /* first save the line for the 'u' command */
+ if (u_savecommon(curbuf->b_u_line_lnum - 1,
+ curbuf->b_u_line_lnum + 1, (linenr_T)0) == FAIL)
+ return;
+***************
+*** 1840,1845 ****
+--- 1841,1847 ----
+ curbuf->b_u_line_colnr = curwin->w_cursor.col;
+ curwin->w_cursor.col = t;
+ curwin->w_cursor.lnum = curbuf->b_u_line_lnum;
++ check_cursor_col();
+ }
+
+ /*
+*** ../vim-7.1.248/src/version.c Wed Feb 13 12:41:30 2008
+--- src/version.c Wed Feb 13 15:20:12 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 249,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+1. At lunch time, sit in your parked car with sunglasses on and point
+ a hair dryer at passing cars. See if they slow down.
+
+ /// 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.250
+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.250
+Problem: ":setglobal fenc=anything" gives an error message in a buffer
+ where 'modifiable' is off. (Ben Schmidt)
+Solution: Don't give an error if 'modifiable' doesn't matter.
+Files: src/option.c
+
+
+*** ../vim-7.1.249/src/option.c Sat Jan 19 15:55:51 2008
+--- src/option.c Wed Feb 13 18:31:39 2008
+***************
+*** 5671,5677 ****
+ {
+ if (gvarp == &p_fenc)
+ {
+! if (!curbuf->b_p_ma)
+ errmsg = e_modifiable;
+ else if (vim_strchr(*varp, ',') != NULL)
+ /* No comma allowed in 'fileencoding'; catches confusing it
+--- 5671,5677 ----
+ {
+ if (gvarp == &p_fenc)
+ {
+! if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL)
+ errmsg = e_modifiable;
+ else if (vim_strchr(*varp, ',') != NULL)
+ /* No comma allowed in 'fileencoding'; catches confusing it
+*** ../vim-7.1.249/src/version.c Wed Feb 13 15:20:59 2008
+--- src/version.c Wed Feb 13 18:34:24 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 250,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+3. Every time someone asks you to do something, ask if they want fries
+ with that.
+
+ /// 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.251
+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.251
+Problem: Using freed memory when spell checking enabled.
+Solution: Obtain the current line again after calling spell_move_to().
+ (Dominique Pelle)
+Files: src/screen.c
+
+
+*** ../vim-7.1.250/src/screen.c Sat Jan 19 15:55:51 2008
+--- src/screen.c Wed Feb 13 21:45:38 2008
+***************
+*** 2644,2650 ****
+ #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
+ || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
+ # define LINE_ATTR
+! int line_attr = 0; /* atrribute for the whole line */
+ #endif
+ #ifdef FEAT_SEARCH_EXTRA
+ matchitem_T *cur; /* points to the match list */
+--- 2644,2650 ----
+ #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
+ || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
+ # define LINE_ATTR
+! int line_attr = 0; /* attribute for the whole line */
+ #endif
+ #ifdef FEAT_SEARCH_EXTRA
+ matchitem_T *cur; /* points to the match list */
+***************
+*** 3040,3057 ****
+ if (has_spell)
+ {
+ int len;
+ hlf_T spell_hlf = HLF_COUNT;
+
+ pos = wp->w_cursor;
+ wp->w_cursor.lnum = lnum;
+! wp->w_cursor.col = (colnr_T)(ptr - line);
+ len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf);
+ if (len == 0 || (int)wp->w_cursor.col > ptr - line)
+ {
+ /* no bad word found at line start, don't check until end of a
+ * word */
+ spell_hlf = HLF_COUNT;
+! word_end = (int)(spell_to_word_end(ptr, wp->w_buffer) - line + 1);
+ }
+ else
+ {
+--- 3040,3064 ----
+ if (has_spell)
+ {
+ int len;
++ colnr_T linecol = (colnr_T)(ptr - line);
+ hlf_T spell_hlf = HLF_COUNT;
+
+ pos = wp->w_cursor;
+ wp->w_cursor.lnum = lnum;
+! wp->w_cursor.col = linecol;
+ len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_hlf);
++
++ /* spell_move_to() may call ml_get() and make "line" invalid */
++ line = ml_get_buf(wp->w_buffer, lnum, FALSE);
++ ptr = line + linecol;
++
+ if (len == 0 || (int)wp->w_cursor.col > ptr - line)
+ {
+ /* no bad word found at line start, don't check until end of a
+ * word */
+ spell_hlf = HLF_COUNT;
+! word_end = (int)(spell_to_word_end(ptr, wp->w_buffer)
+! - line + 1);
+ }
+ else
+ {
+*** ../vim-7.1.250/src/version.c Wed Feb 13 18:35:23 2008
+--- src/version.c Wed Feb 13 21:48:08 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 251,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+6. In the memo field of all your checks, write "for sexual favors".
+
+ /// 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.252
+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.252 (after 7.1.243)
+Problem: Test 39 fails when the environment has a utf-8 locale. (Dominique
+ Pelle)
+Solution: Force 'encoding' to be latin1.
+Files: src/testdir/test39.in
+
+
+*** ../vim-7.1.251/src/testdir/test39.in Wed Feb 6 14:43:50 2008
+--- src/testdir/test39.in Thu Feb 14 22:16:57 2008
+***************
+*** 5,10 ****
+--- 5,12 ----
+ STARTTEST
+ :so small.vim
+ :so mbyte.vim
++ :" This only works when 'encoding' is "latin1", don't depend on the environment
++ :set enc=latin1
+ /^abcde
+ :" Test shift-right of a block
+ jllll\16jj>wll\16jlll>
+*** ../vim-7.1.251/src/version.c Wed Feb 13 21:48:24 2008
+--- src/version.c Thu Feb 14 22:18:11 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 252,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+9. As often as possible, skip rather than walk.
+
+ /// 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.253
+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.253
+Problem: ":sort" doesn't work in a one line file. (Patrick Texier)
+Solution: Don't sort if there is only one line. (Dominique Pelle)
+Files: src/ex_cmds.c
+
+
+*** ../vim-7.1.252/src/ex_cmds.c Sat Jan 19 15:55:51 2008
+--- src/ex_cmds.c Mon Feb 18 19:38:02 2008
+***************
+*** 365,370 ****
+--- 365,374 ----
+ int sort_oct; /* sort on octal number */
+ int sort_hex; /* sort on hex number */
+
++ /* Sorting one line is really quick! */
++ if (count <= 1)
++ return;
++
+ if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL)
+ return;
+ sortbuf1 = NULL;
+*** ../vim-7.1.252/src/version.c Thu Feb 14 22:19:39 2008
+--- src/version.c Mon Feb 18 19:39:24 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 253,
+ /**/
+
+--
+"You know, it's at times like this when I'm trapped in a Vogon airlock with
+a man from Betelgeuse and about to die of asphyxiation in deep space that I
+really wish I'd listened to what my mother told me when I was young!"
+"Why, what did she tell you?"
+"I don't know, I didn't listen!"
+ -- Arthur Dent and Ford Prefect in Douglas Adams'
+ "The Hitchhiker's Guide to the Galaxy"
+
+ /// 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.254
+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.254
+Problem: Tests 49 and 55 fail when the locale is French.
+Solution: Using C messages for test 49. Filter the error message in test 55
+ such that it works when the number is halfway the message.
+Files: src/testdir/test49.in, src/testdir/test55.in
+
+
+*** ../vim-7.1.253/src/testdir/test49.in Tue Sep 25 17:54:41 2007
+--- src/testdir/test49.in Tue Feb 19 21:03:20 2008
+***************
+*** 6,11 ****
+--- 6,12 ----
+ STARTTEST
+ :so small.vim
+ :se nocp nomore viminfo+=nviminfo
++ :lang mess C
+ :so test49.vim
+ GGGGGGGGGGGGGG"rp:.-,$w! test.out
+ :"
+*** ../vim-7.1.253/src/testdir/test55.in Tue Sep 25 17:54:41 2007
+--- src/testdir/test55.in Tue Feb 19 21:06:21 2008
+***************
+*** 146,152 ****
+ :try
+ : let n = d[1500]
+ :catch
+! : $put =v:exception[:14] . v:exception[-4:-1]
+ :endtry
+ :" lookup each items
+ :for i in range(1500)
+--- 146,152 ----
+ :try
+ : let n = d[1500]
+ :catch
+! : $put =substitute(v:exception, '\v(.{14}).*( \d{4}).*', '\1\2', '')
+ :endtry
+ :" lookup each items
+ :for i in range(1500)
+*** ../vim-7.1.253/src/version.c Mon Feb 18 19:41:40 2008
+--- src/version.c Wed Feb 20 10:16:59 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 254,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+34. You laugh at people with 14400 baud modems.
+
+ /// 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.255
+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.255
+Problem: Vim doesn't support utf-32. (Yongwei Wu)
+Solution: Add aliases for utf-32, it's the same as ucs-4.
+Files: src/mbyte.c
+
+
+*** ../vim-7.1.254/src/mbyte.c Sun Jan 6 17:18:16 2008
+--- src/mbyte.c Tue Feb 19 20:31:48 2008
+***************
+*** 360,365 ****
+--- 360,371 ----
+ {"ucs4be", IDX_UCS4},
+ {"ucs-4be", IDX_UCS4},
+ {"ucs4le", IDX_UCS4LE},
++ {"utf32", IDX_UCS4},
++ {"utf-32", IDX_UCS4},
++ {"utf32be", IDX_UCS4},
++ {"utf-32be", IDX_UCS4},
++ {"utf32le", IDX_UCS4LE},
++ {"utf-32le", IDX_UCS4LE},
+ {"932", IDX_CP932},
+ {"949", IDX_CP949},
+ {"936", IDX_CP936},
+*** ../vim-7.1.254/src/version.c Wed Feb 20 10:57:11 2008
+--- src/version.c Wed Feb 20 11:27:00 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 255,
+ /**/
+
+--
+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.256
+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.256
+Problem: findfile() also returns directories.
+Solution: Cleanup the code for finding files and directories in a list of
+ directories. Remove the ugly global ff_search_ctx.
+Files: src/eval.c, src/misc2.c, src/vim.h, src/tag.c
+
+
+*** ../vim-7.1.255/src/eval.c Wed Feb 13 12:41:30 2008
+--- src/eval.c Wed Feb 20 11:08:21 2008
+***************
+*** 9203,9215 ****
+ rettv->vval.v_number = filewritable(get_tv_string(&argvars[0]));
+ }
+
+! static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int dir));
+
+ static void
+! findfilendir(argvars, rettv, dir)
+ typval_T *argvars;
+ typval_T *rettv;
+! int dir;
+ {
+ #ifdef FEAT_SEARCHPATH
+ char_u *fname;
+--- 9205,9217 ----
+ rettv->vval.v_number = filewritable(get_tv_string(&argvars[0]));
+ }
+
+! static void findfilendir __ARGS((typval_T *argvars, typval_T *rettv, int find_what));
+
+ static void
+! findfilendir(argvars, rettv, find_what)
+ typval_T *argvars;
+ typval_T *rettv;
+! int find_what;
+ {
+ #ifdef FEAT_SEARCHPATH
+ char_u *fname;
+***************
+*** 9254,9261 ****
+ vim_free(fresult);
+ fresult = find_file_in_path_option(first ? fname : NULL,
+ first ? (int)STRLEN(fname) : 0,
+! 0, first, path, dir, curbuf->b_ffname,
+! dir ? (char_u *)"" : curbuf->b_p_sua);
+ first = FALSE;
+
+ if (fresult != NULL && rettv->v_type == VAR_LIST)
+--- 9256,9266 ----
+ vim_free(fresult);
+ fresult = find_file_in_path_option(first ? fname : NULL,
+ first ? (int)STRLEN(fname) : 0,
+! 0, first, path,
+! find_what,
+! curbuf->b_ffname,
+! find_what == FINDFILE_DIR
+! ? (char_u *)"" : curbuf->b_p_sua);
+ first = FALSE;
+
+ if (fresult != NULL && rettv->v_type == VAR_LIST)
+***************
+*** 9445,9451 ****
+ typval_T *argvars;
+ typval_T *rettv;
+ {
+! findfilendir(argvars, rettv, TRUE);
+ }
+
+ /*
+--- 9450,9456 ----
+ typval_T *argvars;
+ typval_T *rettv;
+ {
+! findfilendir(argvars, rettv, FINDFILE_DIR);
+ }
+
+ /*
+***************
+*** 9456,9462 ****
+ typval_T *argvars;
+ typval_T *rettv;
+ {
+! findfilendir(argvars, rettv, FALSE);
+ }
+
+ /*
+--- 9461,9467 ----
+ typval_T *argvars;
+ typval_T *rettv;
+ {
+! findfilendir(argvars, rettv, FINDFILE_FILE);
+ }
+
+ /*
+*** ../vim-7.1.255/src/misc2.c Fri Jan 4 21:25:01 2008
+--- src/misc2.c Wed Feb 13 17:19:21 2008
+***************
+*** 3777,3785 ****
+ char_u ffs_filearray_cur; /* needed for partly handled dirs */
+
+ /* to store status of partly handled directories
+! * 0: we work the on this directory for the first time
+ * 1: this directory was partly searched in an earlier step
+! */
+ int ffs_stage;
+
+ /* How deep are we in the directory tree?
+--- 3778,3786 ----
+ char_u ffs_filearray_cur; /* needed for partly handled dirs */
+
+ /* to store status of partly handled directories
+! * 0: we work on this directory for the first time
+ * 1: this directory was partly searched in an earlier step
+! */
+ int ffs_stage;
+
+ /* How deep are we in the directory tree?
+***************
+*** 3848,3853 ****
+--- 3849,3855 ----
+ * Set the default maximum depth.
+ */
+ #define FF_MAX_STAR_STAR_EXPAND ((char_u)30)
++
+ /*
+ * The search context:
+ * ffsc_stack_ptr: the stack for the dirs to search
+***************
+*** 3862,3868 ****
+ * ffsc_wc_path: the part of the given path containing wildcards
+ * ffsc_level: how many levels of dirs to search downwards
+ * ffsc_stopdirs_v: array of stop directories for upward search
+! * ffsc_need_dir: TRUE if we search for a directory
+ */
+ typedef struct ff_search_ctx_T
+ {
+--- 3864,3870 ----
+ * ffsc_wc_path: the part of the given path containing wildcards
+ * ffsc_level: how many levels of dirs to search downwards
+ * ffsc_stopdirs_v: array of stop directories for upward search
+! * ffsc_find_what: FINDFILE_BOTH, FINDFILE_DIR or FINDFILE_FILE
+ */
+ typedef struct ff_search_ctx_T
+ {
+***************
+*** 3879,3889 ****
+ int ffsc_level;
+ char_u **ffsc_stopdirs_v;
+ #endif
+! int ffsc_need_dir;
+ } ff_search_ctx_T;
+
+- static ff_search_ctx_T *ff_search_ctx = NULL;
+-
+ /* locally needed functions */
+ #ifdef FEAT_PATH_EXTRA
+ static int ff_check_visited __ARGS((ff_visited_T **, char_u *, char_u *));
+--- 3881,3889 ----
+ int ffsc_level;
+ char_u **ffsc_stopdirs_v;
+ #endif
+! int ffsc_find_what;
+ } ff_search_ctx_T;
+
+ /* locally needed functions */
+ #ifdef FEAT_PATH_EXTRA
+ static int ff_check_visited __ARGS((ff_visited_T **, char_u *, char_u *));
+***************
+*** 3897,3906 ****
+ static int ff_wc_equal __ARGS((char_u *s1, char_u *s2));
+ #endif
+
+! static void ff_push __ARGS((ff_stack_T *));
+! static ff_stack_T * ff_pop __ARGS((void));
+! static void ff_clear __ARGS((void));
+! static void ff_free_stack_element __ARGS((ff_stack_T *));
+ #ifdef FEAT_PATH_EXTRA
+ static ff_stack_T *ff_create_stack_element __ARGS((char_u *, char_u *, int, int));
+ #else
+--- 3897,3906 ----
+ static int ff_wc_equal __ARGS((char_u *s1, char_u *s2));
+ #endif
+
+! static void ff_push __ARGS((ff_search_ctx_T *search_ctx, ff_stack_T *stack_ptr));
+! static ff_stack_T *ff_pop __ARGS((ff_search_ctx_T *search_ctx));
+! static void ff_clear __ARGS((ff_search_ctx_T *search_ctx));
+! static void ff_free_stack_element __ARGS((ff_stack_T *stack_ptr));
+ #ifdef FEAT_PATH_EXTRA
+ static ff_stack_T *ff_create_stack_element __ARGS((char_u *, char_u *, int, int));
+ #else
+***************
+*** 3961,3966 ****
+--- 3961,3969 ----
+ * not related to restricts given to the '**' wildcard. If 'level' is 100
+ * and you use '**200' vim_findfile() will stop after 100 levels.
+ *
++ * 'filename' cannot contain wildcards! It is used as-is, no backslashes to
++ * escape special characters.
++ *
+ * If 'stopdirs' is not NULL and nothing is found downward, the search is
+ * restarted on the next higher directory level. This is repeated until the
+ * start-directory of a search is contained in 'stopdirs'. 'stopdirs' has the
+***************
+*** 3980,4053 ****
+ * The list of visited files/dirs can also be cleared with the function
+ * vim_findfile_free_visited().
+ *
+! * Set the parameter 'need_dir' to TRUE if you want to search for a directory
+! * instead of a file.
+ *
+ * A search context returned by a previous call to vim_findfile_init() can be
+! * passed in the parameter 'search_ctx'. This context is than reused and
+! * reinitialized with the new parameters. The list of already viseted
+ * directories from this context is only deleted if the parameter
+! * 'free_visited' is true. Be aware that the passed search_context is freed if
+! * the reinitialization fails.
+ *
+! * If you don't have a search context from a previous call 'search_ctx' must be
+! * NULL.
+ *
+ * This function silently ignores a few errors, vim_findfile() will have
+ * limited functionality then.
+ */
+ /*ARGSUSED*/
+ void *
+! vim_findfile_init(path, filename, stopdirs, level, free_visited, need_dir,
+! search_ctx, tagfile, rel_fname)
+ char_u *path;
+ char_u *filename;
+ char_u *stopdirs;
+ int level;
+ int free_visited;
+! int need_dir;
+! void *search_ctx;
+ int tagfile;
+ char_u *rel_fname; /* file name to use for "." */
+ {
+ #ifdef FEAT_PATH_EXTRA
+! char_u *wc_part;
+ #endif
+! ff_stack_T *sptr;
+
+ /* If a search context is given by the caller, reuse it, else allocate a
+ * new one.
+ */
+! if (search_ctx != NULL)
+! ff_search_ctx = search_ctx;
+ else
+ {
+! ff_search_ctx = (ff_search_ctx_T*)alloc(
+! (unsigned)sizeof(ff_search_ctx_T));
+! if (ff_search_ctx == NULL)
+ goto error_return;
+! memset(ff_search_ctx, 0, sizeof(ff_search_ctx_T));
+ }
+
+ /* clear the search context, but NOT the visited lists */
+! ff_clear();
+
+ /* clear visited list if wanted */
+ if (free_visited == TRUE)
+! vim_findfile_free_visited(ff_search_ctx);
+ else
+ {
+ /* Reuse old visited lists. Get the visited list for the given
+ * filename. If no list for the current filename exists, creates a new
+! * one.
+! */
+! ff_search_ctx->ffsc_visited_list = ff_get_visited_list(filename,
+! &ff_search_ctx->ffsc_visited_lists_list);
+! if (ff_search_ctx->ffsc_visited_list == NULL)
+ goto error_return;
+! ff_search_ctx->ffsc_dir_visited_list = ff_get_visited_list(filename,
+! &ff_search_ctx->ffsc_dir_visited_lists_list);
+! if (ff_search_ctx->ffsc_dir_visited_list == NULL)
+ goto error_return;
+ }
+
+--- 3983,4056 ----
+ * The list of visited files/dirs can also be cleared with the function
+ * vim_findfile_free_visited().
+ *
+! * Set the parameter 'find_what' to FINDFILE_DIR if you want to search for
+! * directories only, FINDFILE_FILE for files only, FINDFILE_BOTH for both.
+ *
+ * A search context returned by a previous call to vim_findfile_init() can be
+! * passed in the parameter "search_ctx_arg". This context is reused and
+! * reinitialized with the new parameters. The list of already visited
+ * directories from this context is only deleted if the parameter
+! * "free_visited" is true. Be aware that the passed "search_ctx_arg" is freed
+! * if the reinitialization fails.
+ *
+! * If you don't have a search context from a previous call "search_ctx_arg"
+! * must be NULL.
+ *
+ * This function silently ignores a few errors, vim_findfile() will have
+ * limited functionality then.
+ */
+ /*ARGSUSED*/
+ void *
+! vim_findfile_init(path, filename, stopdirs, level, free_visited, find_what,
+! search_ctx_arg, tagfile, rel_fname)
+ char_u *path;
+ char_u *filename;
+ char_u *stopdirs;
+ int level;
+ int free_visited;
+! int find_what;
+! void *search_ctx_arg;
+ int tagfile;
+ char_u *rel_fname; /* file name to use for "." */
+ {
+ #ifdef FEAT_PATH_EXTRA
+! char_u *wc_part;
+ #endif
+! ff_stack_T *sptr;
+! ff_search_ctx_T *search_ctx;
+
+ /* If a search context is given by the caller, reuse it, else allocate a
+ * new one.
+ */
+! if (search_ctx_arg != NULL)
+! search_ctx = search_ctx_arg;
+ else
+ {
+! search_ctx = (ff_search_ctx_T*)alloc((unsigned)sizeof(ff_search_ctx_T));
+! if (search_ctx == NULL)
+ goto error_return;
+! memset(search_ctx, 0, sizeof(ff_search_ctx_T));
+ }
++ search_ctx->ffsc_find_what = find_what;
+
+ /* clear the search context, but NOT the visited lists */
+! ff_clear(search_ctx);
+
+ /* clear visited list if wanted */
+ if (free_visited == TRUE)
+! vim_findfile_free_visited(search_ctx);
+ else
+ {
+ /* Reuse old visited lists. Get the visited list for the given
+ * filename. If no list for the current filename exists, creates a new
+! * one. */
+! search_ctx->ffsc_visited_list = ff_get_visited_list(filename,
+! &search_ctx->ffsc_visited_lists_list);
+! if (search_ctx->ffsc_visited_list == NULL)
+ goto error_return;
+! search_ctx->ffsc_dir_visited_list = ff_get_visited_list(filename,
+! &search_ctx->ffsc_dir_visited_lists_list);
+! if (search_ctx->ffsc_dir_visited_list == NULL)
+ goto error_return;
+ }
+
+***************
+*** 4071,4082 ****
+ {
+ /* Make the start dir an absolute path name. */
+ vim_strncpy(ff_expand_buffer, rel_fname, len);
+! ff_search_ctx->ffsc_start_dir = FullName_save(ff_expand_buffer,
+! FALSE);
+ }
+ else
+! ff_search_ctx->ffsc_start_dir = vim_strnsave(rel_fname, len);
+! if (ff_search_ctx->ffsc_start_dir == NULL)
+ goto error_return;
+ if (*++path != NUL)
+ ++path;
+--- 4074,4084 ----
+ {
+ /* Make the start dir an absolute path name. */
+ vim_strncpy(ff_expand_buffer, rel_fname, len);
+! search_ctx->ffsc_start_dir = FullName_save(ff_expand_buffer, FALSE);
+ }
+ else
+! search_ctx->ffsc_start_dir = vim_strnsave(rel_fname, len);
+! if (search_ctx->ffsc_start_dir == NULL)
+ goto error_return;
+ if (*++path != NUL)
+ ++path;
+***************
+*** 4101,4108 ****
+ if (mch_dirname(ff_expand_buffer, MAXPATHL) == FAIL)
+ goto error_return;
+
+! ff_search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer);
+! if (ff_search_ctx->ffsc_start_dir == NULL)
+ goto error_return;
+
+ #ifdef BACKSLASH_IN_FILENAME
+--- 4103,4110 ----
+ if (mch_dirname(ff_expand_buffer, MAXPATHL) == FAIL)
+ goto error_return;
+
+! search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer);
+! if (search_ctx->ffsc_start_dir == NULL)
+ goto error_return;
+
+ #ifdef BACKSLASH_IN_FILENAME
+***************
+*** 4110,4117 ****
+ * directory (but not for "//machine/dir"). Only use the drive name. */
+ if ((*path == '/' || *path == '\\')
+ && path[1] != path[0]
+! && ff_search_ctx->ffsc_start_dir[1] == ':')
+! ff_search_ctx->ffsc_start_dir[2] = NUL;
+ #endif
+ }
+
+--- 4112,4119 ----
+ * directory (but not for "//machine/dir"). Only use the drive name. */
+ if ((*path == '/' || *path == '\\')
+ && path[1] != path[0]
+! && search_ctx->ffsc_start_dir[1] == ':')
+! search_ctx->ffsc_start_dir[2] = NUL;
+ #endif
+ }
+
+***************
+*** 4121,4127 ****
+ * If this fails (mem allocation), there is no upward search at all or a
+ * stop directory is not recognized -> continue silently.
+ * If stopdirs just contains a ";" or is empty,
+! * ff_search_ctx->ffsc_stopdirs_v will only contain a NULL pointer. This
+ * is handled as unlimited upward search. See function
+ * ff_path_in_stoplist() for details.
+ */
+--- 4123,4129 ----
+ * If this fails (mem allocation), there is no upward search at all or a
+ * stop directory is not recognized -> continue silently.
+ * If stopdirs just contains a ";" or is empty,
+! * search_ctx->ffsc_stopdirs_v will only contain a NULL pointer. This
+ * is handled as unlimited upward search. See function
+ * ff_path_in_stoplist() for details.
+ */
+***************
+*** 4134,4143 ****
+ walker++;
+
+ dircount = 1;
+! ff_search_ctx->ffsc_stopdirs_v =
+! (char_u **)alloc((unsigned)sizeof(char_u *));
+
+! if (ff_search_ctx->ffsc_stopdirs_v != NULL)
+ {
+ do
+ {
+--- 4136,4145 ----
+ walker++;
+
+ dircount = 1;
+! search_ctx->ffsc_stopdirs_v =
+! (char_u **)alloc((unsigned)sizeof(char_u *));
+
+! if (search_ctx->ffsc_stopdirs_v != NULL)
+ {
+ do
+ {
+***************
+*** 4145,4181 ****
+ void *ptr;
+
+ helper = walker;
+! ptr = vim_realloc(ff_search_ctx->ffsc_stopdirs_v,
+ (dircount + 1) * sizeof(char_u *));
+ if (ptr)
+! ff_search_ctx->ffsc_stopdirs_v = ptr;
+ else
+ /* ignore, keep what we have and continue */
+ break;
+ walker = vim_strchr(walker, ';');
+ if (walker)
+ {
+! ff_search_ctx->ffsc_stopdirs_v[dircount-1] =
+! vim_strnsave(helper, (int)(walker - helper));
+ walker++;
+ }
+ else
+ /* this might be "", which means ascent till top
+ * of directory tree.
+ */
+! ff_search_ctx->ffsc_stopdirs_v[dircount-1] =
+! vim_strsave(helper);
+
+ dircount++;
+
+ } while (walker != NULL);
+! ff_search_ctx->ffsc_stopdirs_v[dircount-1] = NULL;
+ }
+ }
+ #endif
+
+ #ifdef FEAT_PATH_EXTRA
+! ff_search_ctx->ffsc_level = level;
+
+ /* split into:
+ * -fix path
+--- 4147,4183 ----
+ void *ptr;
+
+ helper = walker;
+! ptr = vim_realloc(search_ctx->ffsc_stopdirs_v,
+ (dircount + 1) * sizeof(char_u *));
+ if (ptr)
+! search_ctx->ffsc_stopdirs_v = ptr;
+ else
+ /* ignore, keep what we have and continue */
+ break;
+ walker = vim_strchr(walker, ';');
+ if (walker)
+ {
+! search_ctx->ffsc_stopdirs_v[dircount-1] =
+! vim_strnsave(helper, (int)(walker - helper));
+ walker++;
+ }
+ else
+ /* this might be "", which means ascent till top
+ * of directory tree.
+ */
+! search_ctx->ffsc_stopdirs_v[dircount-1] =
+! vim_strsave(helper);
+
+ dircount++;
+
+ } while (walker != NULL);
+! search_ctx->ffsc_stopdirs_v[dircount-1] = NULL;
+ }
+ }
+ #endif
+
+ #ifdef FEAT_PATH_EXTRA
+! search_ctx->ffsc_level = level;
+
+ /* split into:
+ * -fix path
+***************
+*** 4189,4196 ****
+ char *errpt;
+
+ /* save the fix part of the path */
+! ff_search_ctx->ffsc_fix_path = vim_strnsave(path,
+! (int)(wc_part - path));
+
+ /*
+ * copy wc_path and add restricts to the '**' wildcard.
+--- 4191,4197 ----
+ char *errpt;
+
+ /* save the fix part of the path */
+! search_ctx->ffsc_fix_path = vim_strnsave(path, (int)(wc_part - path));
+
+ /*
+ * copy wc_path and add restricts to the '**' wildcard.
+***************
+*** 4229,4275 ****
+ ff_expand_buffer[len++] = *wc_part++;
+ }
+ ff_expand_buffer[len] = NUL;
+! ff_search_ctx->ffsc_wc_path = vim_strsave(ff_expand_buffer);
+
+! if (ff_search_ctx->ffsc_wc_path == NULL)
+ goto error_return;
+ }
+ else
+ #endif
+! ff_search_ctx->ffsc_fix_path = vim_strsave(path);
+
+! if (ff_search_ctx->ffsc_start_dir == NULL)
+ {
+ /* store the fix part as startdir.
+ * This is needed if the parameter path is fully qualified.
+ */
+! ff_search_ctx->ffsc_start_dir = vim_strsave(ff_search_ctx->ffsc_fix_path);
+! if (ff_search_ctx->ffsc_start_dir)
+! ff_search_ctx->ffsc_fix_path[0] = NUL;
+ }
+
+ /* create an absolute path */
+! STRCPY(ff_expand_buffer, ff_search_ctx->ffsc_start_dir);
+ add_pathsep(ff_expand_buffer);
+! STRCAT(ff_expand_buffer, ff_search_ctx->ffsc_fix_path);
+ add_pathsep(ff_expand_buffer);
+
+ sptr = ff_create_stack_element(ff_expand_buffer,
+ #ifdef FEAT_PATH_EXTRA
+! ff_search_ctx->ffsc_wc_path,
+ #endif
+ level, 0);
+
+ if (sptr == NULL)
+ goto error_return;
+
+! ff_push(sptr);
+
+! ff_search_ctx->ffsc_file_to_search = vim_strsave(filename);
+! if (ff_search_ctx->ffsc_file_to_search == NULL)
+ goto error_return;
+
+! return ff_search_ctx;
+
+ error_return:
+ /*
+--- 4230,4276 ----
+ ff_expand_buffer[len++] = *wc_part++;
+ }
+ ff_expand_buffer[len] = NUL;
+! search_ctx->ffsc_wc_path = vim_strsave(ff_expand_buffer);
+
+! if (search_ctx->ffsc_wc_path == NULL)
+ goto error_return;
+ }
+ else
+ #endif
+! search_ctx->ffsc_fix_path = vim_strsave(path);
+
+! if (search_ctx->ffsc_start_dir == NULL)
+ {
+ /* store the fix part as startdir.
+ * This is needed if the parameter path is fully qualified.
+ */
+! search_ctx->ffsc_start_dir = vim_strsave(search_ctx->ffsc_fix_path);
+! if (search_ctx->ffsc_start_dir)
+! search_ctx->ffsc_fix_path[0] = NUL;
+ }
+
+ /* create an absolute path */
+! STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
+ add_pathsep(ff_expand_buffer);
+! STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
+ add_pathsep(ff_expand_buffer);
+
+ sptr = ff_create_stack_element(ff_expand_buffer,
+ #ifdef FEAT_PATH_EXTRA
+! search_ctx->ffsc_wc_path,
+ #endif
+ level, 0);
+
+ if (sptr == NULL)
+ goto error_return;
+
+! ff_push(search_ctx, sptr);
+
+! search_ctx->ffsc_file_to_search = vim_strsave(filename);
+! if (search_ctx->ffsc_file_to_search == NULL)
+ goto error_return;
+
+! return search_ctx;
+
+ error_return:
+ /*
+***************
+*** 4277,4283 ****
+ * Even when the caller gave us a (perhaps valid) context we free it here,
+ * as we might have already destroyed it.
+ */
+! vim_findfile_cleanup(ff_search_ctx);
+ return NULL;
+ }
+
+--- 4278,4284 ----
+ * Even when the caller gave us a (perhaps valid) context we free it here,
+ * as we might have already destroyed it.
+ */
+! vim_findfile_cleanup(search_ctx);
+ return NULL;
+ }
+
+***************
+*** 4314,4320 ****
+ }
+ #endif
+
+! /* Clean up the given search context. Can handle a NULL pointer */
+ void
+ vim_findfile_cleanup(ctx)
+ void *ctx;
+--- 4315,4323 ----
+ }
+ #endif
+
+! /*
+! * Clean up the given search context. Can handle a NULL pointer.
+! */
+ void
+ vim_findfile_cleanup(ctx)
+ void *ctx;
+***************
+*** 4322,4333 ****
+ if (ctx == NULL)
+ return;
+
+- ff_search_ctx = ctx;
+-
+ vim_findfile_free_visited(ctx);
+! ff_clear();
+ vim_free(ctx);
+- ff_search_ctx = NULL;
+ }
+
+ /*
+--- 4325,4333 ----
+ if (ctx == NULL)
+ return;
+
+ vim_findfile_free_visited(ctx);
+! ff_clear(ctx);
+ vim_free(ctx);
+ }
+
+ /*
+***************
+*** 4343,4357 ****
+ * top of the list).
+ */
+ char_u *
+! vim_findfile(search_ctx)
+! void *search_ctx;
+ {
+ char_u *file_path;
+ #ifdef FEAT_PATH_EXTRA
+ char_u *rest_of_wildcards;
+ char_u *path_end = NULL;
+ #endif
+! ff_stack_T *ctx;
+ #if defined(FEAT_SEARCHPATH) || defined(FEAT_PATH_EXTRA)
+ int len;
+ #endif
+--- 4343,4357 ----
+ * top of the list).
+ */
+ char_u *
+! vim_findfile(search_ctx_arg)
+! void *search_ctx_arg;
+ {
+ char_u *file_path;
+ #ifdef FEAT_PATH_EXTRA
+ char_u *rest_of_wildcards;
+ char_u *path_end = NULL;
+ #endif
+! ff_stack_T *stackp;
+ #if defined(FEAT_SEARCHPATH) || defined(FEAT_PATH_EXTRA)
+ int len;
+ #endif
+***************
+*** 4360,4370 ****
+ #ifdef FEAT_SEARCHPATH
+ char_u *suf;
+ #endif
+
+! if (search_ctx == NULL)
+ return NULL;
+
+! ff_search_ctx = (ff_search_ctx_T*)search_ctx;
+
+ /*
+ * filepath is used as buffer for various actions and as the storage to
+--- 4360,4371 ----
+ #ifdef FEAT_SEARCHPATH
+ char_u *suf;
+ #endif
++ ff_search_ctx_T *search_ctx;
+
+! if (search_ctx_arg == NULL)
+ return NULL;
+
+! search_ctx = (ff_search_ctx_T *)search_ctx_arg;
+
+ /*
+ * filepath is used as buffer for various actions and as the storage to
+***************
+*** 4375,4382 ****
+
+ #ifdef FEAT_PATH_EXTRA
+ /* store the end of the start dir -- needed for upward search */
+! if (ff_search_ctx->ffsc_start_dir != NULL)
+! path_end = &ff_search_ctx->ffsc_start_dir[STRLEN(ff_search_ctx->ffsc_start_dir)];
+ #endif
+
+ #ifdef FEAT_PATH_EXTRA
+--- 4376,4384 ----
+
+ #ifdef FEAT_PATH_EXTRA
+ /* store the end of the start dir -- needed for upward search */
+! if (search_ctx->ffsc_start_dir != NULL)
+! path_end = &search_ctx->ffsc_start_dir[
+! STRLEN(search_ctx->ffsc_start_dir)];
+ #endif
+
+ #ifdef FEAT_PATH_EXTRA
+***************
+*** 4393,4400 ****
+ break;
+
+ /* get directory to work on from stack */
+! ctx = ff_pop();
+! if (ctx == NULL)
+ break;
+
+ /*
+--- 4395,4402 ----
+ break;
+
+ /* get directory to work on from stack */
+! stackp = ff_pop(search_ctx);
+! if (stackp == NULL)
+ break;
+
+ /*
+***************
+*** 4414,4427 ****
+ * /etc/rc.d/init.d is linked to /etc/rc.d -> endless loop)
+ *
+ * This check is only needed for directories we work on for the
+! * first time (hence ctx->ff_filearray == NULL)
+ */
+! if (ctx->ffs_filearray == NULL
+! && ff_check_visited(&ff_search_ctx->ffsc_dir_visited_list
+ ->ffvl_visited_list,
+! ctx->ffs_fix_path
+ #ifdef FEAT_PATH_EXTRA
+! , ctx->ffs_wc_path
+ #endif
+ ) == FAIL)
+ {
+--- 4416,4429 ----
+ * /etc/rc.d/init.d is linked to /etc/rc.d -> endless loop)
+ *
+ * This check is only needed for directories we work on for the
+! * first time (hence stackp->ff_filearray == NULL)
+ */
+! if (stackp->ffs_filearray == NULL
+! && ff_check_visited(&search_ctx->ffsc_dir_visited_list
+ ->ffvl_visited_list,
+! stackp->ffs_fix_path
+ #ifdef FEAT_PATH_EXTRA
+! , stackp->ffs_wc_path
+ #endif
+ ) == FAIL)
+ {
+***************
+*** 4430,4442 ****
+ {
+ verbose_enter_scroll();
+ smsg((char_u *)"Already Searched: %s (%s)",
+! ctx->ffs_fix_path, ctx->ffs_wc_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ verbose_leave_scroll();
+ }
+ #endif
+! ff_free_stack_element(ctx);
+ continue;
+ }
+ #ifdef FF_VERBOSE
+--- 4432,4444 ----
+ {
+ verbose_enter_scroll();
+ smsg((char_u *)"Already Searched: %s (%s)",
+! stackp->ffs_fix_path, stackp->ffs_wc_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ verbose_leave_scroll();
+ }
+ #endif
+! ff_free_stack_element(stackp);
+ continue;
+ }
+ #ifdef FF_VERBOSE
+***************
+*** 4444,4450 ****
+ {
+ verbose_enter_scroll();
+ smsg((char_u *)"Searching: %s (%s)",
+! ctx->ffs_fix_path, ctx->ffs_wc_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ verbose_leave_scroll();
+--- 4446,4452 ----
+ {
+ verbose_enter_scroll();
+ smsg((char_u *)"Searching: %s (%s)",
+! stackp->ffs_fix_path, stackp->ffs_wc_path);
+ /* don't overwrite this either */
+ msg_puts((char_u *)"\n");
+ verbose_leave_scroll();
+***************
+*** 4452,4460 ****
+ #endif
+
+ /* check depth */
+! if (ctx->ffs_level <= 0)
+ {
+! ff_free_stack_element(ctx);
+ continue;
+ }
+
+--- 4454,4462 ----
+ #endif
+
+ /* check depth */
+! if (stackp->ffs_level <= 0)
+ {
+! ff_free_stack_element(stackp);
+ continue;
+ }
+
+***************
+*** 4466,4472 ****
+ * and all possible expands are returned in one array. We use this
+ * to handle the expansion of '**' into an empty string.
+ */
+! if (ctx->ffs_filearray == NULL)
+ {
+ char_u *dirptrs[2];
+
+--- 4468,4474 ----
+ * and all possible expands are returned in one array. We use this
+ * to handle the expansion of '**' into an empty string.
+ */
+! if (stackp->ffs_filearray == NULL)
+ {
+ char_u *dirptrs[2];
+
+***************
+*** 4477,4495 ****
+ dirptrs[1] = NULL;
+
+ /* if we have a start dir copy it in */
+! if (!vim_isAbsName(ctx->ffs_fix_path)
+! && ff_search_ctx->ffsc_start_dir)
+ {
+! STRCPY(file_path, ff_search_ctx->ffsc_start_dir);
+ add_pathsep(file_path);
+ }
+
+ /* append the fix part of the search path */
+! STRCAT(file_path, ctx->ffs_fix_path);
+ add_pathsep(file_path);
+
+ #ifdef FEAT_PATH_EXTRA
+! rest_of_wildcards = ctx->ffs_wc_path;
+ if (*rest_of_wildcards != NUL)
+ {
+ len = (int)STRLEN(file_path);
+--- 4479,4497 ----
+ dirptrs[1] = NULL;
+
+ /* if we have a start dir copy it in */
+! if (!vim_isAbsName(stackp->ffs_fix_path)
+! && search_ctx->ffsc_start_dir)
+ {
+! STRCPY(file_path, search_ctx->ffsc_start_dir);
+ add_pathsep(file_path);
+ }
+
+ /* append the fix part of the search path */
+! STRCAT(file_path, stackp->ffs_fix_path);
+ add_pathsep(file_path);
+
+ #ifdef FEAT_PATH_EXTRA
+! rest_of_wildcards = stackp->ffs_wc_path;
+ if (*rest_of_wildcards != NUL)
+ {
+ len = (int)STRLEN(file_path);
+***************
+*** 4516,4526 ****
+ else
+ rest_of_wildcards += 3;
+
+! if (ctx->ffs_star_star_empty == 0)
+ {
+ /* if not done before, expand '**' to empty */
+! ctx->ffs_star_star_empty = 1;
+! dirptrs[1] = ctx->ffs_fix_path;
+ }
+ }
+
+--- 4518,4528 ----
+ else
+ rest_of_wildcards += 3;
+
+! if (stackp->ffs_star_star_empty == 0)
+ {
+ /* if not done before, expand '**' to empty */
+! stackp->ffs_star_star_empty = 1;
+! dirptrs[1] = stackp->ffs_fix_path;
+ }
+ }
+
+***************
+*** 4547,4576 ****
+ */
+ if (path_with_url(dirptrs[0]))
+ {
+! ctx->ffs_filearray = (char_u **)
+ alloc((unsigned)sizeof(char *));
+! if (ctx->ffs_filearray != NULL
+! && (ctx->ffs_filearray[0]
+ = vim_strsave(dirptrs[0])) != NULL)
+! ctx->ffs_filearray_size = 1;
+ else
+! ctx->ffs_filearray_size = 0;
+ }
+ else
+ expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
+! &ctx->ffs_filearray_size,
+! &ctx->ffs_filearray,
+ EW_DIR|EW_ADDSLASH|EW_SILENT);
+
+! ctx->ffs_filearray_cur = 0;
+! ctx->ffs_stage = 0;
+ }
+ #ifdef FEAT_PATH_EXTRA
+ else
+! rest_of_wildcards = &ctx->ffs_wc_path[STRLEN(ctx->ffs_wc_path)];
+ #endif
+
+! if (ctx->ffs_stage == 0)
+ {
+ /* this is the first time we work on this directory */
+ #ifdef FEAT_PATH_EXTRA
+--- 4549,4579 ----
+ */
+ if (path_with_url(dirptrs[0]))
+ {
+! stackp->ffs_filearray = (char_u **)
+ alloc((unsigned)sizeof(char *));
+! if (stackp->ffs_filearray != NULL
+! && (stackp->ffs_filearray[0]
+ = vim_strsave(dirptrs[0])) != NULL)
+! stackp->ffs_filearray_size = 1;
+ else
+! stackp->ffs_filearray_size = 0;
+ }
+ else
+ expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs,
+! &stackp->ffs_filearray_size,
+! &stackp->ffs_filearray,
+ EW_DIR|EW_ADDSLASH|EW_SILENT);
+
+! stackp->ffs_filearray_cur = 0;
+! stackp->ffs_stage = 0;
+ }
+ #ifdef FEAT_PATH_EXTRA
+ else
+! rest_of_wildcards = &stackp->ffs_wc_path[
+! STRLEN(stackp->ffs_wc_path)];
+ #endif
+
+! if (stackp->ffs_stage == 0)
+ {
+ /* this is the first time we work on this directory */
+ #ifdef FEAT_PATH_EXTRA
+***************
+*** 4581,4598 ****
+ * we don't have further wildcards to expand, so we have to
+ * check for the final file now
+ */
+! for (i = ctx->ffs_filearray_cur;
+! i < ctx->ffs_filearray_size; ++i)
+ {
+! if (!path_with_url(ctx->ffs_filearray[i])
+! && !mch_isdir(ctx->ffs_filearray[i]))
+ continue; /* not a directory */
+
+ /* prepare the filename to be checked for existance
+ * below */
+! STRCPY(file_path, ctx->ffs_filearray[i]);
+ add_pathsep(file_path);
+! STRCAT(file_path, ff_search_ctx->ffsc_file_to_search);
+
+ /*
+ * Try without extra suffix and then with suffixes
+--- 4584,4601 ----
+ * we don't have further wildcards to expand, so we have to
+ * check for the final file now
+ */
+! for (i = stackp->ffs_filearray_cur;
+! i < stackp->ffs_filearray_size; ++i)
+ {
+! if (!path_with_url(stackp->ffs_filearray[i])
+! && !mch_isdir(stackp->ffs_filearray[i]))
+ continue; /* not a directory */
+
+ /* prepare the filename to be checked for existance
+ * below */
+! STRCPY(file_path, stackp->ffs_filearray[i]);
+ add_pathsep(file_path);
+! STRCAT(file_path, search_ctx->ffsc_file_to_search);
+
+ /*
+ * Try without extra suffix and then with suffixes
+***************
+*** 4606,4617 ****
+ {
+ /* if file exists and we didn't already find it */
+ if ((path_with_url(file_path)
+! || (mch_getperm(file_path) >= 0
+! && (!ff_search_ctx->ffsc_need_dir
+! || mch_isdir(file_path))))
+ #ifndef FF_VERBOSE
+ && (ff_check_visited(
+! &ff_search_ctx->ffsc_visited_list->ffvl_visited_list,
+ file_path
+ #ifdef FEAT_PATH_EXTRA
+ , (char_u *)""
+--- 4609,4623 ----
+ {
+ /* if file exists and we didn't already find it */
+ if ((path_with_url(file_path)
+! || (mch_getperm(file_path) >= 0
+! && (search_ctx->ffsc_find_what
+! == FINDFILE_BOTH
+! || ((search_ctx->ffsc_find_what
+! == FINDFILE_DIR)
+! == mch_isdir(file_path)))))
+ #ifndef FF_VERBOSE
+ && (ff_check_visited(
+! &search_ctx->ffsc_visited_list->ffvl_visited_list,
+ file_path
+ #ifdef FEAT_PATH_EXTRA
+ , (char_u *)""
+***************
+*** 4622,4628 ****
+ {
+ #ifdef FF_VERBOSE
+ if (ff_check_visited(
+! &ff_search_ctx->ffsc_visited_list->ffvl_visited_list,
+ file_path
+ #ifdef FEAT_PATH_EXTRA
+ , (char_u *)""
+--- 4628,4634 ----
+ {
+ #ifdef FF_VERBOSE
+ if (ff_check_visited(
+! &search_ctx->ffsc_visited_list->ffvl_visited_list,
+ file_path
+ #ifdef FEAT_PATH_EXTRA
+ , (char_u *)""
+***************
+*** 4643,4650 ****
+ #endif
+
+ /* push dir to examine rest of subdirs later */
+! ctx->ffs_filearray_cur = i + 1;
+! ff_push(ctx);
+
+ simplify_filename(file_path);
+ if (mch_dirname(ff_expand_buffer, MAXPATHL)
+--- 4649,4656 ----
+ #endif
+
+ /* push dir to examine rest of subdirs later */
+! stackp->ffs_filearray_cur = i + 1;
+! ff_push(search_ctx, stackp);
+
+ simplify_filename(file_path);
+ if (mch_dirname(ff_expand_buffer, MAXPATHL)
+***************
+*** 4686,4704 ****
+ * still wildcards left, push the directories for further
+ * search
+ */
+! for (i = ctx->ffs_filearray_cur;
+! i < ctx->ffs_filearray_size; ++i)
+ {
+! if (!mch_isdir(ctx->ffs_filearray[i]))
+ continue; /* not a directory */
+
+! ff_push(ff_create_stack_element(ctx->ffs_filearray[i],
+! rest_of_wildcards, ctx->ffs_level - 1, 0));
+ }
+ }
+ #endif
+! ctx->ffs_filearray_cur = 0;
+! ctx->ffs_stage = 1;
+ }
+
+ #ifdef FEAT_PATH_EXTRA
+--- 4692,4713 ----
+ * still wildcards left, push the directories for further
+ * search
+ */
+! for (i = stackp->ffs_filearray_cur;
+! i < stackp->ffs_filearray_size; ++i)
+ {
+! if (!mch_isdir(stackp->ffs_filearray[i]))
+ continue; /* not a directory */
+
+! ff_push(search_ctx,
+! ff_create_stack_element(
+! stackp->ffs_filearray[i],
+! rest_of_wildcards,
+! stackp->ffs_level - 1, 0));
+ }
+ }
+ #endif
+! stackp->ffs_filearray_cur = 0;
+! stackp->ffs_stage = 1;
+ }
+
+ #ifdef FEAT_PATH_EXTRA
+***************
+*** 4706,4728 ****
+ * if wildcards contains '**' we have to descent till we reach the
+ * leaves of the directory tree.
+ */
+! if (STRNCMP(ctx->ffs_wc_path, "**", 2) == 0)
+ {
+! for (i = ctx->ffs_filearray_cur;
+! i < ctx->ffs_filearray_size; ++i)
+ {
+! if (fnamecmp(ctx->ffs_filearray[i], ctx->ffs_fix_path) == 0)
+ continue; /* don't repush same directory */
+! if (!mch_isdir(ctx->ffs_filearray[i]))
+ continue; /* not a directory */
+! ff_push(ff_create_stack_element(ctx->ffs_filearray[i],
+! ctx->ffs_wc_path, ctx->ffs_level - 1, 1));
+ }
+ }
+ #endif
+
+ /* we are done with the current directory */
+! ff_free_stack_element(ctx);
+
+ }
+
+--- 4715,4739 ----
+ * if wildcards contains '**' we have to descent till we reach the
+ * leaves of the directory tree.
+ */
+! if (STRNCMP(stackp->ffs_wc_path, "**", 2) == 0)
+ {
+! for (i = stackp->ffs_filearray_cur;
+! i < stackp->ffs_filearray_size; ++i)
+ {
+! if (fnamecmp(stackp->ffs_filearray[i],
+! stackp->ffs_fix_path) == 0)
+ continue; /* don't repush same directory */
+! if (!mch_isdir(stackp->ffs_filearray[i]))
+ continue; /* not a directory */
+! ff_push(search_ctx,
+! ff_create_stack_element(stackp->ffs_filearray[i],
+! stackp->ffs_wc_path, stackp->ffs_level - 1, 1));
+ }
+ }
+ #endif
+
+ /* we are done with the current directory */
+! ff_free_stack_element(stackp);
+
+ }
+
+***************
+*** 4730,4769 ****
+ /* If we reached this, we didn't find anything downwards.
+ * Let's check if we should do an upward search.
+ */
+! if (ff_search_ctx->ffsc_start_dir
+! && ff_search_ctx->ffsc_stopdirs_v != NULL && !got_int)
+ {
+ ff_stack_T *sptr;
+
+ /* is the last starting directory in the stop list? */
+! if (ff_path_in_stoplist(ff_search_ctx->ffsc_start_dir,
+! (int)(path_end - ff_search_ctx->ffsc_start_dir),
+! ff_search_ctx->ffsc_stopdirs_v) == TRUE)
+ break;
+
+ /* cut of last dir */
+! while (path_end > ff_search_ctx->ffsc_start_dir
+! && vim_ispathsep(*path_end))
+ path_end--;
+! while (path_end > ff_search_ctx->ffsc_start_dir
+! && !vim_ispathsep(path_end[-1]))
+ path_end--;
+ *path_end = 0;
+ path_end--;
+
+! if (*ff_search_ctx->ffsc_start_dir == 0)
+ break;
+
+! STRCPY(file_path, ff_search_ctx->ffsc_start_dir);
+ add_pathsep(file_path);
+! STRCAT(file_path, ff_search_ctx->ffsc_fix_path);
+
+ /* create a new stack entry */
+ sptr = ff_create_stack_element(file_path,
+! ff_search_ctx->ffsc_wc_path, ff_search_ctx->ffsc_level, 0);
+ if (sptr == NULL)
+ break;
+! ff_push(sptr);
+ }
+ else
+ break;
+--- 4741,4780 ----
+ /* If we reached this, we didn't find anything downwards.
+ * Let's check if we should do an upward search.
+ */
+! if (search_ctx->ffsc_start_dir
+! && search_ctx->ffsc_stopdirs_v != NULL && !got_int)
+ {
+ ff_stack_T *sptr;
+
+ /* is the last starting directory in the stop list? */
+! if (ff_path_in_stoplist(search_ctx->ffsc_start_dir,
+! (int)(path_end - search_ctx->ffsc_start_dir),
+! search_ctx->ffsc_stopdirs_v) == TRUE)
+ break;
+
+ /* cut of last dir */
+! while (path_end > search_ctx->ffsc_start_dir
+! && vim_ispathsep(*path_end))
+ path_end--;
+! while (path_end > search_ctx->ffsc_start_dir
+! && !vim_ispathsep(path_end[-1]))
+ path_end--;
+ *path_end = 0;
+ path_end--;
+
+! if (*search_ctx->ffsc_start_dir == 0)
+ break;
+
+! STRCPY(file_path, search_ctx->ffsc_start_dir);
+ add_pathsep(file_path);
+! STRCAT(file_path, search_ctx->ffsc_fix_path);
+
+ /* create a new stack entry */
+ sptr = ff_create_stack_element(file_path,
+! search_ctx->ffsc_wc_path, search_ctx->ffsc_level, 0);
+ if (sptr == NULL)
+ break;
+! ff_push(search_ctx, sptr);
+ }
+ else
+ break;
+***************
+*** 4779,4794 ****
+ * Can handle it if the passed search_context is NULL;
+ */
+ void
+! vim_findfile_free_visited(search_ctx)
+! void *search_ctx;
+ {
+! if (search_ctx == NULL)
+! return;
+
+! ff_search_ctx = (ff_search_ctx_T *)search_ctx;
+
+! vim_findfile_free_visited_list(&ff_search_ctx->ffsc_visited_lists_list);
+! vim_findfile_free_visited_list(&ff_search_ctx->ffsc_dir_visited_lists_list);
+ }
+
+ static void
+--- 4790,4806 ----
+ * Can handle it if the passed search_context is NULL;
+ */
+ void
+! vim_findfile_free_visited(search_ctx_arg)
+! void *search_ctx_arg;
+ {
+! ff_search_ctx_T *search_ctx;
+
+! if (search_ctx_arg == NULL)
+! return;
+
+! search_ctx = (ff_search_ctx_T *)search_ctx_arg;
+! vim_findfile_free_visited_list(&search_ctx->ffsc_visited_lists_list);
+! vim_findfile_free_visited_list(&search_ctx->ffsc_dir_visited_lists_list);
+ }
+
+ static void
+***************
+*** 5103,5135 ****
+ }
+
+ /*
+! * push a dir on the directory stack
+ */
+ static void
+! ff_push(ctx)
+! ff_stack_T *ctx;
+ {
+ /* check for NULL pointer, not to return an error to the user, but
+ * to prevent a crash */
+! if (ctx != NULL)
+ {
+! ctx->ffs_prev = ff_search_ctx->ffsc_stack_ptr;
+! ff_search_ctx->ffsc_stack_ptr = ctx;
+ }
+ }
+
+ /*
+! * pop a dir from the directory stack
+! * returns NULL if stack is empty
+ */
+ static ff_stack_T *
+! ff_pop()
+ {
+ ff_stack_T *sptr;
+
+! sptr = ff_search_ctx->ffsc_stack_ptr;
+! if (ff_search_ctx->ffsc_stack_ptr != NULL)
+! ff_search_ctx->ffsc_stack_ptr = ff_search_ctx->ffsc_stack_ptr->ffs_prev;
+
+ return sptr;
+ }
+--- 5115,5149 ----
+ }
+
+ /*
+! * Push a dir on the directory stack.
+ */
+ static void
+! ff_push(search_ctx, stack_ptr)
+! ff_search_ctx_T *search_ctx;
+! ff_stack_T *stack_ptr;
+ {
+ /* check for NULL pointer, not to return an error to the user, but
+ * to prevent a crash */
+! if (stack_ptr != NULL)
+ {
+! stack_ptr->ffs_prev = search_ctx->ffsc_stack_ptr;
+! search_ctx->ffsc_stack_ptr = stack_ptr;
+ }
+ }
+
+ /*
+! * Pop a dir from the directory stack.
+! * Returns NULL if stack is empty.
+ */
+ static ff_stack_T *
+! ff_pop(search_ctx)
+! ff_search_ctx_T *search_ctx;
+ {
+ ff_stack_T *sptr;
+
+! sptr = search_ctx->ffsc_stack_ptr;
+! if (search_ctx->ffsc_stack_ptr != NULL)
+! search_ctx->ffsc_stack_ptr = search_ctx->ffsc_stack_ptr->ffs_prev;
+
+ return sptr;
+ }
+***************
+*** 5138,5199 ****
+ * free the given stack element
+ */
+ static void
+! ff_free_stack_element(ctx)
+! ff_stack_T *ctx;
+ {
+ /* vim_free handles possible NULL pointers */
+! vim_free(ctx->ffs_fix_path);
+ #ifdef FEAT_PATH_EXTRA
+! vim_free(ctx->ffs_wc_path);
+ #endif
+
+! if (ctx->ffs_filearray != NULL)
+! FreeWild(ctx->ffs_filearray_size, ctx->ffs_filearray);
+
+! vim_free(ctx);
+ }
+
+ /*
+! * clear the search context
+ */
+ static void
+! ff_clear()
+ {
+ ff_stack_T *sptr;
+
+ /* clear up stack */
+! while ((sptr = ff_pop()) != NULL)
+ ff_free_stack_element(sptr);
+
+! vim_free(ff_search_ctx->ffsc_file_to_search);
+! vim_free(ff_search_ctx->ffsc_start_dir);
+! vim_free(ff_search_ctx->ffsc_fix_path);
+ #ifdef FEAT_PATH_EXTRA
+! vim_free(ff_search_ctx->ffsc_wc_path);
+ #endif
+
+ #ifdef FEAT_PATH_EXTRA
+! if (ff_search_ctx->ffsc_stopdirs_v != NULL)
+ {
+ int i = 0;
+
+! while (ff_search_ctx->ffsc_stopdirs_v[i] != NULL)
+ {
+! vim_free(ff_search_ctx->ffsc_stopdirs_v[i]);
+ i++;
+ }
+! vim_free(ff_search_ctx->ffsc_stopdirs_v);
+ }
+! ff_search_ctx->ffsc_stopdirs_v = NULL;
+ #endif
+
+ /* reset everything */
+! ff_search_ctx->ffsc_file_to_search = NULL;
+! ff_search_ctx->ffsc_start_dir = NULL;
+! ff_search_ctx->ffsc_fix_path = NULL;
+ #ifdef FEAT_PATH_EXTRA
+! ff_search_ctx->ffsc_wc_path = NULL;
+! ff_search_ctx->ffsc_level = 0;
+ #endif
+ }
+
+--- 5152,5214 ----
+ * free the given stack element
+ */
+ static void
+! ff_free_stack_element(stack_ptr)
+! ff_stack_T *stack_ptr;
+ {
+ /* vim_free handles possible NULL pointers */
+! vim_free(stack_ptr->ffs_fix_path);
+ #ifdef FEAT_PATH_EXTRA
+! vim_free(stack_ptr->ffs_wc_path);
+ #endif
+
+! if (stack_ptr->ffs_filearray != NULL)
+! FreeWild(stack_ptr->ffs_filearray_size, stack_ptr->ffs_filearray);
+
+! vim_free(stack_ptr);
+ }
+
+ /*
+! * Clear the search context, but NOT the visited list.
+ */
+ static void
+! ff_clear(search_ctx)
+! ff_search_ctx_T *search_ctx;
+ {
+ ff_stack_T *sptr;
+
+ /* clear up stack */
+! while ((sptr = ff_pop(search_ctx)) != NULL)
+ ff_free_stack_element(sptr);
+
+! vim_free(search_ctx->ffsc_file_to_search);
+! vim_free(search_ctx->ffsc_start_dir);
+! vim_free(search_ctx->ffsc_fix_path);
+ #ifdef FEAT_PATH_EXTRA
+! vim_free(search_ctx->ffsc_wc_path);
+ #endif
+
+ #ifdef FEAT_PATH_EXTRA
+! if (search_ctx->ffsc_stopdirs_v != NULL)
+ {
+ int i = 0;
+
+! while (search_ctx->ffsc_stopdirs_v[i] != NULL)
+ {
+! vim_free(search_ctx->ffsc_stopdirs_v[i]);
+ i++;
+ }
+! vim_free(search_ctx->ffsc_stopdirs_v);
+ }
+! search_ctx->ffsc_stopdirs_v = NULL;
+ #endif
+
+ /* reset everything */
+! search_ctx->ffsc_file_to_search = NULL;
+! search_ctx->ffsc_start_dir = NULL;
+! search_ctx->ffsc_fix_path = NULL;
+ #ifdef FEAT_PATH_EXTRA
+! search_ctx->ffsc_wc_path = NULL;
+! search_ctx->ffsc_level = 0;
+ #endif
+ }
+
+***************
+*** 5242,5248 ****
+
+ #if defined(FEAT_SEARCHPATH) || defined(PROTO)
+ /*
+! * Find the file name "ptr[len]" in the path.
+ *
+ * On the first call set the parameter 'first' to TRUE to initialize
+ * the search. For repeating calls to FALSE.
+--- 5257,5263 ----
+
+ #if defined(FEAT_SEARCHPATH) || defined(PROTO)
+ /*
+! * Find the file name "ptr[len]" in the path. Also finds directory names.
+ *
+ * On the first call set the parameter 'first' to TRUE to initialize
+ * the search. For repeating calls to FALSE.
+***************
+*** 5276,5282 ****
+ {
+ return find_file_in_path_option(ptr, len, options, first,
+ *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path,
+! FALSE, rel_fname, curbuf->b_p_sua);
+ }
+
+ static char_u *ff_file_to_find = NULL;
+--- 5291,5297 ----
+ {
+ return find_file_in_path_option(ptr, len, options, first,
+ *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path,
+! FINDFILE_BOTH, rel_fname, curbuf->b_p_sua);
+ }
+
+ static char_u *ff_file_to_find = NULL;
+***************
+*** 5309,5325 ****
+ char_u *rel_fname; /* file name searching relative to */
+ {
+ return find_file_in_path_option(ptr, len, options, TRUE, p_cdpath,
+! TRUE, rel_fname, (char_u *)"");
+ }
+
+ char_u *
+! find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fname, suffixes)
+ char_u *ptr; /* file name */
+ int len; /* length of file name */
+ int options;
+ int first; /* use count'th matching file name */
+ char_u *path_option; /* p_path or p_cdpath */
+! int need_dir; /* looking for directory name */
+ char_u *rel_fname; /* file name we are looking relative to. */
+ char_u *suffixes; /* list of suffixes, 'suffixesadd' option */
+ {
+--- 5324,5340 ----
+ char_u *rel_fname; /* file name searching relative to */
+ {
+ return find_file_in_path_option(ptr, len, options, TRUE, p_cdpath,
+! FINDFILE_DIR, rel_fname, (char_u *)"");
+ }
+
+ char_u *
+! find_file_in_path_option(ptr, len, options, first, path_option, find_what, rel_fname, suffixes)
+ char_u *ptr; /* file name */
+ int len; /* length of file name */
+ int options;
+ int first; /* use count'th matching file name */
+ char_u *path_option; /* p_path or p_cdpath */
+! int find_what; /* FINDFILE_FILE, _DIR or _BOTH */
+ char_u *rel_fname; /* file name we are looking relative to. */
+ char_u *suffixes; /* list of suffixes, 'suffixesadd' option */
+ {
+***************
+*** 5421,5432 ****
+ #ifdef DJGPP
+ /* "C:" by itself will fail for mch_getperm(),
+ * assume it's always valid. */
+! (need_dir && NameBuff[0] != NUL
+ && NameBuff[1] == ':'
+ && NameBuff[2] == NUL) ||
+ #endif
+ (mch_getperm(NameBuff) >= 0
+! && (!need_dir || mch_isdir(NameBuff))))
+ {
+ file_name = vim_strsave(NameBuff);
+ goto theend;
+--- 5436,5449 ----
+ #ifdef DJGPP
+ /* "C:" by itself will fail for mch_getperm(),
+ * assume it's always valid. */
+! (find_what != FINDFILE_FILE && NameBuff[0] != NUL
+ && NameBuff[1] == ':'
+ && NameBuff[2] == NUL) ||
+ #endif
+ (mch_getperm(NameBuff) >= 0
+! && (find_what == FINDFILE_BOTH
+! || ((find_what == FINDFILE_DIR)
+! == mch_isdir(NameBuff)))))
+ {
+ file_name = vim_strsave(NameBuff);
+ goto theend;
+***************
+*** 5457,5465 ****
+ {
+ if (did_findfile_init)
+ {
+- ff_search_ctx->ffsc_need_dir = need_dir;
+ file_name = vim_findfile(fdip_search_ctx);
+- ff_search_ctx->ffsc_need_dir = FALSE;
+ if (file_name != NULL)
+ break;
+
+--- 5474,5480 ----
+***************
+*** 5492,5498 ****
+ r_ptr = NULL;
+ #endif
+ fdip_search_ctx = vim_findfile_init(buf, ff_file_to_find,
+! r_ptr, 100, FALSE, TRUE,
+ fdip_search_ctx, FALSE, rel_fname);
+ if (fdip_search_ctx != NULL)
+ did_findfile_init = TRUE;
+--- 5507,5513 ----
+ r_ptr = NULL;
+ #endif
+ fdip_search_ctx = vim_findfile_init(buf, ff_file_to_find,
+! r_ptr, 100, FALSE, find_what,
+ fdip_search_ctx, FALSE, rel_fname);
+ if (fdip_search_ctx != NULL)
+ did_findfile_init = TRUE;
+***************
+*** 5504,5510 ****
+ {
+ if (first == TRUE)
+ {
+! if (need_dir)
+ EMSG2(_("E344: Can't find directory \"%s\" in cdpath"),
+ ff_file_to_find);
+ else
+--- 5519,5525 ----
+ {
+ if (first == TRUE)
+ {
+! if (find_what == FINDFILE_DIR)
+ EMSG2(_("E344: Can't find directory \"%s\" in cdpath"),
+ ff_file_to_find);
+ else
+***************
+*** 5513,5519 ****
+ }
+ else
+ {
+! if (need_dir)
+ EMSG2(_("E346: No more directory \"%s\" found in cdpath"),
+ ff_file_to_find);
+ else
+--- 5528,5534 ----
+ }
+ else
+ {
+! if (find_what == FINDFILE_DIR)
+ EMSG2(_("E346: No more directory \"%s\" found in cdpath"),
+ ff_file_to_find);
+ else
+*** ../vim-7.1.255/src/vim.h Sat Jan 19 15:55:51 2008
+--- src/vim.h Tue Jan 22 22:35:16 2008
+***************
+*** 721,726 ****
+--- 721,731 ----
+ /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
+ * is used when executing commands and EW_SILENT for interactive expanding. */
+
++ /* Flags for find_file_*() functions. */
++ #define FINDFILE_FILE 0 /* only files */
++ #define FINDFILE_DIR 1 /* only directories */
++ #define FINDFILE_BOTH 2 /* files and directories */
++
+ #ifdef FEAT_VERTSPLIT
+ # define W_WINCOL(wp) (wp->w_wincol)
+ # define W_WIDTH(wp) (wp->w_width)
+*** ../vim-7.1.255/src/tag.c Sat Jan 19 15:55:51 2008
+--- src/tag.c Wed Feb 13 18:02:32 2008
+***************
+*** 2669,2676 ****
+
+ tnp->tn_search_ctx = vim_findfile_init(buf, filename,
+ r_ptr, 100,
+! FALSE, /* don't free visited list */
+! FALSE, /* we search for a file */
+ tnp->tn_search_ctx, TRUE, curbuf->b_ffname);
+ if (tnp->tn_search_ctx != NULL)
+ tnp->tn_did_filefind_init = TRUE;
+--- 2669,2676 ----
+
+ tnp->tn_search_ctx = vim_findfile_init(buf, filename,
+ r_ptr, 100,
+! FALSE, /* don't free visited list */
+! FINDFILE_FILE, /* we search for a file */
+ tnp->tn_search_ctx, TRUE, curbuf->b_ffname);
+ if (tnp->tn_search_ctx != NULL)
+ tnp->tn_did_filefind_init = TRUE;
+***************
+*** 2691,2696 ****
+--- 2691,2697 ----
+ {
+ vim_free(tnp->tn_tags);
+ vim_findfile_cleanup(tnp->tn_search_ctx);
++ tnp->tn_search_ctx = NULL;
+ ga_clear_strings(&tag_fnames);
+ }
+
+*** ../vim-7.1.255/src/version.c Wed Feb 20 11:27:59 2008
+--- src/version.c Wed Feb 20 12:09:54 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 256,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+38. You wake up at 3 a.m. to go to the bathroom and stop and check your e-mail
+ on the way back to bed.
+
+ /// 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.257
+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.257
+Problem: Configure can't always find the Tcl header files.
+Solution: Also look in /usr/local/include/tcl$tclver and
+ /usr/include/tcl$tclver (James Vega)
+Files: src/auto/configure, src/configure.in
+
+
+*** ../vim-7.1.256/src/auto/configure Wed Feb 13 10:27:28 2008
+--- src/auto/configure Wed Feb 13 11:20:00 2008
+***************
+*** 4669,4678 ****
+ echo "$as_me:$LINENO: checking for location of Tcl include" >&5
+ echo $ECHO_N "checking for location of Tcl include... $ECHO_C" >&6
+ if test "x$MACOSX" != "xyes"; then
+! tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/include"
+ else
+ tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+ fi
+ for try in $tclinc; do
+ if test -f "$try/tcl.h"; then
+ echo "$as_me:$LINENO: result: $try/tcl.h" >&5
+--- 4669,4679 ----
+ echo "$as_me:$LINENO: checking for location of Tcl include" >&5
+ echo $ECHO_N "checking for location of Tcl include... $ECHO_C" >&6
+ if test "x$MACOSX" != "xyes"; then
+! tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/include /usr/include/tcl$tclver"
+ else
+ tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+ fi
++ TCL_INC=
+ for try in $tclinc; do
+ if test -f "$try/tcl.h"; then
+ echo "$as_me:$LINENO: result: $try/tcl.h" >&5
+*** ../vim-7.1.256/src/configure.in Wed Feb 13 10:27:28 2008
+--- src/configure.in Wed Feb 13 11:23:55 2008
+***************
+*** 794,804 ****
+
+ AC_MSG_CHECKING(for location of Tcl include)
+ if test "x$MACOSX" != "xyes"; then
+! tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/include"
+ else
+ dnl For Mac OS X 10.3, use the OS-provided framework location
+ tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+ fi
+ for try in $tclinc; do
+ if test -f "$try/tcl.h"; then
+ AC_MSG_RESULT($try/tcl.h)
+--- 794,805 ----
+
+ AC_MSG_CHECKING(for location of Tcl include)
+ if test "x$MACOSX" != "xyes"; then
+! tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
+ else
+ dnl For Mac OS X 10.3, use the OS-provided framework location
+ tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
+ fi
++ TCL_INC=
+ for try in $tclinc; do
+ if test -f "$try/tcl.h"; then
+ AC_MSG_RESULT($try/tcl.h)
+*** ../vim-7.1.256/src/version.c Wed Feb 20 12:22:59 2008
+--- src/version.c Wed Feb 20 12:42:17 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 257,
+ /**/
+
+--
+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.258
+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.258
+Problem: Crash when doing "d/\n/e" and 'virtualedit' is "all". (Andy Wokula)
+Solution: Avoid that the column becomes negative. Also fixes other problems
+ with the end of a pattern match is in column zero. (A.Politz)
+Files: src/search.c
+
+
+*** ../vim-7.1.257/src/search.c Sat Jan 26 21:15:00 2008
+--- src/search.c Wed Feb 20 13:22:23 2008
+***************
+*** 624,630 ****
+ #ifdef FEAT_EVAL
+ submatch = first_submatch(®match);
+ #endif
+! /* Line me be past end of buffer for "\n\zs". */
+ if (lnum + matchpos.lnum > buf->b_ml.ml_line_count)
+ ptr = (char_u *)"";
+ else
+--- 624,630 ----
+ #ifdef FEAT_EVAL
+ submatch = first_submatch(®match);
+ #endif
+! /* "lnum" may be past end of buffer for "\n\zs". */
+ if (lnum + matchpos.lnum > buf->b_ml.ml_line_count)
+ ptr = (char_u *)"";
+ else
+***************
+*** 833,853 ****
+ continue;
+ }
+
+! if (options & SEARCH_END && !(options & SEARCH_NOOF))
+ {
+ pos->lnum = lnum + endpos.lnum;
+! pos->col = endpos.col - 1;
+! #ifdef FEAT_MBYTE
+! if (has_mbyte)
+ {
+! /* 'e' offset may put us just below the last line */
+! if (pos->lnum > buf->b_ml.ml_line_count)
+! ptr = (char_u *)"";
+! else
+! ptr = ml_get_buf(buf, pos->lnum, FALSE);
+! pos->col -= (*mb_head_off)(ptr, ptr + pos->col);
+ }
+ #endif
+ }
+ else
+ {
+--- 833,870 ----
+ continue;
+ }
+
+! /* With the SEARCH_END option move to the last character
+! * of the match. Don't do it for an empty match, end
+! * should be same as start then. */
+! if (options & SEARCH_END && !(options & SEARCH_NOOF)
+! && !(matchpos.lnum == endpos.lnum
+! && matchpos.col == endpos.col))
+ {
++ /* For a match in the first column, set the position
++ * on the NUL in the previous line. */
+ pos->lnum = lnum + endpos.lnum;
+! pos->col = endpos.col;
+! if (endpos.col == 0)
+ {
+! if (pos->lnum > 1) /* just in case */
+! {
+! --pos->lnum;
+! pos->col = (colnr_T)STRLEN(ml_get_buf(buf,
+! pos->lnum, FALSE));
+! }
+ }
++ else
++ {
++ --pos->col;
++ #ifdef FEAT_MBYTE
++ if (has_mbyte
++ && pos->lnum <= buf->b_ml.ml_line_count)
++ {
++ ptr = ml_get_buf(buf, pos->lnum, FALSE);
++ pos->col -= (*mb_head_off)(ptr, ptr + pos->col);
++ }
+ #endif
++ }
+ }
+ else
+ {
+*** ../vim-7.1.257/src/version.c Wed Feb 20 12:43:05 2008
+--- src/version.c Wed Feb 20 13:37:32 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 258,
+ /**/
+
+--
+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 ///
--- /dev/null
+To: vim-dev@vim.org
+Subject: Patch 7.1.259
+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.259
+Problem: Cursor is in the wrong position when 'rightleft' is set,
+ 'encoding' is "utf-8" and on an illegal byte. (Dominique Pelle)
+Solution: Only put the cursor in the first column when actually on a
+ double-wide character. (Yukihiro Nakadaira)
+Files: src/screen.c
+
+
+*** ../vim-7.1.258/src/screen.c Wed Feb 13 21:48:24 2008
+--- src/screen.c Wed Feb 20 14:06:26 2008
+***************
+*** 8045,8053 ****
+ windgoto(W_WINROW(curwin) + curwin->w_wrow,
+ W_WINCOL(curwin) + (
+ #ifdef FEAT_RIGHTLEFT
+ curwin->w_p_rl ? ((int)W_WIDTH(curwin) - curwin->w_wcol - (
+ # ifdef FEAT_MBYTE
+! has_mbyte ? (*mb_ptr2cells)(ml_get_cursor()) :
+ # endif
+ 1)) :
+ #endif
+--- 8045,8057 ----
+ windgoto(W_WINROW(curwin) + curwin->w_wrow,
+ W_WINCOL(curwin) + (
+ #ifdef FEAT_RIGHTLEFT
++ /* With 'rightleft' set and the cursor on a double-wide
++ * character, position it on the leftmost column. */
+ curwin->w_p_rl ? ((int)W_WIDTH(curwin) - curwin->w_wcol - (
+ # ifdef FEAT_MBYTE
+! (has_mbyte
+! && (*mb_ptr2cells)(ml_get_cursor()) == 2
+! && vim_isprintc(gchar_cursor())) ? 2 :
+ # endif
+ 1)) :
+ #endif
+*** ../vim-7.1.258/src/version.c Wed Feb 20 13:41:14 2008
+--- src/version.c Wed Feb 20 14:10:23 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 259,
+ /**/
+
+--
+A day without sunshine is like, well, night.
+
+ /// 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.260
+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.260
+Problem: Cursor positioning problem after ^@ wrapping halfway when
+ 'encoding' is utf-8.
+Solution: Only count a position for printable characters. (partly by
+ Yukihiro Nakadaira)
+Files: src/charset.c
+
+
+*** ../vim-7.1.259/src/charset.c Sun Aug 19 22:42:27 2007
+--- src/charset.c Wed Feb 20 14:39:04 2008
+***************
+*** 1290,1296 ****
+ /* If a double-cell char doesn't fit at the end of a line
+ * it wraps to the next line, it's like this char is three
+ * cells wide. */
+! if (incr == 2 && wp->w_p_wrap && in_win_border(wp, vcol))
+ {
+ ++incr;
+ head = 1;
+--- 1290,1297 ----
+ /* If a double-cell char doesn't fit at the end of a line
+ * it wraps to the next line, it's like this char is three
+ * cells wide. */
+! if (incr == 2 && wp->w_p_wrap && MB_BYTE2LEN(*ptr) > 1
+! && in_win_border(wp, vcol))
+ {
+ ++incr;
+ head = 1;
+*** ../vim-7.1.259/src/version.c Wed Feb 20 14:15:45 2008
+--- src/version.c Wed Feb 20 14:57:45 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 260,
+ /**/
+
+--
+The users that I support would double-click on a landmine to find out
+what happens. -- A system administrator
+
+ /// 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.261
+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.261
+Problem: When a 2 byte BOM is detected Vim uses UCS-2, which doesn't work
+ for UTF-16 text. (Tony Mechelynck)
+Solution: Default to UTF-16.
+Files: src/fileio.c, src/testdir/test42.ok
+
+
+*** ../vim-7.1.260/src/fileio.c Fri Jan 4 16:30:40 2008
+--- src/fileio.c Wed Feb 20 11:22:10 2008
+***************
+*** 5514,5523 ****
+ else if (p[0] == 0xfe && p[1] == 0xff
+ && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16))
+ {
+! if (flags == FIO_UTF16)
+! name = "utf-16"; /* FE FF */
+! else
+ name = "ucs-2"; /* FE FF */
+ }
+ else if (size >= 4 && p[0] == 0 && p[1] == 0 && p[2] == 0xfe
+ && p[3] == 0xff && (flags == FIO_ALL || flags == FIO_UCS4))
+--- 5523,5533 ----
+ else if (p[0] == 0xfe && p[1] == 0xff
+ && (flags == FIO_ALL || flags == FIO_UCS2 || flags == FIO_UTF16))
+ {
+! /* Default to utf-16, it works also for ucs-2 text. */
+! if (flags == FIO_UCS2)
+ name = "ucs-2"; /* FE FF */
++ else
++ name = "utf-16"; /* FE FF */
+ }
+ else if (size >= 4 && p[0] == 0 && p[1] == 0 && p[2] == 0xfe
+ && p[3] == 0xff && (flags == FIO_ALL || flags == FIO_UCS4))
+*** ../vim-7.1.260/src/testdir/test42.ok Sun Jun 13 21:02:32 2004
+--- src/testdir/test42.ok Wed Feb 20 13:27:37 2008
+***************
+*** 15,21 ****
+ utf-8\80err
+
+
+! fileencoding=ucs-2
+ bomb
+ ucs-2
+
+--- 15,21 ----
+ utf-8\80err
+
+
+! fileencoding=utf-16
+ bomb
+ ucs-2
+
+*** ../vim-7.1.260/src/version.c Wed Feb 20 14:58:46 2008
+--- src/version.c Wed Feb 20 18:13:00 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 261,
+ /**/
+
+--
+Seen it all, done it all, can't remember most of it.
+
+ /// 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.262
+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.262
+Problem: Can't get the process ID of Vim.
+Solution: Implement getpid().
+Files: src/eval.c, runtime/doc/eval.txt
+
+
+*** ../vim-7.1.261/src/eval.c Wed Feb 20 12:22:59 2008
+--- src/eval.c Wed Feb 20 11:08:21 2008
+***************
+*** 532,537 ****
+--- 532,538 ----
+ static void f_getftype __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_getline __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_getmatches __ARGS((typval_T *argvars, typval_T *rettv));
++ static void f_getpid __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_getpos __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_getqflist __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_getreg __ARGS((typval_T *argvars, typval_T *rettv));
+***************
+*** 7132,7137 ****
+--- 7133,7139 ----
+ {"getline", 1, 2, f_getline},
+ {"getloclist", 1, 1, f_getqflist},
+ {"getmatches", 0, 0, f_getmatches},
++ {"getpid", 0, 0, f_getpid},
+ {"getpos", 1, 1, f_getpos},
+ {"getqflist", 0, 0, f_getqflist},
+ {"getreg", 0, 2, f_getreg},
+***************
+*** 10371,10376 ****
+--- 10373,10390 ----
+ }
+ }
+ #endif
++ }
++
++ /*
++ * "getpid()" function
++ */
++ /*ARGSUSED*/
++ static void
++ f_getpid(argvars, rettv)
++ typval_T *argvars;
++ typval_T *rettv;
++ {
++ rettv->vval.v_number = mch_get_pid();
+ }
+
+ /*
+*** ../vim-7.1.261/runtime/doc/eval.txt Wed Feb 13 12:41:30 2008
+--- runtime/doc/eval.txt Wed Feb 20 11:10:17 2008
+***************
+*** 1,4 ****
+! *eval.txt* For Vim version 7.1. Last change: 2008 Feb 13
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+--- 1,4 ----
+! *eval.txt* For Vim version 7.1. Last change: 2008 Feb 20
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+***************
+*** 1638,1643 ****
+--- 1638,1644 ----
+ getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer
+ getloclist({nr}) List list of location list items
+ getmatches() List list of current matches
++ getpid() Number process ID of Vim
+ getpos( {expr}) List position of cursor, mark, etc.
+ getqflist() List list of quickfix items
+ getreg( [{regname} [, 1]]) String contents of register
+***************
+*** 3833,3838 ****
+--- 3837,3846 ----
+ characters. nr2char(0) is a real NUL and terminates the
+ string, thus results in an empty string.
+
++ *getpid()*
++ getpid() Return a Number which is the process ID of the Vim process.
++ On Unix this is a unique number. On MS-DOS it's always zero.
++
+ *getpos()*
+ getpos({expr}) Get the position for {expr}. For possible values of {expr}
+ see |line()|.
+*** ../vim-7.1.261/src/version.c Wed Feb 20 18:14:25 2008
+--- src/version.c Wed Feb 20 20:04:14 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 262,
+ /**/
+
+--
+Those who live by the sword get shot by those who don't.
+
+ /// 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.263
+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.263
+Problem: The filetype can consist of two dot separated names. This works
+ for syntax and ftplugin, but not for indent. (Brett Stahlman)
+Solution: Use split() and loop over each dot separated name.
+Files: runtime/indent.vim
+
+
+*** ../vim-7.1.262/runtime/indent.vim Mon Mar 28 22:56:55 2005
+--- runtime/indent.vim Fri Feb 22 21:05:39 2008
+***************
+*** 1,7 ****
+ " Vim support file to switch on loading indent files for file types
+ "
+ " Maintainer: Bram Moolenaar <Bram@vim.org>
+! " Last Change: 2005 Mar 28
+
+ if exists("did_indent_on")
+ finish
+--- 1,7 ----
+ " Vim support file to switch on loading indent files for file types
+ "
+ " Maintainer: Bram Moolenaar <Bram@vim.org>
+! " Last Change: 2008 Feb 22
+
+ if exists("did_indent_on")
+ finish
+***************
+*** 15,25 ****
+ exe b:undo_indent
+ unlet! b:undo_indent b:did_indent
+ endif
+! if expand("<amatch>") != ""
+ if exists("b:did_indent")
+ unlet b:did_indent
+ endif
+! runtime! indent/<amatch>.vim
+ endif
+ endfunc
+ augroup END
+--- 15,31 ----
+ exe b:undo_indent
+ unlet! b:undo_indent b:did_indent
+ endif
+! let s = expand("<amatch>")
+! if s != ""
+ if exists("b:did_indent")
+ unlet b:did_indent
+ endif
+!
+! " When there is a dot it is used to separate filetype names. Thus for
+! " "aaa.bbb" load "indent/aaa.vim" and then "indent/bbb.vim".
+! for name in split(s, '\.')
+! exe 'runtime! indent/' . name . '.vim'
+! endfor
+ endif
+ endfunc
+ augroup END
+*** ../vim-7.1.262/src/version.c Wed Feb 20 20:09:44 2008
+--- src/version.c Mon Feb 25 20:44:04 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 263,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+45. You buy a Captain Kirk chair with a built-in keyboard and mouse.
+
+ /// 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.264
+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.264
+Problem: Crash when indenting lines. (Dominique Pelle)
+Solution: Set the cursor column when changing the cursor line.
+Files: src/ops.c, src/misc1.c
+
+
+*** ../vim-7.1.263/src/ops.c Wed Feb 6 14:43:50 2008
+--- src/ops.c Sun Feb 24 14:56:38 2008
+***************
+*** 692,697 ****
+--- 692,698 ----
+ }
+ }
+ ++curwin->w_cursor.lnum;
++ curwin->w_cursor.col = 0; /* make sure it's valid */
+ }
+
+ /* put cursor on first non-blank of indented line */
+*** ../vim-7.1.263/src/misc1.c Wed Feb 13 10:57:11 2008
+--- src/misc1.c Sun Feb 24 15:04:27 2008
+***************
+*** 6894,6899 ****
+--- 6894,6900 ----
+ if (trypos != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
++ curwin->w_cursor.col = 0;
+ continue;
+ }
+
+***************
+*** 6954,6959 ****
+--- 6955,6961 ----
+ if (trypos != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
++ curwin->w_cursor.col = 0;
+ continue;
+ }
+ }
+***************
+*** 6991,6996 ****
+--- 6993,6999 ----
+ if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
++ curwin->w_cursor.col = 0;
+ continue;
+ }
+
+***************
+*** 7114,7120 ****
+--- 7117,7126 ----
+ {
+ if (find_last_paren(l, '{', '}') && (trypos =
+ find_start_brace(ind_maxcomment)) != NULL)
++ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
++ curwin->w_cursor.col = 0;
++ }
+ continue;
+ }
+
+***************
+*** 7230,7240 ****
+ * case xx: if ( asdf &&
+ * asdf)
+ */
+! curwin->w_cursor.lnum = trypos->lnum;
+ l = ml_get_curline();
+ if (cin_iscase(l) || cin_isscopedecl(l))
+ {
+ ++curwin->w_cursor.lnum;
+ continue;
+ }
+ }
+--- 7236,7247 ----
+ * case xx: if ( asdf &&
+ * asdf)
+ */
+! curwin->w_cursor = *trypos;
+ l = ml_get_curline();
+ if (cin_iscase(l) || cin_isscopedecl(l))
+ {
+ ++curwin->w_cursor.lnum;
++ curwin->w_cursor.col = 0;
+ continue;
+ }
+ }
+***************
+*** 7254,7259 ****
+--- 7261,7267 ----
+ if (*l == NUL || l[STRLEN(l) - 1] != '\\')
+ break;
+ --curwin->w_cursor.lnum;
++ curwin->w_cursor.col = 0;
+ }
+ }
+
+***************
+*** 7587,7597 ****
+ * case xx: if ( asdf &&
+ * asdf)
+ */
+! curwin->w_cursor.lnum = trypos->lnum;
+ l = ml_get_curline();
+ if (cin_iscase(l) || cin_isscopedecl(l))
+ {
+ ++curwin->w_cursor.lnum;
+ continue;
+ }
+ }
+--- 7595,7606 ----
+ * case xx: if ( asdf &&
+ * asdf)
+ */
+! curwin->w_cursor = *trypos;
+ l = ml_get_curline();
+ if (cin_iscase(l) || cin_isscopedecl(l))
+ {
+ ++curwin->w_cursor.lnum;
++ curwin->w_cursor.col = 0;
+ continue;
+ }
+ }
+***************
+*** 7652,7664 ****
+ && (trypos = find_start_brace(ind_maxcomment))
+ != NULL) /* XXX */
+ {
+! curwin->w_cursor.lnum = trypos->lnum;
+ /* if not "else {" check for terminated again */
+ /* but skip block for "} else {" */
+ l = cin_skipcomment(ml_get_curline());
+ if (*l == '}' || !cin_iselse(l))
+ goto term_again;
+ ++curwin->w_cursor.lnum;
+ }
+ }
+ }
+--- 7661,7674 ----
+ && (trypos = find_start_brace(ind_maxcomment))
+ != NULL) /* XXX */
+ {
+! curwin->w_cursor = *trypos;
+ /* if not "else {" check for terminated again */
+ /* but skip block for "} else {" */
+ l = cin_skipcomment(ml_get_curline());
+ if (*l == '}' || !cin_iselse(l))
+ goto term_again;
+ ++curwin->w_cursor.lnum;
++ curwin->w_cursor.col = 0;
+ }
+ }
+ }
+***************
+*** 7727,7732 ****
+--- 7737,7743 ----
+ if ((trypos = find_start_comment(ind_maxcomment)) != NULL)
+ {
+ curwin->w_cursor.lnum = trypos->lnum + 1;
++ curwin->w_cursor.col = 0;
+ continue;
+ }
+
+***************
+*** 7777,7783 ****
+ if (find_last_paren(l, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+! curwin->w_cursor.lnum = trypos->lnum;
+
+ /* For a line ending in ',' that is a continuation line go
+ * back to the first line with a backslash:
+--- 7788,7794 ----
+ if (find_last_paren(l, '(', ')')
+ && (trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+! curwin->w_cursor = *trypos;
+
+ /* For a line ending in ',' that is a continuation line go
+ * back to the first line with a backslash:
+***************
+*** 7791,7796 ****
+--- 7802,7808 ----
+ if (*l == NUL || l[STRLEN(l) - 1] != '\\')
+ break;
+ --curwin->w_cursor.lnum;
++ curwin->w_cursor.col = 0;
+ }
+
+ amount = get_indent(); /* XXX */
+***************
+*** 7864,7870 ****
+
+ if ((trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+! curwin->w_cursor.lnum = trypos->lnum;
+ amount = get_indent(); /* XXX */
+ break;
+ }
+--- 7876,7882 ----
+
+ if ((trypos = find_match_paren(ind_maxparen,
+ ind_maxcomment)) != NULL)
+! curwin->w_cursor = *trypos;
+ amount = get_indent(); /* XXX */
+ break;
+ }
+*** ../vim-7.1.263/src/version.c Mon Feb 25 20:45:46 2008
+--- src/version.c Mon Feb 25 21:51:20 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 264,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+49. You never have to deal with busy signals when calling your ISP...because
+ you never log off.
+
+ /// 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.265
+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.265
+Problem: When 'isfname' contains a space, cmdline completion can hang.
+ (James Vega)
+Solution: Reset the "len" variable.
+Files: src/ex_docmd.c
+
+
+*** ../vim-7.1.264/src/ex_docmd.c Sat Jan 19 15:55:51 2008
+--- src/ex_docmd.c Sun Feb 24 22:09:52 2008
+***************
+*** 3346,3351 ****
+--- 3346,3352 ----
+ #endif
+ ))
+ {
++ len = 0; /* avoid getting stuck when space is in 'isfname' */
+ while (*p != NUL)
+ {
+ #ifdef FEAT_MBYTE
+*** ../vim-7.1.264/src/version.c Mon Feb 25 21:54:23 2008
+--- src/version.c Tue Feb 26 21:28:25 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 265,
+ /**/
+
+--
+Q: What is a patch 22?
+A: A patch you need to include to make it possible to include patches.
+
+ /// 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.266
+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.266
+Problem: When the version string returned by the terminal contains
+ unexpected characters, it is used as typed input. (James Vega)
+Solution: Assume the escape sequence ends in a letter.
+Files: src/term.c
+
+
+*** ../vim-7.1.265/src/term.c Sat Sep 15 14:06:41 2007
+--- src/term.c Mon Feb 25 20:21:53 2008
+***************
+*** 4050,4064 ****
+ {
+ /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also
+ * eat other possible responses to t_RV, rxvt returns
+! * "<Esc>[?1;2c". Also accept CSI instead of <Esc>[. */
+ if (*T_CRV != NUL && ((tp[0] == ESC && tp[1] == '[' && len >= 3)
+ || (tp[0] == CSI && len >= 2)))
+ {
+ j = 0;
+ extra = 0;
+! for (i = 2 + (tp[0] != CSI);
+! i < len && (VIM_ISDIGIT(tp[i])
+! || tp[i] == ';' || tp[i] == '.'); ++i)
+ if (tp[i] == ';' && ++j == 1)
+ extra = atoi((char *)tp + i + 1);
+ if (i == len)
+--- 4050,4066 ----
+ {
+ /* Check for xterm version string: "<Esc>[>{x};{vers};{y}c". Also
+ * eat other possible responses to t_RV, rxvt returns
+! * "<Esc>[?1;2c". Also accept CSI instead of <Esc>[.
+! * mrxvt has been reported to have "+" in the version. Assume
+! * the escape sequence ends with a letter or one of "{|}~". */
+ if (*T_CRV != NUL && ((tp[0] == ESC && tp[1] == '[' && len >= 3)
+ || (tp[0] == CSI && len >= 2)))
+ {
+ j = 0;
+ extra = 0;
+! for (i = 2 + (tp[0] != CSI); i < len
+! && !(tp[i] >= '{' && tp[i] <= '~')
+! && !ASCII_ISALPHA(tp[i]); ++i)
+ if (tp[i] == ';' && ++j == 1)
+ extra = atoi((char *)tp + i + 1);
+ if (i == len)
+*** ../vim-7.1.265/src/version.c Tue Feb 26 21:29:06 2008
+--- src/version.c Wed Feb 27 16:10:59 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 266,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+54. You start tilting your head sideways to smile. :-)
+
+ /// 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.267
+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.267
+Problem: When changing folds cursor may be positioned in the wrong place.
+Solution: Call changed_window_setting_win() instead of
+ changed_window_setting().
+Files: src/fold.c
+
+
+*** ../vim-7.1.266/src/fold.c Sun Jan 13 21:57:25 2008
+--- src/fold.c Wed Mar 5 12:48:43 2008
+***************
+*** 2307,2313 ****
+
+ /* If some fold changed, need to redraw and position cursor. */
+ if (fold_changed && wp->w_p_fen)
+! changed_window_setting();
+
+ /* If we updated folds past "bot", need to redraw more lines. Don't do
+ * this in other situations, the changed lines will be redrawn anyway and
+--- 2307,2313 ----
+
+ /* If some fold changed, need to redraw and position cursor. */
+ if (fold_changed && wp->w_p_fen)
+! changed_window_setting_win(wp);
+
+ /* If we updated folds past "bot", need to redraw more lines. Don't do
+ * this in other situations, the changed lines will be redrawn anyway and
+*** ../vim-7.1.266/src/version.c Wed Feb 27 16:13:09 2008
+--- src/version.c Thu Mar 6 22:43:05 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 267,
+ /**/
+
+--
+From "know your smileys":
+ % Bike accident. A bit far-fetched, I suppose; although...
+ o _ _ _
+ _o /\_ _ \\o (_)\__/o (_)
+ _< \_ _>(_) (_)/<_ \_| \ _|/' \/
+ (_)>(_) (_) (_) (_) (_)' _\o_
+
+ /// 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.268
+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.268
+Problem: Always shows "+" at end of screen line with: ":set
+ listchars=eol:$,extends:+ nowrap list cursorline" (Gary Johnson)
+Solution: Check for lcs_eol_one instead of lcs_eol.
+Files: src/screen.c
+
+
+*** ../vim-7.1.267/src/screen.c Wed Feb 20 14:15:45 2008
+--- src/screen.c Sun Mar 9 14:26:14 2008
+***************
+*** 4527,4533 ****
+ #endif
+ col == W_WIDTH(wp) - 1)
+ && (*ptr != NUL
+! || (wp->w_p_list && lcs_eol != NUL && p_extra != at_end_str)
+ || (n_extra && (c_extra != NUL || *p_extra != NUL))))
+ {
+ c = lcs_ext;
+--- 4527,4533 ----
+ #endif
+ col == W_WIDTH(wp) - 1)
+ && (*ptr != NUL
+! || (wp->w_p_list && lcs_eol_one > 0)
+ || (n_extra && (c_extra != NUL || *p_extra != NUL))))
+ {
+ c = lcs_ext;
+*** ../vim-7.1.267/src/version.c Thu Mar 6 22:44:45 2008
+--- src/version.c Sun Mar 9 14:24:59 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 268,
+ /**/
+
+--
+From "know your smileys":
+ :-* A big kiss!
+
+ /// 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.269
+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.269
+Problem: The matchparen plugin has an arbitrary limit for the number of
+ lines to look for a match.
+Solution: Rely on the searchpair() timeout.
+Files: runtime/plugin/matchparen.vim
+
+
+*** ../vim-7.1.268/runtime/plugin/matchparen.vim Sun Jan 6 20:05:36 2008
+--- runtime/plugin/matchparen.vim Wed Feb 27 22:39:32 2008
+***************
+*** 1,6 ****
+ " Vim plugin for showing matching parens
+ " Maintainer: Bram Moolenaar <Bram@vim.org>
+! " Last Change: 2008 Jan 06
+
+ " Exit quickly when:
+ " - this plugin was already loaded (or disabled)
+--- 1,6 ----
+ " Vim plugin for showing matching parens
+ " Maintainer: Bram Moolenaar <Bram@vim.org>
+! " Last Change: 2008 Feb 27
+
+ " Exit quickly when:
+ " - this plugin was already loaded (or disabled)
+***************
+*** 34,40 ****
+ endif
+
+ " Avoid that we remove the popup menu.
+! if pumvisible()
+ return
+ endif
+
+--- 34,41 ----
+ endif
+
+ " Avoid that we remove the popup menu.
+! " Return when there are no colors (looks like the cursor jumps).
+! if pumvisible() || (&t_Co < 8 && !has("gui_running"))
+ return
+ endif
+
+***************
+*** 60,98 ****
+ endif
+
+ " Figure out the arguments for searchpairpos().
+- " Restrict the search to visible lines with "stopline".
+- " And avoid searching very far (e.g., for closed folds and long lines)
+- " The "viewable" variables give a range in which we can scroll while keeping
+- " the cursor at the same position
+- " adjustedScrolloff accounts for very large numbers of scrolloff
+- let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
+- let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
+- let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
+- " one of these stoplines will be adjusted below, but the current values are
+- " minimal boundaries within the current window
+- let stoplinebottom = line('w$')
+- let stoplinetop = line('w0')
+ if i % 2 == 0
+ let s_flags = 'nW'
+ let c2 = plist[i + 1]
+- if has("byte_offset") && has("syntax_items") && &smc > 0
+- let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
+- let stopline = min([bottom_viewable, byte2line(stopbyte)])
+- else
+- let stopline = min([bottom_viewable, c_lnum + 100])
+- endif
+- let stoplinebottom = stopline
+ else
+ let s_flags = 'nbW'
+ let c2 = c
+ let c = plist[i - 1]
+- if has("byte_offset") && has("syntax_items") && &smc > 0
+- let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
+- let stopline = max([top_viewable, byte2line(stopbyte)])
+- else
+- let stopline = max([top_viewable, c_lnum - 100])
+- endif
+- let stoplinetop = stopline
+ endif
+ if c == '['
+ let c = '\['
+--- 61,73 ----
+***************
+*** 111,120 ****
+ \ '=~? "string\\|character\\|singlequote\\|comment"'
+ execute 'if' s_skip '| let s_skip = 0 | endif'
+
+ try
+! " Limit the search time to 500 msec to avoid a hang on very long lines.
+! let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 500)
+ catch /E118/
+ let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
+ endtry
+
+--- 86,132 ----
+ \ '=~? "string\\|character\\|singlequote\\|comment"'
+ execute 'if' s_skip '| let s_skip = 0 | endif'
+
++ " Limit the search to lines visible in the window.
++ let stoplinebottom = line('w$')
++ let stoplinetop = line('w0')
++ if i % 2 == 0
++ let stopline = stoplinebottom
++ else
++ let stopline = stoplinetop
++ endif
++
+ try
+! " Limit the search time to 300 msec to avoid a hang on very long lines.
+! " This fails when a timeout is not supported.
+! let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 300)
+ catch /E118/
++ " Can't use the timeout, restrict the stopline a bit more to avoid taking
++ " a long time on closed folds and long lines.
++ " The "viewable" variables give a range in which we can scroll while
++ " keeping the cursor at the same position.
++ " adjustedScrolloff accounts for very large numbers of scrolloff.
++ let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
++ let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
++ let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
++ " one of these stoplines will be adjusted below, but the current values are
++ " minimal boundaries within the current window
++ if i % 2 == 0
++ if has("byte_offset") && has("syntax_items") && &smc > 0
++ let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
++ let stopline = min([bottom_viewable, byte2line(stopbyte)])
++ else
++ let stopline = min([bottom_viewable, c_lnum + 100])
++ endif
++ let stoplinebottom = stopline
++ else
++ if has("byte_offset") && has("syntax_items") && &smc > 0
++ let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
++ let stopline = max([top_viewable, byte2line(stopbyte)])
++ else
++ let stopline = max([top_viewable, c_lnum - 100])
++ endif
++ let stoplinetop = stopline
++ endif
+ let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
+ endtry
+
+*** ../vim-7.1.268/src/version.c Sun Mar 9 14:30:12 2008
+--- src/version.c Sun Mar 9 16:21:00 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 269,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+93. New mail alarm on your palmtop annoys other churchgoers.
+
+ /// 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.270
+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.270
+Problem: ":?foo?" matches in current line since patch 7.1.025. (A.Politz)
+Solution: Remove the SEARCH_START flag.
+Files: src/ex_docmd.c, src/search.c
+
+
+*** ../vim-7.1.269/src/ex_docmd.c Tue Feb 26 21:29:06 2008
+--- src/ex_docmd.c Sun Mar 2 20:50:43 2008
+***************
+*** 3932,3939 ****
+ curwin->w_cursor.col = 0;
+ searchcmdlen = 0;
+ if (!do_search(NULL, c, cmd, 1L,
+! SEARCH_HIS + SEARCH_MSG + SEARCH_START,
+! NULL))
+ {
+ curwin->w_cursor = pos;
+ cmd = NULL;
+--- 3932,3938 ----
+ curwin->w_cursor.col = 0;
+ searchcmdlen = 0;
+ if (!do_search(NULL, c, cmd, 1L,
+! SEARCH_HIS | SEARCH_MSG, NULL))
+ {
+ curwin->w_cursor = pos;
+ cmd = NULL;
+***************
+*** 3980,3987 ****
+ pos.col = 0;
+ if (searchit(curwin, curbuf, &pos,
+ *cmd == '?' ? BACKWARD : FORWARD,
+! (char_u *)"", 1L,
+! SEARCH_MSG + SEARCH_START,
+ i, (linenr_T)0, NULL) != FAIL)
+ lnum = pos.lnum;
+ else
+--- 3979,3985 ----
+ pos.col = 0;
+ if (searchit(curwin, curbuf, &pos,
+ *cmd == '?' ? BACKWARD : FORWARD,
+! (char_u *)"", 1L, SEARCH_MSG,
+ i, (linenr_T)0, NULL) != FAIL)
+ lnum = pos.lnum;
+ else
+*** ../vim-7.1.269/src/search.c Wed Feb 20 13:41:14 2008
+--- src/search.c Sun Mar 2 22:00:50 2008
+***************
+*** 538,544 ****
+ return FAIL;
+ }
+
+! if (options & SEARCH_START)
+ extra_col = 0;
+ #ifdef FEAT_MBYTE
+ /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
+--- 538,547 ----
+ return FAIL;
+ }
+
+! /* When not accepting a match at the start position set "extra_col" to a
+! * non-zero value. Don't do that when starting at MAXCOL, since MAXCOL +
+! * 1 is zero. */
+! if ((options & SEARCH_START) || pos->col == MAXCOL)
+ extra_col = 0;
+ #ifdef FEAT_MBYTE
+ /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
+*** ../vim-7.1.269/src/version.c Sun Mar 9 16:45:16 2008
+--- src/version.c Mon Mar 10 21:32:07 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 270,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+102. When filling out your driver's license application, you give
+ your IP address.
+
+ /// 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.271
+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.271
+Problem: In a Vim build without autocommands, checking a file that was
+ changed externally causes the current buffer to be changed
+ unexpectedly. (Karsten Hopp)
+Solution: Store "curbuf" instead of "buf".
+Files: src/fileio.c
+
+
+*** ../vim-7.1.270/src/fileio.c Wed Feb 20 18:14:25 2008
+--- src/fileio.c Tue Mar 11 21:35:05 2008
+***************
+*** 9239,9245 ****
+ aco_save_T *aco; /* structure to save values in */
+ buf_T *buf; /* new curbuf */
+ {
+! aco->save_buf = buf;
+ curbuf = buf;
+ curwin->w_buffer = buf;
+ }
+--- 9248,9254 ----
+ aco_save_T *aco; /* structure to save values in */
+ buf_T *buf; /* new curbuf */
+ {
+! aco->save_buf = curbuf;
+ curbuf = buf;
+ curwin->w_buffer = buf;
+ }
+*** ../vim-7.1.270/src/version.c Mon Mar 10 21:33:52 2008
+--- src/version.c Tue Mar 11 21:57:30 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 271,
+ /**/
+
+--
+In a world without walls and borders, who needs windows and gates?
+
+ /// 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.272
+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.272
+Problem: The special buffer name [Location List] is not used for a buffer
+ displayed in another tab page.
+Solution: Use FOR_ALL_TAB_WINDOWS instead of FOR_ALL_WINDOWS. (Hiroaki
+ Nishihara)
+Files: src/buffer.c
+
+
+*** ../vim-7.1.271/src/buffer.c Wed Oct 3 14:30:54 2007
+--- src/buffer.c Wed Mar 5 21:55:44 2008
+***************
+*** 4912,4918 ****
+ return retval;
+ }
+
+! #ifdef FEAT_VIMINFO
+ int
+ read_viminfo_bufferlist(virp, writing)
+ vir_T *virp;
+--- 4912,4918 ----
+ return retval;
+ }
+
+! #if defined(FEAT_VIMINFO) || defined(PROTO)
+ int
+ read_viminfo_bufferlist(virp, writing)
+ vir_T *virp;
+***************
+*** 5033,5045 ****
+ #if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+ if (bt_quickfix(buf))
+ {
+! win_T *win;
+
+ /*
+ * For location list window, w_llist_ref points to the location list.
+ * For quickfix window, w_llist_ref is NULL.
+ */
+! FOR_ALL_WINDOWS(win)
+ if (win->w_buffer == buf)
+ break;
+ if (win != NULL && win->w_llist_ref != NULL)
+--- 5033,5046 ----
+ #if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+ if (bt_quickfix(buf))
+ {
+! win_T *win;
+! tabpage_T *tp;
+
+ /*
+ * For location list window, w_llist_ref points to the location list.
+ * For quickfix window, w_llist_ref is NULL.
+ */
+! FOR_ALL_TAB_WINDOWS(tp, win)
+ if (win->w_buffer == buf)
+ break;
+ if (win != NULL && win->w_llist_ref != NULL)
+*** ../vim-7.1.271/src/version.c Tue Mar 11 22:01:16 2008
+--- src/version.c Wed Mar 12 12:21:13 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 272,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits.
+
+ /// 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.273
+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.273
+Problem: When profiling on Linux Vim exits early. (Liu Yubao)
+Solution: When profiling don't exit on SIGPROF.
+Files: src/Makefile, src/os_unix.c
+
+
+*** ../vim-7.1.272/src/Makefile Wed Mar 12 12:23:18 2008
+--- src/Makefile Wed Mar 12 13:11:07 2008
+***************
+*** 545,551 ****
+ # For unknown reasons adding "-lc" fixes a linking problem with GCC. That's
+ # probably a bug in the "-pg" implementation.
+ # Need to recompile everything after changing this: "make clean" "make".
+! #PROFILE_CFLAGS = -pg -g
+ #PROFILE_LIBS = -pg
+ #PROFILE_LIBS = -pg -lc
+
+--- 545,551 ----
+ # For unknown reasons adding "-lc" fixes a linking problem with GCC. That's
+ # probably a bug in the "-pg" implementation.
+ # Need to recompile everything after changing this: "make clean" "make".
+! #PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING
+ #PROFILE_LIBS = -pg
+ #PROFILE_LIBS = -pg -lc
+
+*** ../vim-7.1.272/src/os_unix.c Sun Feb 10 22:25:12 2008
+--- src/os_unix.c Wed Mar 5 22:15:41 2008
+***************
+*** 269,276 ****
+ #ifdef SIGVTALRM
+ {SIGVTALRM, "VTALRM", TRUE},
+ #endif
+! #if defined(SIGPROF) && !defined(FEAT_MZSCHEME)
+! /* MzScheme uses SIGPROF for its own needs */
+ {SIGPROF, "PROF", TRUE},
+ #endif
+ #ifdef SIGXCPU
+--- 269,277 ----
+ #ifdef SIGVTALRM
+ {SIGVTALRM, "VTALRM", TRUE},
+ #endif
+! #if defined(SIGPROF) && !defined(FEAT_MZSCHEME) && !defined(WE_ARE_PROFILING)
+! /* MzScheme uses SIGPROF for its own needs; On Linux with profiling
+! * this makes Vim exit. WE_ARE_PROFILING is defined in Makefile. */
+ {SIGPROF, "PROF", TRUE},
+ #endif
+ #ifdef SIGXCPU
+*** ../vim-7.1.272/src/version.c Wed Mar 12 12:22:56 2008
+--- src/version.c Wed Mar 12 13:08:59 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 273,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+114. You are counting items, you go "0,1,2,3,4,5,6,7,8,9,A,B,C,D...".
+
+ /// 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.274
+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.274 (after 7.1.272)
+Problem: Compiler warning for optimized build.
+Solution: Init win to NULL.
+Files: src/buffer.c
+
+
+*** ../vim-7.1.273/src/buffer.c Wed Mar 12 12:22:56 2008
+--- src/buffer.c Wed Mar 12 13:15:21 2008
+***************
+*** 5033,5039 ****
+ #if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+ if (bt_quickfix(buf))
+ {
+! win_T *win;
+ tabpage_T *tp;
+
+ /*
+--- 5033,5039 ----
+ #if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
+ if (bt_quickfix(buf))
+ {
+! win_T *win = NULL;
+ tabpage_T *tp;
+
+ /*
+*** ../vim-7.1.273/src/version.c Wed Mar 12 13:16:37 2008
+--- src/version.c Wed Mar 12 13:45:25 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 274,
+ /**/
+
+--
+FIXME and XXX are two common keywords used to mark broken or incomplete code
+not only since XXX as a sex reference would grab everbodys attention but
+simply due to the fact that Vim would highlight these words.
+ -- Hendrik Scholz
+
+ /// 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.275
+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.275 (extra)
+Problem: Mac: ATSUI and 'antialias' don't work properly together.
+Solution: Fix this and the input method. (Jjgod Jiang)
+Files: src/vim.h, src/gui_mac.c
+
+
+*** ../vim-7.1.274/src/vim.h Wed Feb 20 12:22:59 2008
+--- src/vim.h Wed Mar 12 13:18:58 2008
+***************
+*** 461,468 ****
+ /*
+ * Check input method control.
+ */
+! #if defined(FEAT_XIM) || \
+! (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)))
+ # define USE_IM_CONTROL
+ #endif
+
+--- 461,469 ----
+ /*
+ * Check input method control.
+ */
+! #if defined(FEAT_XIM) \
+! || (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
+! || defined(FEAT_GUI_MAC)
+ # define USE_IM_CONTROL
+ #endif
+
+*** ../vim-7.1.274/src/gui_mac.c Sat Sep 29 13:15:29 2007
+--- src/gui_mac.c Wed Mar 12 13:40:57 2008
+***************
+*** 59,65 ****
+--- 59,91 ----
+
+ #ifdef MACOS_CONVERT
+ # define USE_CARBONKEYHANDLER
++
++ static int im_is_active = FALSE;
++ #if 0
++ static int im_start_row = 0;
++ static int im_start_col = 0;
++ #endif
++
++ #define NR_ELEMS(x) (sizeof(x) / sizeof(x[0]))
++
++ static TSMDocumentID gTSMDocument;
++
++ static void im_on_window_switch(int active);
+ static EventHandlerUPP keyEventHandlerUPP = NULL;
++ static EventHandlerUPP winEventHandlerUPP = NULL;
++
++ static pascal OSStatus gui_mac_handle_window_activate(
++ EventHandlerCallRef nextHandler, EventRef theEvent, void *data);
++
++ static pascal OSStatus gui_mac_handle_text_input(
++ EventHandlerCallRef nextHandler, EventRef theEvent, void *data);
++
++ static pascal OSStatus gui_mac_update_input_area(
++ EventHandlerCallRef nextHandler, EventRef theEvent);
++
++ static pascal OSStatus gui_mac_unicode_key_event(
++ EventHandlerCallRef nextHandler, EventRef theEvent);
++
+ #endif
+
+
+***************
+*** 137,143 ****
+--- 166,176 ----
+
+ #ifdef MACOS_CONVERT
+ # define USE_ATSUI_DRAWING
++ int p_macatsui_last;
+ ATSUStyle gFontStyle;
++ # ifdef FEAT_MBYTE
++ ATSUStyle gWideFontStyle;
++ # endif
+ Boolean gIsFontFallbackSet;
+ #endif
+
+***************
+*** 265,270 ****
+--- 298,308 ----
+ static WindowRef drawer = NULL; // TODO: put into gui.h
+ #endif
+
++ #ifdef USE_ATSUI_DRAWING
++ static void gui_mac_set_font_attributes(GuiFont font);
++ static void gui_mac_dispose_atsui_style(void);
++ #endif
++
+ /*
+ * ------------------------------------------------------------
+ * Conversion Utility
+***************
+*** 1935,1946 ****
+ /* Dim scrollbars */
+ if (whichWindow == gui.VimWindow)
+ {
+! ControlRef rootControl;
+! GetRootControl(gui.VimWindow, &rootControl);
+! if ((event->modifiers) & activeFlag)
+! ActivateControl(rootControl);
+! else
+! DeactivateControl(rootControl);
+ }
+
+ /* Activate */
+--- 1973,1984 ----
+ /* Dim scrollbars */
+ if (whichWindow == gui.VimWindow)
+ {
+! ControlRef rootControl;
+! GetRootControl(gui.VimWindow, &rootControl);
+! if ((event->modifiers) & activeFlag)
+! ActivateControl(rootControl);
+! else
+! DeactivateControl(rootControl);
+ }
+
+ /* Activate */
+***************
+*** 1976,1990 ****
+ * Handle the key
+ */
+ #ifdef USE_CARBONKEYHANDLER
+
+! static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the keys */
+
+ # define INLINE_KEY_BUFFER_SIZE 80
+ static pascal OSStatus
+! gui_mac_doKeyEventCarbon(
+ EventHandlerCallRef nextHandler,
+! EventRef theEvent,
+! void *data)
+ {
+ /* Multibyte-friendly key event handler */
+ OSStatus err = -1;
+--- 2014,2100 ----
+ * Handle the key
+ */
+ #ifdef USE_CARBONKEYHANDLER
++ static pascal OSStatus
++ gui_mac_handle_window_activate(
++ EventHandlerCallRef nextHandler,
++ EventRef theEvent,
++ void *data)
++ {
++ UInt32 eventClass = GetEventClass(theEvent);
++ UInt32 eventKind = GetEventKind(theEvent);
++
++ if (eventClass == kEventClassWindow)
++ {
++ switch (eventKind)
++ {
++ case kEventWindowActivated:
++ #if defined(USE_IM_CONTROL)
++ im_on_window_switch(TRUE);
++ #endif
++ return noErr;
++
++ case kEventWindowDeactivated:
++ #if defined(USE_IM_CONTROL)
++ im_on_window_switch(FALSE);
++ #endif
++ return noErr;
++ }
++ }
++
++ return eventNotHandledErr;
++ }
++
++ static pascal OSStatus
++ gui_mac_handle_text_input(
++ EventHandlerCallRef nextHandler,
++ EventRef theEvent,
++ void *data)
++ {
++ UInt32 eventClass = GetEventClass(theEvent);
++ UInt32 eventKind = GetEventKind(theEvent);
++
++ if (eventClass != kEventClassTextInput)
++ return eventNotHandledErr;
+
+! if ((kEventTextInputUpdateActiveInputArea != eventKind) &&
+! (kEventTextInputUnicodeForKeyEvent != eventKind) &&
+! (kEventTextInputOffsetToPos != eventKind) &&
+! (kEventTextInputPosToOffset != eventKind) &&
+! (kEventTextInputGetSelectedText != eventKind))
+! return eventNotHandledErr;
+!
+! switch (eventKind)
+! {
+! case kEventTextInputUpdateActiveInputArea:
+! return gui_mac_update_input_area(nextHandler, theEvent);
+! case kEventTextInputUnicodeForKeyEvent:
+! return gui_mac_unicode_key_event(nextHandler, theEvent);
+!
+! case kEventTextInputOffsetToPos:
+! case kEventTextInputPosToOffset:
+! case kEventTextInputGetSelectedText:
+! break;
+! }
+!
+! return eventNotHandledErr;
+! }
+!
+! static pascal
+! OSStatus gui_mac_update_input_area(
+! EventHandlerCallRef nextHandler,
+! EventRef theEvent)
+! {
+! return eventNotHandledErr;
+! }
+!
+! static int dialog_busy = FALSE; /* TRUE when gui_mch_dialog() wants the
+! keys */
+
+ # define INLINE_KEY_BUFFER_SIZE 80
+ static pascal OSStatus
+! gui_mac_unicode_key_event(
+ EventHandlerCallRef nextHandler,
+! EventRef theEvent)
+ {
+ /* Multibyte-friendly key event handler */
+ OSStatus err = -1;
+***************
+*** 2000,2006 ****
+ char_u *to = NULL;
+ Boolean isSpecial = FALSE;
+ int i;
+! EventRef keyEvent;
+
+ /* Mask the mouse (as per user setting) */
+ if (p_mh)
+--- 2110,2116 ----
+ char_u *to = NULL;
+ Boolean isSpecial = FALSE;
+ int i;
+! EventRef keyEvent;
+
+ /* Mask the mouse (as per user setting) */
+ if (p_mh)
+***************
+*** 2008,2046 ****
+
+ /* Don't use the keys when the dialog wants them. */
+ if (dialog_busy)
+! return eventNotHandledErr;
+
+ if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText,
+! typeUnicodeText, NULL, 0, &actualSize, NULL))
+! return eventNotHandledErr;
+
+ text = (UniChar *)alloc(actualSize);
+ if (!text)
+! return eventNotHandledErr;
+
+ err = GetEventParameter(theEvent, kEventParamTextInputSendText,
+! typeUnicodeText, NULL, actualSize, NULL, text);
+ require_noerr(err, done);
+
+ err = GetEventParameter(theEvent, kEventParamTextInputSendKeyboardEvent,
+! typeEventRef, NULL, sizeof(EventRef), NULL, &keyEvent);
+ require_noerr(err, done);
+
+ err = GetEventParameter(keyEvent, kEventParamKeyModifiers,
+! typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
+ require_noerr(err, done);
+
+ err = GetEventParameter(keyEvent, kEventParamKeyCode,
+! typeUInt32, NULL, sizeof(UInt32), NULL, &key_sym);
+ require_noerr(err, done);
+
+ err = GetEventParameter(keyEvent, kEventParamKeyMacCharCodes,
+! typeChar, NULL, sizeof(char), NULL, &charcode);
+ require_noerr(err, done);
+
+ #ifndef USE_CMD_KEY
+ if (modifiers & cmdKey)
+! goto done; /* Let system handle Cmd+... */
+ #endif
+
+ key_char = charcode;
+--- 2118,2156 ----
+
+ /* Don't use the keys when the dialog wants them. */
+ if (dialog_busy)
+! return eventNotHandledErr;
+
+ if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText,
+! typeUnicodeText, NULL, 0, &actualSize, NULL))
+! return eventNotHandledErr;
+
+ text = (UniChar *)alloc(actualSize);
+ if (!text)
+! return eventNotHandledErr;
+
+ err = GetEventParameter(theEvent, kEventParamTextInputSendText,
+! typeUnicodeText, NULL, actualSize, NULL, text);
+ require_noerr(err, done);
+
+ err = GetEventParameter(theEvent, kEventParamTextInputSendKeyboardEvent,
+! typeEventRef, NULL, sizeof(EventRef), NULL, &keyEvent);
+ require_noerr(err, done);
+
+ err = GetEventParameter(keyEvent, kEventParamKeyModifiers,
+! typeUInt32, NULL, sizeof(UInt32), NULL, &modifiers);
+ require_noerr(err, done);
+
+ err = GetEventParameter(keyEvent, kEventParamKeyCode,
+! typeUInt32, NULL, sizeof(UInt32), NULL, &key_sym);
+ require_noerr(err, done);
+
+ err = GetEventParameter(keyEvent, kEventParamKeyMacCharCodes,
+! typeChar, NULL, sizeof(char), NULL, &charcode);
+ require_noerr(err, done);
+
+ #ifndef USE_CMD_KEY
+ if (modifiers & cmdKey)
+! goto done; /* Let system handle Cmd+... */
+ #endif
+
+ key_char = charcode;
+***************
+*** 2048,2131 ****
+
+ /* Find the special key (eg., for cursor keys) */
+ if (actualSize <= sizeof(UniChar) &&
+! ((text[0] < 0x20) || (text[0] == 0x7f)))
+ {
+! for (i = 0; special_keys[i].key_sym != (KeySym)0; ++i)
+! if (special_keys[i].key_sym == key_sym)
+! {
+! key_char = TO_SPECIAL(special_keys[i].vim_code0,
+! special_keys[i].vim_code1);
+! key_char = simplify_key(key_char,
+! (int *)&vimModifiers);
+! isSpecial = TRUE;
+! break;
+! }
+ }
+
+ /* Intercept CMD-. and CTRL-c */
+ if (((modifiers & controlKey) && key_char == 'c') ||
+! ((modifiers & cmdKey) && key_char == '.'))
+! got_int = TRUE;
+
+ if (!isSpecial)
+ {
+! /* remove SHIFT for keys that are already shifted, e.g.,
+! * '(' and '*' */
+! if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char))
+! vimModifiers &= ~MOD_MASK_SHIFT;
+!
+! /* remove CTRL from keys that already have it */
+! if (key_char < 0x20)
+! vimModifiers &= ~MOD_MASK_CTRL;
+!
+! /* don't process unicode characters here */
+! if (!IS_SPECIAL(key_char))
+! {
+! /* Following code to simplify and consolidate vimModifiers
+! * taken liberally from gui_w48.c */
+! key_char = simplify_key(key_char, (int *)&vimModifiers);
+!
+! /* Interpret META, include SHIFT, etc. */
+! key_char = extract_modifiers(key_char, (int *)&vimModifiers);
+! if (key_char == CSI)
+! key_char = K_CSI;
+!
+! if (IS_SPECIAL(key_char))
+! isSpecial = TRUE;
+! }
+ }
+
+ if (vimModifiers)
+ {
+! result[len++] = CSI;
+! result[len++] = KS_MODIFIER;
+! result[len++] = vimModifiers;
+ }
+
+ if (isSpecial && IS_SPECIAL(key_char))
+ {
+! result[len++] = CSI;
+! result[len++] = K_SECOND(key_char);
+! result[len++] = K_THIRD(key_char);
+ }
+ else
+ {
+! encLen = actualSize;
+! to = mac_utf16_to_enc(text, actualSize, &encLen);
+! if (to)
+! {
+! /* This is basically add_to_input_buf_csi() */
+! for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i)
+! {
+! result[len++] = to[i];
+! if (to[i] == CSI)
+! {
+! result[len++] = KS_EXTRA;
+! result[len++] = (int)KE_CSI;
+! }
+! }
+! vim_free(to);
+! }
+ }
+
+ add_to_input_buf(result, len);
+--- 2158,2241 ----
+
+ /* Find the special key (eg., for cursor keys) */
+ if (actualSize <= sizeof(UniChar) &&
+! ((text[0] < 0x20) || (text[0] == 0x7f)))
+ {
+! for (i = 0; special_keys[i].key_sym != (KeySym)0; ++i)
+! if (special_keys[i].key_sym == key_sym)
+! {
+! key_char = TO_SPECIAL(special_keys[i].vim_code0,
+! special_keys[i].vim_code1);
+! key_char = simplify_key(key_char,
+! (int *)&vimModifiers);
+! isSpecial = TRUE;
+! break;
+! }
+ }
+
+ /* Intercept CMD-. and CTRL-c */
+ if (((modifiers & controlKey) && key_char == 'c') ||
+! ((modifiers & cmdKey) && key_char == '.'))
+! got_int = TRUE;
+
+ if (!isSpecial)
+ {
+! /* remove SHIFT for keys that are already shifted, e.g.,
+! * '(' and '*' */
+! if (key_char < 0x100 && !isalpha(key_char) && isprint(key_char))
+! vimModifiers &= ~MOD_MASK_SHIFT;
+!
+! /* remove CTRL from keys that already have it */
+! if (key_char < 0x20)
+! vimModifiers &= ~MOD_MASK_CTRL;
+!
+! /* don't process unicode characters here */
+! if (!IS_SPECIAL(key_char))
+! {
+! /* Following code to simplify and consolidate vimModifiers
+! * taken liberally from gui_w48.c */
+! key_char = simplify_key(key_char, (int *)&vimModifiers);
+!
+! /* Interpret META, include SHIFT, etc. */
+! key_char = extract_modifiers(key_char, (int *)&vimModifiers);
+! if (key_char == CSI)
+! key_char = K_CSI;
+!
+! if (IS_SPECIAL(key_char))
+! isSpecial = TRUE;
+! }
+ }
+
+ if (vimModifiers)
+ {
+! result[len++] = CSI;
+! result[len++] = KS_MODIFIER;
+! result[len++] = vimModifiers;
+ }
+
+ if (isSpecial && IS_SPECIAL(key_char))
+ {
+! result[len++] = CSI;
+! result[len++] = K_SECOND(key_char);
+! result[len++] = K_THIRD(key_char);
+ }
+ else
+ {
+! encLen = actualSize;
+! to = mac_utf16_to_enc(text, actualSize, &encLen);
+! if (to)
+! {
+! /* This is basically add_to_input_buf_csi() */
+! for (i = 0; i < encLen && len < (INLINE_KEY_BUFFER_SIZE-1); ++i)
+! {
+! result[len++] = to[i];
+! if (to[i] == CSI)
+! {
+! result[len++] = KS_EXTRA;
+! result[len++] = (int)KE_CSI;
+! }
+! }
+! vim_free(to);
+! }
+ }
+
+ add_to_input_buf(result, len);
+***************
+*** 2135,2144 ****
+ vim_free(text);
+ if (err == noErr)
+ {
+! /* Fake event to wake up WNE (required to get
+! * key repeat working */
+! PostEvent(keyUp, 0);
+! return noErr;
+ }
+
+ return eventNotHandledErr;
+--- 2245,2254 ----
+ vim_free(text);
+ if (err == noErr)
+ {
+! /* Fake event to wake up WNE (required to get
+! * key repeat working */
+! PostEvent(keyUp, 0);
+! return noErr;
+ }
+
+ return eventNotHandledErr;
+***************
+*** 2334,2340 ****
+ /* prevent that the vim window size changes if it's activated by a
+ click into the tab pane */
+ if (whichWindow == drawer)
+! return;
+ #endif
+
+ switch (thePart)
+--- 2444,2450 ----
+ /* prevent that the vim window size changes if it's activated by a
+ click into the tab pane */
+ if (whichWindow == drawer)
+! return;
+ #endif
+
+ switch (thePart)
+***************
+*** 2569,2579 ****
+ if (IsShowContextualMenuClick(event))
+ {
+ # if 0
+! gui_mac_handle_contextual_menu(event);
+ # else
+! gui_mac_doMouseDownEvent(event);
+ # endif
+! return;
+ }
+
+ /* Handle normal event */
+--- 2679,2689 ----
+ if (IsShowContextualMenuClick(event))
+ {
+ # if 0
+! gui_mac_handle_contextual_menu(event);
+ # else
+! gui_mac_doMouseDownEvent(event);
+ # endif
+! return;
+ }
+
+ /* Handle normal event */
+***************
+*** 2832,2838 ****
+ # else
+ /* OSErr GetApplicationBundleFSSpec(FSSpecPtr theFSSpecPtr)
+ * of TN2015
+- * This technic remove the ../Contents/MacOS/etc part
+ */
+ (void)GetCurrentProcess(&psn);
+ /* if (err != noErr) return err; */
+--- 2942,2947 ----
+***************
+*** 2933,2942 ****
+ /* TODO: Move most of this stuff toward gui_mch_init */
+ Rect windRect;
+ MenuHandle pomme;
+- EventTypeSpec eventTypeSpec;
+ EventHandlerRef mouseWheelHandlerRef;
+ #ifdef USE_CARBONKEYHANDLER
+! EventHandlerRef keyEventHandlerRef;
+ #endif
+ ControlRef rootControl;
+
+--- 3042,3050 ----
+ /* TODO: Move most of this stuff toward gui_mch_init */
+ Rect windRect;
+ MenuHandle pomme;
+ EventHandlerRef mouseWheelHandlerRef;
+ #ifdef USE_CARBONKEYHANDLER
+! EventTypeSpec eventTypeSpec;
+ #endif
+ ControlRef rootControl;
+
+***************
+*** 3042,3057 ****
+ }
+
+ #ifdef USE_CARBONKEYHANDLER
+! eventTypeSpec.eventClass = kEventClassTextInput;
+! eventTypeSpec.eventKind = kEventUnicodeForKeyEvent;
+! keyEventHandlerUPP = NewEventHandlerUPP(gui_mac_doKeyEventCarbon);
+! if (noErr != InstallApplicationEventHandler(keyEventHandlerUPP, 1,
+! &eventTypeSpec, NULL, &keyEventHandlerRef))
+ {
+- keyEventHandlerRef = NULL;
+ DisposeEventHandlerUPP(keyEventHandlerUPP);
+ keyEventHandlerUPP = NULL;
+ }
+ #endif
+
+ /*
+--- 3150,3196 ----
+ }
+
+ #ifdef USE_CARBONKEYHANDLER
+! InterfaceTypeList supportedServices = { kUnicodeDocument };
+! NewTSMDocument(1, supportedServices, &gTSMDocument, 0);
+!
+! /* We don't support inline input yet, use input window by default */
+! UseInputWindow(gTSMDocument, TRUE);
+!
+! /* Should we activate the document by default? */
+! // ActivateTSMDocument(gTSMDocument);
+!
+! EventTypeSpec textEventTypes[] = {
+! { kEventClassTextInput, kEventTextInputUpdateActiveInputArea },
+! { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent },
+! { kEventClassTextInput, kEventTextInputPosToOffset },
+! { kEventClassTextInput, kEventTextInputOffsetToPos },
+! };
+!
+! keyEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_text_input);
+! if (noErr != InstallApplicationEventHandler(keyEventHandlerUPP,
+! NR_ELEMS(textEventTypes),
+! textEventTypes, NULL, NULL))
+ {
+ DisposeEventHandlerUPP(keyEventHandlerUPP);
+ keyEventHandlerUPP = NULL;
+ }
++
++ EventTypeSpec windowEventTypes[] = {
++ { kEventClassWindow, kEventWindowActivated },
++ { kEventClassWindow, kEventWindowDeactivated },
++ };
++
++ /* Install window event handler to support TSMDocument activate and
++ * deactivate */
++ winEventHandlerUPP = NewEventHandlerUPP(gui_mac_handle_window_activate);
++ if (noErr != InstallWindowEventHandler(gui.VimWindow,
++ winEventHandlerUPP,
++ NR_ELEMS(windowEventTypes),
++ windowEventTypes, NULL, NULL))
++ {
++ DisposeEventHandlerUPP(winEventHandlerUPP);
++ winEventHandlerUPP = NULL;
++ }
+ #endif
+
+ /*
+***************
+*** 3107,3112 ****
+--- 3246,3264 ----
+ return OK;
+ }
+
++ #ifdef USE_ATSUI_DRAWING
++ static void
++ gui_mac_dispose_atsui_style(void)
++ {
++ if (p_macatsui && gFontStyle)
++ ATSUDisposeStyle(gFontStyle);
++ #ifdef FEAT_MBYTE
++ if (p_macatsui && gWideFontStyle)
++ ATSUDisposeStyle(gWideFontStyle);
++ #endif
++ }
++ #endif
++
+ void
+ gui_mch_exit(int rc)
+ {
+***************
+*** 3122,3129 ****
+ DisposeEventHandlerUPP(mouseWheelHandlerUPP);
+
+ #ifdef USE_ATSUI_DRAWING
+! if (p_macatsui && gFontStyle)
+! ATSUDisposeStyle(gFontStyle);
+ #endif
+
+ /* Exit to shell? */
+--- 3274,3286 ----
+ DisposeEventHandlerUPP(mouseWheelHandlerUPP);
+
+ #ifdef USE_ATSUI_DRAWING
+! gui_mac_dispose_atsui_style();
+! #endif
+!
+! #ifdef USE_CARBONKEYHANDLER
+! FixTSMDocument(gTSMDocument);
+! DeactivateTSMDocument(gTSMDocument);
+! DeleteTSMDocument(gTSMDocument);
+ #endif
+
+ /* Exit to shell? */
+***************
+*** 3263,3268 ****
+--- 3420,3445 ----
+ return selected_font;
+ }
+
++ #ifdef USE_ATSUI_DRAWING
++ static void
++ gui_mac_create_atsui_style(void)
++ {
++ if (p_macatsui && gFontStyle == NULL)
++ {
++ if (ATSUCreateStyle(&gFontStyle) != noErr)
++ gFontStyle = NULL;
++ }
++ #ifdef FEAT_MBYTE
++ if (p_macatsui && gWideFontStyle == NULL)
++ {
++ if (ATSUCreateStyle(&gWideFontStyle) != noErr)
++ gWideFontStyle = NULL;
++ }
++ #endif
++
++ p_macatsui_last = p_macatsui;
++ }
++ #endif
+
+ /*
+ * Initialise vim to use the font with the given name. Return FAIL if the font
+***************
+*** 3280,3290 ****
+ char_u used_font_name[512];
+
+ #ifdef USE_ATSUI_DRAWING
+! if (p_macatsui && gFontStyle == NULL)
+! {
+! if (ATSUCreateStyle(&gFontStyle) != noErr)
+! gFontStyle = NULL;
+! }
+ #endif
+
+ if (font_name == NULL)
+--- 3457,3463 ----
+ char_u used_font_name[512];
+
+ #ifdef USE_ATSUI_DRAWING
+! gui_mac_create_atsui_style();
+ #endif
+
+ if (font_name == NULL)
+***************
+*** 3348,3396 ****
+ gui.char_height = font_info.ascent + font_info.descent + p_linespace;
+
+ #ifdef USE_ATSUI_DRAWING
+- ATSUFontID fontID;
+- Fixed fontSize;
+- ATSStyleRenderingOptions fontOptions;
+-
+ if (p_macatsui && gFontStyle)
+! {
+! fontID = font & 0xFFFF;
+! fontSize = Long2Fix(font >> 16);
+!
+! /* No antialiasing by default (do not attempt to touch antialising
+! * options on pre-Jaguar) */
+! fontOptions =
+! (gMacSystemVersion >= 0x1020) ?
+! kATSStyleNoAntiAliasing :
+! kATSStyleNoOptions;
+!
+! ATSUAttributeTag attribTags[] =
+! {
+! kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag,
+! kATSUMaxATSUITagValue+1
+! };
+! ByteCount attribSizes[] =
+! {
+! sizeof(ATSUFontID), sizeof(Fixed),
+! sizeof(ATSStyleRenderingOptions), sizeof font
+! };
+! ATSUAttributeValuePtr attribValues[] =
+! {
+! &fontID, &fontSize, &fontOptions, &font
+! };
+!
+! /* Convert font id to ATSUFontID */
+! if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr)
+! {
+! if (ATSUSetAttributes(gFontStyle,
+! (sizeof attribTags)/sizeof(ATSUAttributeTag),
+! attribTags, attribSizes, attribValues) != noErr)
+! {
+! ATSUDisposeStyle(gFontStyle);
+! gFontStyle = NULL;
+! }
+! }
+! }
+ #endif
+
+ return OK;
+--- 3521,3528 ----
+ gui.char_height = font_info.ascent + font_info.descent + p_linespace;
+
+ #ifdef USE_ATSUI_DRAWING
+ if (p_macatsui && gFontStyle)
+! gui_mac_set_font_attributes(font);
+ #endif
+
+ return OK;
+***************
+*** 3447,3452 ****
+--- 3579,3646 ----
+ }
+ #endif
+
++ #ifdef USE_ATSUI_DRAWING
++ static void
++ gui_mac_set_font_attributes(GuiFont font)
++ {
++ ATSUFontID fontID;
++ Fixed fontSize;
++ Fixed fontWidth;
++
++ fontID = font & 0xFFFF;
++ fontSize = Long2Fix(font >> 16);
++ fontWidth = Long2Fix(gui.char_width);
++
++ ATSUAttributeTag attribTags[] =
++ {
++ kATSUFontTag, kATSUSizeTag, kATSUImposeWidthTag,
++ kATSUMaxATSUITagValue + 1
++ };
++
++ ByteCount attribSizes[] =
++ {
++ sizeof(ATSUFontID), sizeof(Fixed), sizeof(fontWidth),
++ sizeof(font)
++ };
++
++ ATSUAttributeValuePtr attribValues[] =
++ {
++ &fontID, &fontSize, &fontWidth, &font
++ };
++
++ if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr)
++ {
++ if (ATSUSetAttributes(gFontStyle,
++ (sizeof attribTags) / sizeof(ATSUAttributeTag),
++ attribTags, attribSizes, attribValues) != noErr)
++ {
++ # ifndef NDEBUG
++ fprintf(stderr, "couldn't set font style\n");
++ # endif
++ ATSUDisposeStyle(gFontStyle);
++ gFontStyle = NULL;
++ }
++
++ #ifdef FEAT_MBYTE
++ if (has_mbyte)
++ {
++ /* FIXME: we should use a more mbyte sensitive way to support
++ * wide font drawing */
++ fontWidth = Long2Fix(gui.char_width * 2);
++
++ if (ATSUSetAttributes(gWideFontStyle,
++ (sizeof attribTags) / sizeof(ATSUAttributeTag),
++ attribTags, attribSizes, attribValues) != noErr)
++ {
++ ATSUDisposeStyle(gWideFontStyle);
++ gWideFontStyle = NULL;
++ }
++ }
++ #endif
++ }
++ }
++ #endif
++
+ /*
+ * Set the current text font.
+ */
+***************
+*** 3456,3518 ****
+ #ifdef USE_ATSUI_DRAWING
+ GuiFont currFont;
+ ByteCount actualFontByteCount;
+- ATSUFontID fontID;
+- Fixed fontSize;
+- ATSStyleRenderingOptions fontOptions;
+
+ if (p_macatsui && gFontStyle)
+ {
+ /* Avoid setting same font again */
+! if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue+1, sizeof font,
+! &currFont, &actualFontByteCount) == noErr &&
+! actualFontByteCount == (sizeof font))
+ {
+ if (currFont == font)
+ return;
+ }
+
+! fontID = font & 0xFFFF;
+! fontSize = Long2Fix(font >> 16);
+! /* Respect p_antialias setting only for wide font.
+! * The reason for doing this at the moment is a bit complicated,
+! * but it's mainly because a) latin (non-wide) aliased fonts
+! * look bad in OS X 10.3.x and below (due to a bug in ATS), and
+! * b) wide multibyte input does not suffer from that problem. */
+! /*fontOptions =
+! (p_antialias && (font == gui.wide_font)) ?
+! kATSStyleNoOptions : kATSStyleNoAntiAliasing;
+! */
+! /*fontOptions = kATSStyleAntiAliasing;*/
+!
+! ATSUAttributeTag attribTags[] =
+! {
+! kATSUFontTag, kATSUSizeTag, kATSUStyleRenderingOptionsTag,
+! kATSUMaxATSUITagValue+1
+! };
+! ByteCount attribSizes[] =
+! {
+! sizeof(ATSUFontID), sizeof(Fixed),
+! sizeof(ATSStyleRenderingOptions), sizeof font
+! };
+! ATSUAttributeValuePtr attribValues[] =
+! {
+! &fontID, &fontSize, &fontOptions, &font
+! };
+!
+! if (FMGetFontFromFontFamilyInstance(fontID, 0, &fontID, NULL) == noErr)
+! {
+! if (ATSUSetAttributes(gFontStyle,
+! (sizeof attribTags)/sizeof(ATSUAttributeTag),
+! attribTags, attribSizes, attribValues) != noErr)
+! {
+! # ifndef NDEBUG
+! fprintf(stderr, "couldn't set font style\n");
+! # endif
+! ATSUDisposeStyle(gFontStyle);
+! gFontStyle = NULL;
+! }
+! }
+!
+ }
+
+ if (p_macatsui && !gIsFontFallbackSet)
+--- 3650,3668 ----
+ #ifdef USE_ATSUI_DRAWING
+ GuiFont currFont;
+ ByteCount actualFontByteCount;
+
+ if (p_macatsui && gFontStyle)
+ {
+ /* Avoid setting same font again */
+! if (ATSUGetAttribute(gFontStyle, kATSUMaxATSUITagValue + 1,
+! sizeof(font), &currFont, &actualFontByteCount) == noErr
+! && actualFontByteCount == (sizeof font))
+ {
+ if (currFont == font)
+ return;
+ }
+
+! gui_mac_set_font_attributes(font);
+ }
+
+ if (p_macatsui && !gIsFontFallbackSet)
+***************
+*** 3536,3542 ****
+ &fallbackFonts,
+ NULL) == noErr)
+ {
+! ATSUSetFontFallbacks((sizeof fallbackFonts)/sizeof(ATSUFontID), &fallbackFonts, kATSUSequentialFallbacksPreferred);
+ }
+ /*
+ ATSUAttributeValuePtr fallbackValues[] = { };
+--- 3686,3694 ----
+ &fallbackFonts,
+ NULL) == noErr)
+ {
+! ATSUSetFontFallbacks((sizeof fallbackFonts)/sizeof(ATSUFontID),
+! &fallbackFonts,
+! kATSUSequentialFallbacksPreferred);
+ }
+ /*
+ ATSUAttributeValuePtr fallbackValues[] = { };
+***************
+*** 3921,3927 ****
+
+ /* - ATSUI automatically antialiases text (Someone)
+ * - for some reason it does not work... (Jussi) */
+!
+ /*
+ * When antialiasing we're using srcOr mode, we have to clear the block
+ * before drawing the text.
+--- 4073,4082 ----
+
+ /* - ATSUI automatically antialiases text (Someone)
+ * - for some reason it does not work... (Jussi) */
+! #ifdef MAC_ATSUI_DEBUG
+! fprintf(stderr, "row = %d, col = %d, len = %d: '%c'\n",
+! row, col, len, len == 1 ? s[0] : ' ');
+! #endif
+ /*
+ * When antialiasing we're using srcOr mode, we have to clear the block
+ * before drawing the text.
+***************
+*** 3956,3990 ****
+ }
+
+ {
+- /* Use old-style, non-antialiased QuickDraw text rendering. */
+ TextMode(srcCopy);
+ TextFace(normal);
+
+! /* SelectFont(hdc, gui.currFont); */
+!
+ if (flags & DRAW_TRANSP)
+ {
+ TextMode(srcOr);
+ }
+
+ MoveTo(TEXT_X(col), TEXT_Y(row));
+- ATSUTextLayout textLayout;
+
+! if (ATSUCreateTextLayoutWithTextPtr(tofree,
+! kATSUFromTextBeginning, kATSUToTextEnd,
+! utf16_len,
+! (gFontStyle ? 1 : 0), &utf16_len,
+! (gFontStyle ? &gFontStyle : NULL),
+! &textLayout) == noErr)
+ {
+! ATSUSetTransientFontMatching(textLayout, TRUE);
+
+! ATSUDrawText(textLayout,
+! kATSUFromTextBeginning, kATSUToTextEnd,
+! kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
+
+ ATSUDisposeTextLayout(textLayout);
+ }
+ }
+
+ if (flags & DRAW_UNDERC)
+--- 4111,4232 ----
+ }
+
+ {
+ TextMode(srcCopy);
+ TextFace(normal);
+
+! /* SelectFont(hdc, gui.currFont); */
+ if (flags & DRAW_TRANSP)
+ {
+ TextMode(srcOr);
+ }
+
+ MoveTo(TEXT_X(col), TEXT_Y(row));
+
+! if (gFontStyle && flags & DRAW_BOLD)
+ {
+! Boolean attValue = true;
+! ATSUAttributeTag attribTags[] = { kATSUQDBoldfaceTag };
+! ByteCount attribSizes[] = { sizeof(Boolean) };
+! ATSUAttributeValuePtr attribValues[] = { &attValue };
+
+! ATSUSetAttributes(gFontStyle, 1, attribTags, attribSizes, attribValues);
+! }
+!
+! #ifdef FEAT_MBYTE
+! if (has_mbyte)
+! {
+! int n, width_in_cell, last_width_in_cell;
+! UniCharArrayOffset offset = 0;
+! UniCharCount yet_to_draw = 0;
+! ATSUTextLayout textLayout;
+! ATSUStyle textStyle;
+!
+! last_width_in_cell = 1;
+! ATSUCreateTextLayout(&textLayout);
+! ATSUSetTextPointerLocation(textLayout, tofree,
+! kATSUFromTextBeginning,
+! kATSUToTextEnd, utf16_len);
+! /*
+! ATSUSetRunStyle(textLayout, gFontStyle,
+! kATSUFromTextBeginning, kATSUToTextEnd); */
+!
+! /* Compute the length in display cells. */
+! for (n = 0; n < len; n += MB_BYTE2LEN(s[n]))
+! {
+! width_in_cell = (*mb_ptr2cells)(s + n);
+!
+! /* probably we are switching from single byte character
+! * to multibyte characters (which requires more than one
+! * cell to draw) */
+! if (width_in_cell != last_width_in_cell)
+! {
+! #ifdef MAC_ATSUI_DEBUG
+! fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n",
+! n, last_width_in_cell, width_in_cell, offset, yet_to_draw);
+! #endif
+! textStyle = last_width_in_cell > 1 ? gWideFontStyle
+! : gFontStyle;
+!
+! ATSUSetRunStyle(textLayout, textStyle, offset, yet_to_draw);
+! offset += yet_to_draw;
+! yet_to_draw = 0;
+! last_width_in_cell = width_in_cell;
+! }
+
++ yet_to_draw++;
++ }
++
++ if (yet_to_draw)
++ {
++ #ifdef MAC_ATSUI_DEBUG
++ fprintf(stderr, "\tn = %2d, (%d-%d), offset = %d, yet_to_draw = %d\n",
++ n, last_width_in_cell, width_in_cell, offset, yet_to_draw);
++ #endif
++ /* finish the rest style */
++ textStyle = width_in_cell > 1 ? gWideFontStyle : gFontStyle;
++ ATSUSetRunStyle(textLayout, textStyle, offset, kATSUToTextEnd);
++ }
++
++ ATSUSetTransientFontMatching(textLayout, TRUE);
++ ATSUDrawText(textLayout,
++ kATSUFromTextBeginning, kATSUToTextEnd,
++ kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
+ ATSUDisposeTextLayout(textLayout);
+ }
++ else
++ #endif
++ {
++ ATSUTextLayout textLayout;
++
++ if (ATSUCreateTextLayoutWithTextPtr(tofree,
++ kATSUFromTextBeginning, kATSUToTextEnd,
++ utf16_len,
++ (gFontStyle ? 1 : 0), &utf16_len,
++ (gFontStyle ? &gFontStyle : NULL),
++ &textLayout) == noErr)
++ {
++ ATSUSetTransientFontMatching(textLayout, TRUE);
++
++ ATSUDrawText(textLayout,
++ kATSUFromTextBeginning, kATSUToTextEnd,
++ kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
++
++ ATSUDisposeTextLayout(textLayout);
++ }
++ }
++
++ /* drawing is done, now reset bold to normal */
++ if (gFontStyle && flags & DRAW_BOLD)
++ {
++ Boolean attValue = false;
++
++ ATSUAttributeTag attribTags[] = { kATSUQDBoldfaceTag };
++ ByteCount attribSizes[] = { sizeof(Boolean) };
++ ATSUAttributeValuePtr attribValues[] = { &attValue };
++
++ ATSUSetAttributes(gFontStyle, 1, attribTags, attribSizes,
++ attribValues);
++ }
+ }
+
+ if (flags & DRAW_UNDERC)
+***************
+*** 3998,4003 ****
+--- 4240,4252 ----
+ gui_mch_draw_string(int row, int col, char_u *s, int len, int flags)
+ {
+ #if defined(USE_ATSUI_DRAWING)
++ if (p_macatsui == 0 && p_macatsui_last != 0)
++ /* switch from macatsui to nomacatsui */
++ gui_mac_dispose_atsui_style();
++ else if (p_macatsui != 0 && p_macatsui_last == 0)
++ /* switch from nomacatsui to macatsui */
++ gui_mac_create_atsui_style();
++
+ if (p_macatsui)
+ draw_string_ATSUI(row, col, s, len, flags);
+ else
+***************
+*** 4228,4239 ****
+ */
+ /* TODO: reduce wtime accordinly??? */
+ if (wtime > -1)
+! sleeppyTick = 60*wtime/1000;
+ else
+ sleeppyTick = 32767;
+ if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn))
+ {
+! gui_mac_handle_event(&event);
+ if (input_available())
+ {
+ allow_scrollbar = FALSE;
+--- 4477,4489 ----
+ */
+ /* TODO: reduce wtime accordinly??? */
+ if (wtime > -1)
+! sleeppyTick = 60 * wtime / 1000;
+ else
+ sleeppyTick = 32767;
++
+ if (WaitNextEventWrp(mask, &event, sleeppyTick, dragRgn))
+ {
+! gui_mac_handle_event(&event);
+ if (input_available())
+ {
+ allow_scrollbar = FALSE;
+***************
+*** 6031,6037 ****
+ #endif
+ }
+
+! #if defined(USE_IM_CONTROL) || defined(PROTO)
+ /*
+ * Input Method Control functions.
+ */
+--- 6346,6352 ----
+ #endif
+ }
+
+! #if (defined(USE_IM_CONTROL) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
+ /*
+ * Input Method Control functions.
+ */
+***************
+*** 6042,6048 ****
+--- 6357,6427 ----
+ void
+ im_set_position(int row, int col)
+ {
++ #if 0
+ /* TODO: Implement me! */
++ im_start_row = row;
++ im_start_col = col;
++ #endif
++ }
++
++ static ScriptLanguageRecord gTSLWindow;
++ static ScriptLanguageRecord gTSLInsert;
++ static ScriptLanguageRecord gTSLDefault = { 0, 0 };
++
++ static Component gTSCWindow;
++ static Component gTSCInsert;
++ static Component gTSCDefault;
++
++ static int im_initialized = 0;
++
++ static void
++ im_on_window_switch(int active)
++ {
++ ScriptLanguageRecord *slptr = NULL;
++ OSStatus err;
++
++ if (! gui.in_use)
++ return;
++
++ if (im_initialized == 0)
++ {
++ im_initialized = 1;
++
++ /* save default TSM component (should be U.S.) to default */
++ GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault,
++ kKeyboardInputMethodClass);
++ }
++
++ if (active == TRUE)
++ {
++ im_is_active = TRUE;
++ ActivateTSMDocument(gTSMDocument);
++ slptr = &gTSLWindow;
++
++ if (slptr)
++ {
++ err = SetDefaultInputMethodOfClass(gTSCWindow, slptr,
++ kKeyboardInputMethodClass);
++ if (err == noErr)
++ err = SetTextServiceLanguage(slptr);
++
++ if (err == noErr)
++ KeyScript(slptr->fScript | smKeyForceKeyScriptMask);
++ }
++ }
++ else
++ {
++ err = GetTextServiceLanguage(&gTSLWindow);
++ if (err == noErr)
++ slptr = &gTSLWindow;
++
++ if (slptr)
++ GetDefaultInputMethodOfClass(&gTSCWindow, slptr,
++ kKeyboardInputMethodClass);
++
++ im_is_active = FALSE;
++ DeactivateTSMDocument(gTSMDocument);
++ }
+ }
+
+ /*
+***************
+*** 6051,6057 ****
+ void
+ im_set_active(int active)
+ {
+! KeyScript(active ? smKeySysScript : smKeyRoman);
+ }
+
+ /*
+--- 6430,6486 ----
+ void
+ im_set_active(int active)
+ {
+! ScriptLanguageRecord *slptr = NULL;
+! OSStatus err;
+!
+! if (! gui.in_use)
+! return;
+!
+! if (im_initialized == 0)
+! {
+! im_initialized = 1;
+!
+! /* save default TSM component (should be U.S.) to default */
+! GetDefaultInputMethodOfClass(&gTSCDefault, &gTSLDefault,
+! kKeyboardInputMethodClass);
+! }
+!
+! if (active == TRUE)
+! {
+! im_is_active = TRUE;
+! ActivateTSMDocument(gTSMDocument);
+! slptr = &gTSLInsert;
+!
+! if (slptr)
+! {
+! err = SetDefaultInputMethodOfClass(gTSCInsert, slptr,
+! kKeyboardInputMethodClass);
+! if (err == noErr)
+! err = SetTextServiceLanguage(slptr);
+!
+! if (err == noErr)
+! KeyScript(slptr->fScript | smKeyForceKeyScriptMask);
+! }
+! }
+! else
+! {
+! err = GetTextServiceLanguage(&gTSLInsert);
+! if (err == noErr)
+! slptr = &gTSLInsert;
+!
+! if (slptr)
+! GetDefaultInputMethodOfClass(&gTSCInsert, slptr,
+! kKeyboardInputMethodClass);
+!
+! /* restore to default when switch to normal mode, so than we could
+! * enter commands easier */
+! SetDefaultInputMethodOfClass(gTSCDefault, &gTSLDefault,
+! kKeyboardInputMethodClass);
+! SetTextServiceLanguage(&gTSLDefault);
+!
+! im_is_active = FALSE;
+! DeactivateTSMDocument(gTSMDocument);
+! }
+ }
+
+ /*
+***************
+*** 6060,6068 ****
+ int
+ im_get_status(void)
+ {
+! SInt32 script = GetScriptManagerVariable(smKeyScript);
+! return (script != smRoman
+! && script == GetScriptManagerVariable(smSysScript)) ? 1 : 0;
+ }
+
+ #endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
+--- 6489,6498 ----
+ int
+ im_get_status(void)
+ {
+! if (! gui.in_use)
+! return 0;
+!
+! return im_is_active;
+ }
+
+ #endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
+***************
+*** 6118,6124 ****
+ int numTabs = 0;
+
+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+! ++numTabs;
+ return numTabs;
+ }
+
+--- 6548,6554 ----
+ int numTabs = 0;
+
+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+! ++numTabs;
+ return numTabs;
+ }
+
+***************
+*** 6126,6133 ****
+ static OSStatus
+ dbItemDataCallback(ControlRef browser,
+ DataBrowserItemID itemID,
+! DataBrowserPropertyID property /* column id */,
+! DataBrowserItemDataRef itemData,
+ Boolean changeValue)
+ {
+ OSStatus status = noErr;
+--- 6556,6563 ----
+ static OSStatus
+ dbItemDataCallback(ControlRef browser,
+ DataBrowserItemID itemID,
+! DataBrowserPropertyID property /* column id */,
+! DataBrowserItemDataRef itemData,
+ Boolean changeValue)
+ {
+ OSStatus status = noErr;
+***************
+*** 6170,6178 ****
+ static void
+ dbGetContextualMenuCallback(ControlRef browser,
+ MenuRef *menu,
+! UInt32 *helpType,
+ CFStringRef *helpItemString,
+! AEDesc *selection)
+ {
+ // on mac os 9: kCMHelpItemNoHelp, but it's not the same
+ *helpType = kCMHelpItemRemoveHelp; // OS X only ;-)
+--- 6600,6608 ----
+ static void
+ dbGetContextualMenuCallback(ControlRef browser,
+ MenuRef *menu,
+! UInt32 *helpType,
+ CFStringRef *helpItemString,
+! AEDesc *selection)
+ {
+ // on mac os 9: kCMHelpItemNoHelp, but it's not the same
+ *helpType = kCMHelpItemRemoveHelp; // OS X only ;-)
+***************
+*** 6395,6403 ****
+ gui_mch_show_tabline(int showit)
+ {
+ if (showit == 0)
+! CloseDrawer(drawer, true);
+ else
+! OpenDrawer(drawer, kWindowEdgeRight, true);
+ }
+
+ /*
+--- 6825,6833 ----
+ gui_mch_show_tabline(int showit)
+ {
+ if (showit == 0)
+! CloseDrawer(drawer, true);
+ else
+! OpenDrawer(drawer, kWindowEdgeRight, true);
+ }
+
+ /*
+***************
+*** 6425,6435 ****
+ // adjust data browser
+ if (tabLabels != NULL)
+ {
+! int i;
+
+! for (i = 0; i < tabLabelsSize; ++i)
+! CFRelease(tabLabels[i]);
+! free(tabLabels);
+ }
+ tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef));
+ tabLabelsSize = numTabs;
+--- 6855,6865 ----
+ // adjust data browser
+ if (tabLabels != NULL)
+ {
+! int i;
+
+! for (i = 0; i < tabLabelsSize; ++i)
+! CFRelease(tabLabels[i]);
+! free(tabLabels);
+ }
+ tabLabels = (CFStringRef *)malloc(numTabs * sizeof(CFStringRef));
+ tabLabelsSize = numTabs;
+***************
+*** 6438,6444 ****
+ {
+ if (tp == curtab)
+ curtabidx = nr;
+! tabLabels[nr-1] = getTabLabel(tp);
+ }
+
+ RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL,
+--- 6868,6874 ----
+ {
+ if (tp == curtab)
+ curtabidx = nr;
+! tabLabels[nr-1] = getTabLabel(tp);
+ }
+
+ RemoveDataBrowserItems(dataBrowser, kDataBrowserNoItem, 0, NULL,
+*** ../vim-7.1.274/src/version.c Wed Mar 12 13:45:34 2008
+--- src/version.c Wed Mar 12 14:31:37 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 275,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+115. You are late picking up your kid from school and try to explain
+ to the teacher you were stuck in Web traffic.
+
+ /// 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.276
+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.276
+Problem: "gw" uses 'formatexpr', even though the docs say it doesn't.
+Solution: Don't use 'formatexpr' for "gw".
+Files: src/vim.h, src/edit.c, src/ops.c, src/proto/ops.pro
+
+
+*** ../vim-7.1.275/src/vim.h Wed Mar 12 14:38:51 2008
+--- src/vim.h Wed Mar 12 16:31:44 2008
+***************
+*** 949,954 ****
+--- 952,958 ----
+ #define INSCHAR_FORMAT 1 /* force formatting */
+ #define INSCHAR_DO_COM 2 /* format comments */
+ #define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */
++ #define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */
+
+ /* flags for open_line() */
+ #define OPENLINE_DELSPACES 1 /* delete spaces after cursor */
+*** ../vim-7.1.275/src/edit.c Tue Jan 22 17:49:17 2008
+--- src/edit.c Wed Mar 12 16:35:44 2008
+***************
+*** 5491,5497 ****
+ #if defined(FEAT_EVAL)
+ int do_internal = TRUE;
+
+! if (*curbuf->b_p_fex != NUL)
+ {
+ do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0);
+ /* It may be required to save for undo again, e.g. when setline()
+--- 5491,5497 ----
+ #if defined(FEAT_EVAL)
+ int do_internal = TRUE;
+
+! if (*curbuf->b_p_fex != NUL && (flags & INSCHAR_NO_FEX) == 0)
+ {
+ do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0);
+ /* It may be required to save for undo again, e.g. when setline()
+***************
+*** 6057,6063 ****
+ * be adjusted for the text formatting.
+ */
+ saved_cursor = pos;
+! format_lines((linenr_T)-1);
+ curwin->w_cursor = saved_cursor;
+ saved_cursor.lnum = 0;
+
+--- 6057,6063 ----
+ * be adjusted for the text formatting.
+ */
+ saved_cursor = pos;
+! format_lines((linenr_T)-1, FALSE);
+ curwin->w_cursor = saved_cursor;
+ saved_cursor.lnum = 0;
+
+*** ../vim-7.1.275/src/ops.c Mon Feb 25 21:54:23 2008
+--- src/ops.c Wed Mar 12 16:37:29 2008
+***************
+*** 4380,4386 ****
+ if (keep_cursor)
+ saved_cursor = oap->cursor_start;
+
+! format_lines(oap->line_count);
+
+ /*
+ * Leave the cursor at the first non-blank of the last formatted line.
+--- 4380,4386 ----
+ if (keep_cursor)
+ saved_cursor = oap->cursor_start;
+
+! format_lines(oap->line_count, keep_cursor);
+
+ /*
+ * Leave the cursor at the first non-blank of the last formatted line.
+***************
+*** 4495,4502 ****
+ * first line.
+ */
+ void
+! format_lines(line_count)
+ linenr_T line_count;
+ {
+ int max_len;
+ int is_not_par; /* current line not part of parag. */
+--- 4495,4503 ----
+ * first line.
+ */
+ void
+! format_lines(line_count, avoid_fex)
+ linenr_T line_count;
++ int avoid_fex; /* don't use 'formatexpr' */
+ {
+ int max_len;
+ int is_not_par; /* current line not part of parag. */
+***************
+*** 4666,4672 ****
+ #ifdef FEAT_COMMENTS
+ + (do_comments ? INSCHAR_DO_COM : 0)
+ #endif
+! , second_indent);
+ State = old_State;
+ p_smd = smd_save;
+ second_indent = -1;
+--- 4667,4673 ----
+ #ifdef FEAT_COMMENTS
+ + (do_comments ? INSCHAR_DO_COM : 0)
+ #endif
+! + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent);
+ State = old_State;
+ p_smd = smd_save;
+ second_indent = -1;
+*** ../vim-7.1.275/src/proto/ops.pro Wed Jan 16 20:01:14 2008
+--- src/proto/ops.pro Wed Mar 12 16:38:39 2008
+***************
+*** 41,47 ****
+ void op_format __ARGS((oparg_T *oap, int keep_cursor));
+ void op_formatexpr __ARGS((oparg_T *oap));
+ int fex_format __ARGS((linenr_T lnum, long count, int c));
+! void format_lines __ARGS((linenr_T line_count));
+ int paragraph_start __ARGS((linenr_T lnum));
+ int do_addsub __ARGS((int command, linenr_T Prenum1));
+ int read_viminfo_register __ARGS((vir_T *virp, int force));
+--- 41,47 ----
+ void op_format __ARGS((oparg_T *oap, int keep_cursor));
+ void op_formatexpr __ARGS((oparg_T *oap));
+ int fex_format __ARGS((linenr_T lnum, long count, int c));
+! void format_lines __ARGS((linenr_T line_count, int avoid_fex));
+ int paragraph_start __ARGS((linenr_T lnum));
+ int do_addsub __ARGS((int command, linenr_T Prenum1));
+ int read_viminfo_register __ARGS((vir_T *virp, int force));
+*** ../vim-7.1.275/src/version.c Wed Mar 12 14:38:51 2008
+--- src/version.c Wed Mar 12 17:23:43 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 276,
+ /**/
+
+--
+An actual excerpt from a classified section of a city newspaper:
+"Illiterate? Write today for free help!"
+
+ /// 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.277
+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.277
+Problem: Default for 'paragraphs' misses some items (Colin Watson)
+Solution: Add TP, HP, Pp, Lp and It to 'paragraphs'. (James Vega)
+Files: runtime/doc/options.txt, src/option.c
+
+
+*** ../vim-7.1.276/runtime/doc/options.txt Sat Jan 19 15:55:51 2008
+--- runtime/doc/options.txt Wed Mar 12 17:34:32 2008
+***************
+*** 1,4 ****
+! *options.txt* For Vim version 7.1. Last change: 2007 Aug 10
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+--- 1,4 ----
+! *options.txt* For Vim version 7.1. Last change: 2008 Feb 24
+
+
+ VIM REFERENCE MANUAL by Bram Moolenaar
+***************
+*** 4878,4884 ****
+ |autocmd-osfiletypes|
+
+ *'paragraphs'* *'para'*
+! 'paragraphs' 'para' string (default "IPLPPPQPP LIpplpipbp")
+ global
+ Specifies the nroff macros that separate paragraphs. These are pairs
+ of two letters (see |object-motions|).
+--- 4901,4907 ----
+ |autocmd-osfiletypes|
+
+ *'paragraphs'* *'para'*
+! 'paragraphs' 'para' string (default "IPLPPPQPP TPHPLIPpLpItpplpipbp")
+ global
+ Specifies the nroff macros that separate paragraphs. These are pairs
+ of two letters (see |object-motions|).
+*** ../vim-7.1.276/src/option.c Wed Feb 13 18:35:23 2008
+--- src/option.c Wed Mar 12 17:34:32 2008
+***************
+*** 1839,1845 ****
+ },
+ {"paragraphs", "para", P_STRING|P_VI_DEF,
+ (char_u *)&p_para, PV_NONE,
+! {(char_u *)"IPLPPPQPP LIpplpipbp", (char_u *)0L}},
+ {"paste", NULL, P_BOOL|P_VI_DEF|P_PRI_MKRC,
+ (char_u *)&p_paste, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+--- 1839,1846 ----
+ },
+ {"paragraphs", "para", P_STRING|P_VI_DEF,
+ (char_u *)&p_para, PV_NONE,
+! {(char_u *)"IPLPPPQPP TPHPLIPpLpItpplpipbp",
+! (char_u *)0L}},
+ {"paste", NULL, P_BOOL|P_VI_DEF|P_PRI_MKRC,
+ (char_u *)&p_paste, PV_NONE,
+ {(char_u *)FALSE, (char_u *)0L}},
+*** ../vim-7.1.276/src/version.c Wed Mar 12 17:25:50 2008
+--- src/version.c Wed Mar 12 17:35:14 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 277,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+119. You are reading a book and look for the scroll bar to get to
+ the next page.
+
+ /// 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.278
+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.278 (extra, after 7.1.275)
+Problem: Build failure when USE_CARBONKEYHANDLER is not defined.
+Solution: Remove #ifdef.
+Files: src/gui_mac.c
+
+
+*** ../vim-7.1.277/src/gui_mac.c Wed Mar 12 14:38:51 2008
+--- src/gui_mac.c Wed Mar 12 21:40:54 2008
+***************
+*** 3037,3049 ****
+ gui_mch_init(void)
+ {
+ /* TODO: Move most of this stuff toward gui_mch_init */
+! Rect windRect;
+! MenuHandle pomme;
+ EventHandlerRef mouseWheelHandlerRef;
+- #ifdef USE_CARBONKEYHANDLER
+ EventTypeSpec eventTypeSpec;
+! #endif
+! ControlRef rootControl;
+
+ if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr)
+ gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */
+--- 3040,3050 ----
+ gui_mch_init(void)
+ {
+ /* TODO: Move most of this stuff toward gui_mch_init */
+! Rect windRect;
+! MenuHandle pomme;
+ EventHandlerRef mouseWheelHandlerRef;
+ EventTypeSpec eventTypeSpec;
+! ControlRef rootControl;
+
+ if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr)
+ gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */
+*** ../vim-7.1.277/src/version.c Wed Mar 12 17:37:53 2008
+--- src/version.c Wed Mar 12 21:43:22 2008
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 278,
+ /**/
+
+--
+Would you care for a drink? I mean, if it were, like,
+disabled and you had to look after it?
+
+ /// 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 ///