From 39a54fe53e58857d3603e8e09627b0390bcab65d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adam=20Go=C5=82=C4=99biowski?= Date: Sat, 11 Jul 2009 21:23:16 +0000 Subject: [PATCH] - new Changed files: 7.2.219 -> 1.1 7.2.220 -> 1.1 7.2.221 -> 1.1 7.2.222 -> 1.1 7.2.223 -> 1.1 7.2.224 -> 1.1 7.2.225 -> 1.1 7.2.226 -> 1.1 7.2.227 -> 1.1 7.2.228 -> 1.1 --- 7.2.219 | 71 +++++++ 7.2.220 | 95 ++++++++++ 7.2.221 | 247 ++++++++++++++++++++++++ 7.2.222 | 59 ++++++ 7.2.223 | 165 ++++++++++++++++ 7.2.224 | 88 +++++++++ 7.2.225 | 97 ++++++++++ 7.2.226 | 268 ++++++++++++++++++++++++++ 7.2.227 | 52 +++++ 7.2.228 | 573 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 1715 insertions(+) create mode 100644 7.2.219 create mode 100644 7.2.220 create mode 100644 7.2.221 create mode 100644 7.2.222 create mode 100644 7.2.223 create mode 100644 7.2.224 create mode 100644 7.2.225 create mode 100644 7.2.226 create mode 100644 7.2.227 create mode 100644 7.2.228 diff --git a/7.2.219 b/7.2.219 new file mode 100644 index 0000000..f9bbec0 --- /dev/null +++ b/7.2.219 @@ -0,0 +1,71 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.219 (extra) +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.219 (extra) +Problem: Photon GUI is outdated. +Solution: Updates for QNX 6.4.0. (Sean Boudreau) +Files: src/gui_photon.c + + +*** ../vim-7.2.218/src/gui_photon.c 2007-05-10 20:23:35.000000000 +0200 +--- src/gui_photon.c 2009-07-01 16:08:36.000000000 +0200 +*************** +*** 838,844 **** +--- 838,849 ---- + static void + gui_ph_draw_start( void ) + { ++ PhGC_t *gc; ++ ++ gc = PgGetGC(); + PgSetRegion( PtWidgetRid( PtFindDisjoint( gui.vimTextArea ) ) ); ++ PgClearClippingsCx( gc ); ++ PgClearTranslationCx( gc ); + + PtWidgetOffset( gui.vimTextArea, &gui_ph_raw_offset ); + PhTranslatePoint( &gui_ph_raw_offset, PtWidgetPos( gui.vimTextArea, NULL ) ); +*************** +*** 2970,2976 **** + if( vim_font_name == NULL ) + { + /* Default font */ +! vim_font_name = "PC Term"; + } + + if( STRCMP( vim_font_name, "*" ) == 0 ) +--- 2975,2981 ---- + if( vim_font_name == NULL ) + { + /* Default font */ +! vim_font_name = "PC Terminal"; + } + + if( STRCMP( vim_font_name, "*" ) == 0 ) +*** ../vim-7.2.218/src/version.c 2009-06-24 18:31:36.000000000 +0200 +--- src/version.c 2009-07-01 16:11:34.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 219, + /**/ + +-- +"Oh, no! NOT the Spanish Inquisition!" +"NOBODY expects the Spanish Inquisition!!!" + -- Monty Python sketch -- +"Oh, no! NOT another option!" +"EVERYBODY expects another option!!!" + -- Discussion in vim-dev mailing list -- + + /// 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 /// diff --git a/7.2.220 b/7.2.220 new file mode 100644 index 0000000..b3d63f3 --- /dev/null +++ b/7.2.220 @@ -0,0 +1,95 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.220 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.220 (after 7.2.215) +Problem: a BufEnter autocommand that changes directory causes problems. + (Ajit Thakkar) +Solution: Disable autocommands when opening a hidden buffer in a window. +Files: src/fileio.c + + +*** ../vim-7.2.219/src/fileio.c 2009-06-24 17:31:27.000000000 +0200 +--- src/fileio.c 2009-07-01 17:02:46.000000000 +0200 +*************** +*** 8441,8453 **** + win_init_empty(aucmd_win); /* set cursor and topline to safe values */ + + #ifdef FEAT_WINDOWS +! /* Split the current window, put the aucmd_win in the upper half. */ + make_snapshot(SNAP_AUCMD_IDX); + save_ea = p_ea; + p_ea = FALSE; + (void)win_split_ins(0, WSP_TOP, aucmd_win, 0); + (void)win_comp_pos(); /* recompute window positions */ + p_ea = save_ea; + #endif + curwin = aucmd_win; + } +--- 8441,8456 ---- + win_init_empty(aucmd_win); /* set cursor and topline to safe values */ + + #ifdef FEAT_WINDOWS +! /* Split the current window, put the aucmd_win in the upper half. +! * We don't want the BufEnter or WinEnter autocommands. */ +! block_autocmds(); + make_snapshot(SNAP_AUCMD_IDX); + save_ea = p_ea; + p_ea = FALSE; + (void)win_split_ins(0, WSP_TOP, aucmd_win, 0); + (void)win_comp_pos(); /* recompute window positions */ + p_ea = save_ea; ++ unblock_autocmds(); + #endif + curwin = aucmd_win; + } +*************** +*** 8474,8480 **** + --curbuf->b_nwindows; + #ifdef FEAT_WINDOWS + /* Find "aucmd_win", it can't be closed, but it may be in another tab +! * page. */ + if (curwin != aucmd_win) + { + tabpage_T *tp; +--- 8477,8484 ---- + --curbuf->b_nwindows; + #ifdef FEAT_WINDOWS + /* Find "aucmd_win", it can't be closed, but it may be in another tab +! * page. Do not trigger autocommands here. */ +! block_autocmds(); + if (curwin != aucmd_win) + { + tabpage_T *tp; +*************** +*** 8498,8503 **** +--- 8502,8508 ---- + last_status(FALSE); /* may need to remove last status line */ + restore_snapshot(SNAP_AUCMD_IDX, FALSE); + (void)win_comp_pos(); /* recompute window positions */ ++ unblock_autocmds(); + + if (win_valid(aco->save_curwin)) + curwin = aco->save_curwin; +*** ../vim-7.2.219/src/version.c 2009-07-01 16:12:54.000000000 +0200 +--- src/version.c 2009-07-01 17:10:22.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 220, + /**/ + +-- +Microsoft is to software what McDonalds is to gourmet cooking + + /// 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 /// diff --git a/7.2.221 b/7.2.221 new file mode 100644 index 0000000..3c6180e --- /dev/null +++ b/7.2.221 @@ -0,0 +1,247 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.221 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.221 +Problem: X cut_buffer0 text is used as-is, it may be in the wrong encoding. +Solution: Convert between 'enc' and latin1. (James Vega) +Files: src/gui_gtk_x11.c, src/message.c, src/ops.c, src/proto/ui.pro, + src/ui.c + + +*** ../vim-7.2.220/src/gui_gtk_x11.c 2009-06-16 15:23:07.000000000 +0200 +--- src/gui_gtk_x11.c 2009-07-01 11:55:34.000000000 +0200 +*************** +*** 6717,6724 **** + { + GdkAtom target; + unsigned i; +- int nbytes; +- char_u *buffer; + time_t start; + + for (i = 0; i < N_SELECTION_TARGETS; ++i) +--- 6717,6722 ---- +*************** +*** 6746,6767 **** + } + + /* Final fallback position - use the X CUT_BUFFER0 store */ +! nbytes = 0; +! buffer = (char_u *)XFetchBuffer(GDK_WINDOW_XDISPLAY(gui.mainwin->window), +! &nbytes, 0); +! if (nbytes > 0) +! { +! /* Got something */ +! clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); +! if (p_verbose > 0) +! { +! verbose_enter(); +! smsg((char_u *)_("Used CUT_BUFFER0 instead of empty selection")); +! verbose_leave(); +! } +! } +! if (buffer != NULL) +! XFree(buffer); + } + + /* +--- 6744,6750 ---- + } + + /* Final fallback position - use the X CUT_BUFFER0 store */ +! yank_cut_buffer0(GDK_WINDOW_XDISPLAY(gui.mainwin->window), cbd); + } + + /* +*** ../vim-7.2.220/src/message.c 2009-05-17 13:30:58.000000000 +0200 +--- src/message.c 2009-07-01 16:43:08.000000000 +0200 +*************** +*** 107,113 **** + } + + #if defined(FEAT_EVAL) || defined(FEAT_X11) || defined(USE_XSMP) \ +! || defined(PROTO) + /* + * Like msg() but keep it silent when 'verbosefile' is set. + */ +--- 107,113 ---- + } + + #if defined(FEAT_EVAL) || defined(FEAT_X11) || defined(USE_XSMP) \ +! || defined(FEAT_GUI_GTK) || defined(PROTO) + /* + * Like msg() but keep it silent when 'verbosefile' is set. + */ +*** ../vim-7.2.220/src/ops.c 2009-05-26 18:12:13.000000000 +0200 +--- src/ops.c 2009-07-01 12:15:31.000000000 +0200 +*************** +*** 5591,5596 **** +--- 5591,5619 ---- + if (dpy != NULL && str != NULL && motion_type >= 0 + && len < 1024*1024 && len > 0) + { ++ #ifdef FEAT_MBYTE ++ /* The CUT_BUFFER0 is supposed to always contain latin1. Convert from ++ * 'enc' when it is a multi-byte encoding. When 'enc' is an 8-bit ++ * encoding conversion usually doesn't work, so keep the text as-is. ++ */ ++ if (has_mbyte) ++ { ++ char_u *conv_str = str; ++ vimconv_T vc; ++ ++ vc.vc_type = CONV_NONE; ++ if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) ++ { ++ conv_str = string_convert(&vc, str, (int*)&len); ++ if (conv_str != NULL) ++ { ++ vim_free(str); ++ str = conv_str; ++ } ++ convert_setup(&vc, NULL, NULL); ++ } ++ } ++ #endif + XStoreBuffer(dpy, (char *)str, (int)len, 0); + XFlush(dpy); + } +*** ../vim-7.2.220/src/proto/ui.pro 2007-05-05 19:58:49.000000000 +0200 +--- src/proto/ui.pro 2009-07-01 11:48:11.000000000 +0200 +*************** +*** 48,53 **** +--- 48,54 ---- + void open_app_context __ARGS((void)); + void x11_setup_atoms __ARGS((Display *dpy)); + void clip_x11_request_selection __ARGS((Widget myShell, Display *dpy, VimClipboard *cbd)); ++ void yank_cut_buffer0 __ARGS((Display *dpy, VimClipboard *cbd)); + void clip_x11_lose_selection __ARGS((Widget myShell, VimClipboard *cbd)); + int clip_x11_own_selection __ARGS((Widget myShell, VimClipboard *cbd)); + void clip_x11_set_selection __ARGS((VimClipboard *cbd)); +*** ../vim-7.2.220/src/ui.c 2009-05-17 13:30:58.000000000 +0200 +--- src/ui.c 2009-07-01 15:44:07.000000000 +0200 +*************** +*** 2104,2111 **** + Atom type; + static int success; + int i; +- int nbytes = 0; +- char_u *buffer; + time_t start_time; + int timed_out = FALSE; + +--- 2104,2109 ---- +*************** +*** 2185,2199 **** + } + + /* Final fallback position - use the X CUT_BUFFER0 store */ +! buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); +! if (nbytes > 0) +! { +! /* Got something */ +! clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); +! XFree((void *)buffer); +! if (p_verbose > 0) +! verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection")); +! } + } + + static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *)); +--- 2183,2189 ---- + } + + /* Final fallback position - use the X CUT_BUFFER0 store */ +! yank_cut_buffer0(dpy, cbd); + } + + static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *)); +*************** +*** 2369,2374 **** +--- 2359,2418 ---- + } + #endif + ++ #if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \ ++ || defined(FEAT_GUI_GTK) || defined(PROTO) ++ /* ++ * Get the contents of the X CUT_BUFFER0 and put it in "cbd". ++ */ ++ void ++ yank_cut_buffer0(dpy, cbd) ++ Display *dpy; ++ VimClipboard *cbd; ++ { ++ int nbytes = 0; ++ char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); ++ ++ if (nbytes > 0) ++ { ++ #ifdef FEAT_MBYTE ++ int done = FALSE; ++ ++ /* CUT_BUFFER0 is supposed to be always latin1. Convert to 'enc' when ++ * using a multi-byte encoding. Conversion between two 8-bit ++ * character sets usually fails and the text might actually be in ++ * 'enc' anyway. */ ++ if (has_mbyte) ++ { ++ char_u *conv_buf = buffer; ++ vimconv_T vc; ++ ++ vc.vc_type = CONV_NONE; ++ if (convert_setup(&vc, (char_u *)"latin1", p_enc) == OK) ++ { ++ conv_buf = string_convert(&vc, buffer, &nbytes); ++ if (conv_buf != NULL) ++ { ++ clip_yank_selection(MCHAR, conv_buf, (long)nbytes, cbd); ++ vim_free(conv_buf); ++ done = TRUE; ++ } ++ convert_setup(&vc, NULL, NULL); ++ } ++ } ++ if (!done) /* use the text without conversion */ ++ #endif ++ clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); ++ XFree((void *)buffer); ++ if (p_verbose > 0) ++ { ++ verbose_enter(); ++ verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection")); ++ verbose_leave(); ++ } ++ } ++ } ++ #endif ++ + #if defined(FEAT_MOUSE) || defined(PROTO) + + /* +*** ../vim-7.2.220/src/version.c 2009-07-01 17:11:40.000000000 +0200 +--- src/version.c 2009-07-01 17:56:02.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 221, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +40. You tell the cab driver you live at + http://123.elm.street/house/bluetrim.html +41. You actually try that 123.elm.street 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 /// diff --git a/7.2.222 b/7.2.222 new file mode 100644 index 0000000..dcf0b36 --- /dev/null +++ b/7.2.222 @@ -0,0 +1,59 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.222 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.222 +Problem: ":mksession" doesn't work properly with 'acd' set. +Solution: Make it work. (Yakov Lerner) +Files: src/ex_docmd.c + + +*** ../vim-7.2.221/src/ex_docmd.c 2009-05-16 17:29:37.000000000 +0200 +--- src/ex_docmd.c 2009-07-01 20:18:22.000000000 +0200 +*************** +*** 8686,8691 **** +--- 8693,8700 ---- + } + + #ifdef FEAT_SESSION ++ /* Use the short file name until ":lcd" is used. We also don't use the ++ * short file name when 'acd' is set, that is checked later. */ + did_lcd = FALSE; + + /* ":mkview" or ":mkview 9": generate file name with 'viewdir' */ +*************** +*** 10573,10578 **** +--- 10582,10590 ---- + if (buf->b_sfname != NULL + && flagp == &ssop_flags + && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR)) ++ #ifdef FEAT_AUTOCHDIR ++ && !p_acd ++ #endif + && !did_lcd) + name = buf->b_sfname; + else +*** ../vim-7.2.221/src/version.c 2009-07-01 18:04:30.000000000 +0200 +--- src/version.c 2009-07-01 20:16:19.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 222, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +43. You tell the kids they can't use the computer because "Daddy's got work to + do" and you don't even have a job. + + /// 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 /// diff --git a/7.2.223 b/7.2.223 new file mode 100644 index 0000000..cac2126 --- /dev/null +++ b/7.2.223 @@ -0,0 +1,165 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.223 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.223 +Problem: When a script is run with ":silent" it is not able to give warning + messages. +Solution: Add the ":unsilent" command. +Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c + + +*** ../vim-7.2.222/runtime/doc/various.txt 2008-08-09 19:36:54.000000000 +0200 +--- runtime/doc/various.txt 2009-07-09 15:52:54.000000000 +0200 +*************** +*** 508,513 **** +--- 508,524 ---- + messages though. Use ":silent" in the command itself + to avoid that: ":silent menu .... :silent command". + ++ *:uns* *:unsilent* ++ :uns[ilent] {command} Execute {command} not silently. Only makes a ++ difference when |:silent| was used to get to this ++ command. ++ Use this for giving a message even when |:silent| was ++ used. In this example |:silent| is used to avoid the ++ message about reading the file and |:unsilent| to be ++ able to list the first line of each file. > ++ :silent argdo unsilent echo expand('%') . ": " . getline(1) ++ < ++ + *:verb* *:verbose* + :[count]verb[ose] {command} + Execute {command} with 'verbose' set to [count]. If +*** ../vim-7.2.222/src/ex_cmds.h 2008-11-09 13:43:25.000000000 +0100 +--- src/ex_cmds.h 2009-07-01 18:12:55.000000000 +0200 +*************** +*** 991,996 **** +--- 991,998 ---- + BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), + EX(CMD_unmenu, "unmenu", ex_menu, + BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), ++ EX(CMD_unsilent, "unsilent", ex_wrongmodifier, ++ NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN), + EX(CMD_update, "update", ex_update, + RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR), + EX(CMD_vglobal, "vglobal", ex_global, +*** ../vim-7.2.222/src/ex_docmd.c 2009-07-01 20:18:43.000000000 +0200 +--- src/ex_docmd.c 2009-07-09 15:24:03.000000000 +0200 +*************** +*** 1677,1684 **** + char_u *errormsg = NULL; /* error message */ + exarg_T ea; /* Ex command arguments */ + long verbose_save = -1; +! int save_msg_scroll = 0; +! int did_silent = 0; + int did_esilent = 0; + #ifdef HAVE_SANDBOX + int did_sandbox = FALSE; +--- 1677,1684 ---- + char_u *errormsg = NULL; /* error message */ + exarg_T ea; /* Ex command arguments */ + long verbose_save = -1; +! int save_msg_scroll = msg_scroll; +! int save_msg_silent = -1; + int did_esilent = 0; + #ifdef HAVE_SANDBOX + int did_sandbox = FALSE; +*************** +*** 1856,1864 **** + } + if (!checkforcmd(&ea.cmd, "silent", 3)) + break; +! ++did_silent; + ++msg_silent; +- save_msg_scroll = msg_scroll; + if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1])) + { + /* ":silent!", but not "silent !cmd" */ +--- 1856,1864 ---- + } + if (!checkforcmd(&ea.cmd, "silent", 3)) + break; +! if (save_msg_silent == -1) +! save_msg_silent = msg_silent; + ++msg_silent; + if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1])) + { + /* ":silent!", but not "silent !cmd" */ +*************** +*** 1886,1891 **** +--- 1886,1898 ---- + #endif + continue; + ++ case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3)) ++ break; ++ if (save_msg_silent == -1) ++ save_msg_silent = msg_silent; ++ msg_silent = 0; ++ continue; ++ + case 'v': if (checkforcmd(&ea.cmd, "vertical", 4)) + { + #ifdef FEAT_VERTSPLIT +*************** +*** 2684,2696 **** + + cmdmod = save_cmdmod; + +! if (did_silent > 0) + { + /* messages could be enabled for a serious error, need to check if the + * counters don't become negative */ +! msg_silent -= did_silent; +! if (msg_silent < 0) +! msg_silent = 0; + emsg_silent -= did_esilent; + if (emsg_silent < 0) + emsg_silent = 0; +--- 2691,2702 ---- + + cmdmod = save_cmdmod; + +! if (save_msg_silent != -1) + { + /* messages could be enabled for a serious error, need to check if the + * counters don't become negative */ +! if (!did_emsg) +! msg_silent = save_msg_silent; + emsg_silent -= did_esilent; + if (emsg_silent < 0) + emsg_silent = 0; +*************** +*** 2987,2992 **** +--- 2993,2999 ---- + {"silent", 3, FALSE}, + {"tab", 3, TRUE}, + {"topleft", 2, FALSE}, ++ {"unsilent", 3, FALSE}, + {"verbose", 4, TRUE}, + {"vertical", 4, FALSE}, + }; +*** ../vim-7.2.222/src/version.c 2009-07-01 20:18:43.000000000 +0200 +--- src/version.c 2009-07-09 15:53:05.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 223, + /**/ + +-- +Q: How many legs does a giraffe have? +A: Eight: two in front, two behind, two on the left and two on the right + + /// 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 /// diff --git a/7.2.224 b/7.2.224 new file mode 100644 index 0000000..d988eed --- /dev/null +++ b/7.2.224 @@ -0,0 +1,88 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.224 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.224 +Problem: Crash when using 'completefunc'. (Ingo Karkat) +Solution: Disallow entering edit() recursively when doing completion. +Files: src/edit.c + + +*** ../vim-7.2.223/src/edit.c 2009-05-26 11:01:43.000000000 +0200 +--- src/edit.c 2009-07-09 18:01:49.000000000 +0200 +*************** +*** 114,119 **** +--- 114,123 ---- + * FALSE the word to be completed must be located. */ + static int compl_started = FALSE; + ++ /* Set when doing something for completion that may call edit() recursively, ++ * which is not allowed. */ ++ static int compl_busy = FALSE; ++ + static int compl_matches = 0; + static char_u *compl_pattern = NULL; + static int compl_direction = FORWARD; +*************** +*** 346,352 **** + + #ifdef FEAT_INS_EXPAND + /* Don't allow recursive insert mode when busy with completion. */ +! if (compl_started || pum_visible()) + { + EMSG(_(e_secure)); + return FALSE; +--- 350,356 ---- + + #ifdef FEAT_INS_EXPAND + /* Don't allow recursive insert mode when busy with completion. */ +! if (compl_started || compl_busy || pum_visible()) + { + EMSG(_(e_secure)); + return FALSE; +*************** +*** 1340,1347 **** +--- 1344,1353 ---- + goto normalchar; + + docomplete: ++ compl_busy = TRUE; + if (ins_complete(c) == FAIL) + compl_cont_status = 0; ++ compl_busy = FALSE; + break; + #endif /* FEAT_INS_EXPAND */ + +*************** +*** 3172,3177 **** +--- 3178,3184 ---- + vim_free(match); + } while (compl_curr_match != NULL && compl_curr_match != compl_first_match); + compl_first_match = compl_curr_match = NULL; ++ compl_shown_match = NULL; + } + + static void +*** ../vim-7.2.223/src/version.c 2009-07-09 15:55:34.000000000 +0200 +--- src/version.c 2009-07-09 18:14:16.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 224, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +77. The phone company asks you to test drive their new PBX system + + /// 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 /// diff --git a/7.2.225 b/7.2.225 new file mode 100644 index 0000000..32a4d35 --- /dev/null +++ b/7.2.225 @@ -0,0 +1,97 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.225 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.225 +Problem: When using ":normal" a saved character may be executed. +Solution: Also store old_char when saving typeahead. +Files: src/getchar.c, src/structs.h + + +*** ../vim-7.2.224/src/getchar.c 2009-02-22 23:42:08.000000000 +0100 +--- src/getchar.c 2009-07-09 18:09:13.000000000 +0200 +*************** +*** 1309,1314 **** +--- 1309,1317 ---- + return OK; + } + ++ static int old_char = -1; /* character put back by vungetc() */ ++ static int old_mod_mask; /* mod_mask for ungotten character */ ++ + #if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO) + + /* +*************** +*** 1323,1328 **** +--- 1326,1335 ---- + if (!tp->typebuf_valid) + typebuf = tp->save_typebuf; + ++ tp->old_char = old_char; ++ tp->old_mod_mask = old_mod_mask; ++ old_char = -1; ++ + tp->save_stuffbuff = stuffbuff; + stuffbuff.bh_first.b_next = NULL; + # ifdef USE_INPUT_BUF +*************** +*** 1344,1349 **** +--- 1351,1359 ---- + typebuf = tp->save_typebuf; + } + ++ old_char = tp->old_char; ++ old_mod_mask = tp->old_mod_mask; ++ + free_buff(&stuffbuff); + stuffbuff = tp->save_stuffbuff; + # ifdef USE_INPUT_BUF +*************** +*** 1499,1507 **** + #define KL_PART_KEY -1 /* keylen value for incomplete key-code */ + #define KL_PART_MAP -2 /* keylen value for incomplete mapping */ + +- static int old_char = -1; /* character put back by vungetc() */ +- static int old_mod_mask; /* mod_mask for ungotten character */ +- + /* + * Get the next input character. + * Can return a special key or a multi-byte character. +--- 1509,1514 ---- +*** ../vim-7.2.224/src/structs.h 2009-06-16 16:01:34.000000000 +0200 +--- src/structs.h 2009-07-09 18:09:20.000000000 +0200 +*************** +*** 882,887 **** +--- 882,889 ---- + { + typebuf_T save_typebuf; + int typebuf_valid; /* TRUE when save_typebuf valid */ ++ int old_char; ++ int old_mod_mask; + struct buffheader save_stuffbuff; + #ifdef USE_INPUT_BUF + char_u *save_inputbuf; +*** ../vim-7.2.224/src/version.c 2009-07-09 18:15:19.000000000 +0200 +--- src/version.c 2009-07-09 18:21:56.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 225, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +78. You find yourself dialing IP numbers on the phone. + + /// 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 /// diff --git a/7.2.226 b/7.2.226 new file mode 100644 index 0000000..d922a08 --- /dev/null +++ b/7.2.226 @@ -0,0 +1,268 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.226 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.226 +Problem: ml_get error after deleting the last line. (Xavier de Gaye) +Solution: When adjusting marks a callback may be invoked. Adjust the cursor + position before invoking deleted_lines_mark(). +Files: src/ex_cmds.c, src/ex_docmd.c, src/if_mzsch.c, src/if_python.c, + src/if_perl.xs, src/misc1.c + + +*** ../vim-7.2.225/src/ex_cmds.c 2009-05-17 13:30:58.000000000 +0200 +--- src/ex_cmds.c 2009-07-09 12:56:51.000000000 +0200 +*************** +*** 4013,4018 **** +--- 4013,4021 ---- + break; + ml_delete(eap->line1, FALSE); + } ++ ++ /* make sure the cursor is not beyond the end of the file now */ ++ check_cursor_lnum(); + deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum)); + + /* ":append" on the line above the deleted lines. */ +*** ../vim-7.2.225/src/ex_docmd.c 2009-07-09 15:55:34.000000000 +0200 +--- src/ex_docmd.c 2009-07-09 15:24:03.000000000 +0200 +*************** +*** 7845,7854 **** + if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK) + { + ml_delete(lnum, FALSE); +- deleted_lines_mark(lnum, 1L); + if (curwin->w_cursor.lnum > 1 + && curwin->w_cursor.lnum >= lnum) + --curwin->w_cursor.lnum; + } + } + redraw_curbuf_later(VALID); +--- 7845,7854 ---- + if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK) + { + ml_delete(lnum, FALSE); + if (curwin->w_cursor.lnum > 1 + && curwin->w_cursor.lnum >= lnum) + --curwin->w_cursor.lnum; ++ deleted_lines_mark(lnum, 1L); + } + } + redraw_curbuf_later(VALID); +*** ../vim-7.2.225/src/if_mzsch.c 2009-06-24 17:51:01.000000000 +0200 +--- src/if_mzsch.c 2009-07-09 12:59:17.000000000 +0200 +*************** +*** 2169,2177 **** + curbuf = savebuf; + raise_vim_exn(_("cannot delete line")); + } +- deleted_lines_mark((linenr_T)n, 1L); + if (buf->buf == curwin->w_buffer) + mz_fix_cursor(n, n + 1, -1); + + curbuf = savebuf; + +--- 2169,2177 ---- + curbuf = savebuf; + raise_vim_exn(_("cannot delete line")); + } + if (buf->buf == curwin->w_buffer) + mz_fix_cursor(n, n + 1, -1); ++ deleted_lines_mark((linenr_T)n, 1L); + + curbuf = savebuf; + +*************** +*** 2299,2307 **** + curbuf = savebuf; + raise_vim_exn(_("cannot delete line")); + } +- deleted_lines_mark((linenr_T)lo, (long)old_len); + if (buf->buf == curwin->w_buffer) + mz_fix_cursor(lo, hi, -old_len); + } + + curbuf = savebuf; +--- 2299,2307 ---- + curbuf = savebuf; + raise_vim_exn(_("cannot delete line")); + } + if (buf->buf == curwin->w_buffer) + mz_fix_cursor(lo, hi, -old_len); ++ deleted_lines_mark((linenr_T)lo, (long)old_len); + } + + curbuf = savebuf; +*** ../vim-7.2.225/src/if_python.c 2009-05-21 23:25:38.000000000 +0200 +--- src/if_python.c 2009-07-09 12:59:45.000000000 +0200 +*************** +*** 2497,2505 **** + PyErr_SetVim(_("cannot delete line")); + else + { +- deleted_lines_mark((linenr_T)n, 1L); + if (buf == curwin->w_buffer) + py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1); + } + + curbuf = savebuf; +--- 2497,2505 ---- + PyErr_SetVim(_("cannot delete line")); + else + { + if (buf == curwin->w_buffer) + py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1); ++ deleted_lines_mark((linenr_T)n, 1L); + } + + curbuf = savebuf; +*************** +*** 2596,2605 **** + break; + } + } +- deleted_lines_mark((linenr_T)lo, (long)i); +- + if (buf == curwin->w_buffer) + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n); + } + + curbuf = savebuf; +--- 2596,2604 ---- + break; + } + } + if (buf == curwin->w_buffer) + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n); ++ deleted_lines_mark((linenr_T)lo, (long)i); + } + + curbuf = savebuf; +*** ../vim-7.2.225/src/if_perl.xs 2009-06-16 16:01:34.000000000 +0200 +--- src/if_perl.xs 2009-07-09 13:02:16.000000000 +0200 +*************** +*** 1233,1241 **** + if (u_savedel(lnum, 1) == OK) + { + ml_delete(lnum, 0); + deleted_lines_mark(lnum, 1L); +- if (aco.save_curbuf == curbuf) +- check_cursor(); + } + + /* restore curwin/curbuf and a few other things */ +--- 1235,1242 ---- + if (u_savedel(lnum, 1) == OK) + { + ml_delete(lnum, 0); ++ check_cursor(); + deleted_lines_mark(lnum, 1L); + } + + /* restore curwin/curbuf and a few other things */ +*** ../vim-7.2.225/src/misc1.c 2009-06-24 16:25:23.000000000 +0200 +--- src/misc1.c 2009-07-09 13:00:59.000000000 +0200 +*************** +*** 2345,2356 **** + int undo; /* if TRUE, prepare for undo */ + { + long n; + + if (nlines <= 0) + return; + + /* save the deleted lines for undo */ +! if (undo && u_savedel(curwin->w_cursor.lnum, nlines) == FAIL) + return; + + for (n = 0; n < nlines; ) +--- 2345,2357 ---- + int undo; /* if TRUE, prepare for undo */ + { + long n; ++ linenr_T first = curwin->w_cursor.lnum; + + if (nlines <= 0) + return; + + /* save the deleted lines for undo */ +! if (undo && u_savedel(first, nlines) == FAIL) + return; + + for (n = 0; n < nlines; ) +*************** +*** 2358,2375 **** + if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to delete */ + break; + +! ml_delete(curwin->w_cursor.lnum, TRUE); + ++n; + + /* If we delete the last line in the file, stop */ +! if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) + break; + } +- /* adjust marks, mark the buffer as changed and prepare for displaying */ +- deleted_lines_mark(curwin->w_cursor.lnum, n); + + curwin->w_cursor.col = 0; + check_cursor_lnum(); + } + + int +--- 2359,2379 ---- + if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to delete */ + break; + +! ml_delete(first, TRUE); + ++n; + + /* If we delete the last line in the file, stop */ +! if (first > curbuf->b_ml.ml_line_count) + break; + } + ++ /* Correct the cursor position before calling deleted_lines_mark(), it may ++ * trigger a callback to display the cursor. */ + curwin->w_cursor.col = 0; + check_cursor_lnum(); ++ ++ /* adjust marks, mark the buffer as changed and prepare for displaying */ ++ deleted_lines_mark(first, n); + } + + int +*************** +*** 2621,2626 **** +--- 2625,2632 ---- + + /* + * Like deleted_lines(), but adjust marks first. ++ * Make sure the cursor is on a valid line before calling, a GUI callback may ++ * be triggered to display the cursor. + */ + void + deleted_lines_mark(lnum, count) +*** ../vim-7.2.225/src/version.c 2009-07-09 18:24:24.000000000 +0200 +--- src/version.c 2009-07-09 20:01:16.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 226, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +80. At parties, you introduce your spouse as your "service provider." + + /// 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 /// diff --git a/7.2.227 b/7.2.227 new file mode 100644 index 0000000..8499212 --- /dev/null +++ b/7.2.227 @@ -0,0 +1,52 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.227 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.227 +Problem: When using ":cd" in a script there is no way to track this. +Solution: Display the directory when 'verbose' is 5 or higher. +Files: src/ex_docmd.c + + +*** ../vim-7.2.226/src/ex_docmd.c 2009-07-09 20:06:30.000000000 +0200 +--- src/ex_docmd.c 2009-07-09 15:24:03.000000000 +0200 +*************** +*** 7964,7970 **** + shorten_fnames(TRUE); + + /* Echo the new current directory if the command was typed. */ +! if (KeyTyped) + ex_pwd(eap); + } + vim_free(tofree); +--- 7964,7970 ---- + shorten_fnames(TRUE); + + /* Echo the new current directory if the command was typed. */ +! if (KeyTyped || p_verbose >= 5) + ex_pwd(eap); + } + vim_free(tofree); +*** ../vim-7.2.226/src/version.c 2009-07-09 20:06:30.000000000 +0200 +--- src/version.c 2009-07-09 20:13:13.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 227, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +83. Batteries in the TV remote now last for months. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.2.228 b/7.2.228 new file mode 100644 index 0000000..a906bef --- /dev/null +++ b/7.2.228 @@ -0,0 +1,573 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.228 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.228 +Problem: Cscope is limited to 8 connections. +Solution: Allocated the connection array to handle any number of + connections. (Dominique Pelle) +Files: runtime/doc/if_cscop.txt, src/if_cscope.h, src/if_cscope.c + + +*** ../vim-7.2.227/runtime/doc/if_cscop.txt 2009-03-18 14:30:46.000000000 +0100 +--- runtime/doc/if_cscop.txt 2009-07-09 15:40:48.000000000 +0200 +*************** +*** 355,367 **** + The DJGPP-built version from http://cscope.sourceforge.net is known to not + work with Vim. + +! There are a couple of hard-coded limitations: +! +! 1. The maximum number of cscope connections allowed is 8. Do you +! really need more? +! +! 2. Doing a |:tjump| when |:cstag| searches the tag files is not +! configurable (e.g., you can't do a tselect instead). + + ============================================================================== + 6. Suggested usage *cscope-suggestions* +--- 355,362 ---- + The DJGPP-built version from http://cscope.sourceforge.net is known to not + work with Vim. + +! Hard-coded limitation: doing a |:tjump| when |:cstag| searches the tag files +! is not configurable (e.g., you can't do a tselect instead). + + ============================================================================== + 6. Suggested usage *cscope-suggestions* +*** ../vim-7.2.227/src/if_cscope.h 2008-08-25 04:35:13.000000000 +0200 +--- src/if_cscope.h 2009-07-09 15:39:32.000000000 +0200 +*************** +*** 25,31 **** + + #define CSCOPE_SUCCESS 0 + #define CSCOPE_FAILURE -1 +- #define CSCOPE_MAX_CONNECTIONS 8 /* you actually need more? */ + + #define CSCOPE_DBFILE "cscope.out" + #define CSCOPE_PROMPT ">> " +--- 25,30 ---- +*** ../vim-7.2.227/src/if_cscope.c 2009-05-16 17:29:37.000000000 +0200 +--- src/if_cscope.c 2009-07-09 15:39:32.000000000 +0200 +*************** +*** 46,52 **** + static int cs_find __ARGS((exarg_T *eap)); + static int cs_find_common __ARGS((char *opt, char *pat, int, int, int)); + static int cs_help __ARGS((exarg_T *eap)); +- static void cs_init __ARGS((void)); + static void clear_csinfo __ARGS((int i)); + static int cs_insert_filelist __ARGS((char *, char *, char *, + struct stat *)); +--- 46,51 ---- +*************** +*** 66,72 **** + static int cs_show __ARGS((exarg_T *eap)); + + +! static csinfo_T csinfo[CSCOPE_MAX_CONNECTIONS]; + static int eap_arg_len; /* length of eap->arg, set in + cs_lookup_cmd() */ + static cscmd_T cs_cmds[] = +--- 65,74 ---- + static int cs_show __ARGS((exarg_T *eap)); + + +! static csinfo_T * csinfo = NULL; +! static int csinfo_size = 0; /* number of items allocated in +! csinfo[] */ +! + static int eap_arg_len; /* length of eap->arg, set in + cs_lookup_cmd() */ + static cscmd_T cs_cmds[] = +*************** +*** 144,166 **** + } + case EXP_CSCOPE_KILL: + { +! static char_u connection[2]; + + /* ":cscope kill" accepts connection numbers or partial names of + * the pathname of the cscope database as argument. Only complete + * with connection numbers. -1 can also be used to kill all + * connections. */ +! for (i = 0, current_idx = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (csinfo[i].fname == NULL) + continue; + if (current_idx++ == idx) + { +! /* Connection number fits in one character since +! * CSCOPE_MAX_CONNECTIONS is < 10 */ +! connection[0] = i + '0'; +! connection[1] = NUL; +! return connection; + } + } + return (current_idx == idx && idx > 0) ? (char_u *)"-1" : NULL; +--- 146,165 ---- + } + case EXP_CSCOPE_KILL: + { +! static char connection[5]; + + /* ":cscope kill" accepts connection numbers or partial names of + * the pathname of the cscope database as argument. Only complete + * with connection numbers. -1 can also be used to kill all + * connections. */ +! for (i = 0, current_idx = 0; i < csinfo_size; i++) + { + if (csinfo[i].fname == NULL) + continue; + if (current_idx++ == idx) + { +! vim_snprintf(connection, sizeof(connection), "%d", i); +! return (char_u *)connection; + } + } + return (current_idx == idx && idx > 0) ? (char_u *)"-1" : NULL; +*************** +*** 223,229 **** + { + cscmd_T *cmdp; + +- cs_init(); + if ((cmdp = cs_lookup_cmd(eap)) == NULL) + { + cs_help(eap); +--- 222,227 ---- +*************** +*** 284,291 **** + { + int ret = FALSE; + +- cs_init(); +- + if (*eap->arg == NUL) + { + (void)EMSG(_("E562: Usage: cstag ")); +--- 282,287 ---- +*************** +*** 441,447 **** + if (num < 0 || num > 4 || (num > 0 && !dbpath)) + return FALSE; + +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (!csinfo[i].fname) + continue; +--- 437,443 ---- + if (num < 0 || num > 4 || (num > 0 && !dbpath)) + return FALSE; + +! for (i = 0; i < csinfo_size; i++) + { + if (!csinfo[i].fname) + continue; +*************** +*** 684,690 **** + short i; + short cnt = 0; + +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (csinfo[i].fname != NULL) + cnt++; +--- 680,686 ---- + short i; + short cnt = 0; + +! for (i = 0; i < csinfo_size; i++) + { + if (csinfo[i].fname != NULL) + cnt++; +*************** +*** 1112,1118 **** + { + int i; + char *cmd; +! int nummatches[CSCOPE_MAX_CONNECTIONS], totmatches; + #ifdef FEAT_QUICKFIX + char cmdletter; + char *qfpos; +--- 1108,1115 ---- + { + int i; + char *cmd; +! int *nummatches; +! int totmatches; + #ifdef FEAT_QUICKFIX + char cmdletter; + char *qfpos; +*************** +*** 1123,1135 **** + if (cmd == NULL) + return FALSE; + + /* send query to all open connections, then count the total number + * of matches so we can alloc matchesp all in one swell foop + */ +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + nummatches[i] = 0; + totmatches = 0; +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL) + continue; +--- 1120,1136 ---- + if (cmd == NULL) + return FALSE; + ++ nummatches = (int *)alloc(sizeof(int)*csinfo_size); ++ if (nummatches == NULL) ++ return FALSE; ++ + /* send query to all open connections, then count the total number + * of matches so we can alloc matchesp all in one swell foop + */ +! for (i = 0; i < csinfo_size; i++) + nummatches[i] = 0; + totmatches = 0; +! for (i = 0; i < csinfo_size; i++) + { + if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL) + continue; +*************** +*** 1154,1160 **** +--- 1155,1164 ---- + char *buf; + + if (!verbose) ++ { ++ vim_free(nummatches); + return FALSE; ++ } + + buf = (char *)alloc((unsigned)(strlen(opt) + strlen(pat) + strlen(nf))); + if (buf == NULL) +*************** +*** 1165,1170 **** +--- 1169,1175 ---- + (void)EMSG(buf); + vim_free(buf); + } ++ vim_free(nummatches); + return FALSE; + } + +*************** +*** 1217,1222 **** +--- 1222,1228 ---- + (void)EMSG(buf); + vim_free(buf); + } ++ vim_free(nummatches); + return FALSE; + } + } +*************** +*** 1264,1269 **** +--- 1270,1276 ---- + } + mch_remove(tmp); + vim_free(tmp); ++ vim_free(nummatches); + return TRUE; + } + else +*************** +*** 1275,1280 **** +--- 1282,1288 ---- + /* read output */ + cs_fill_results((char *)pat, totmatches, nummatches, &matches, + &contexts, &matched); ++ vim_free(nummatches); + if (matches == NULL) + return FALSE; + +*************** +*** 1328,1353 **** + } /* cs_help */ + + +- /* +- * PRIVATE: cs_init +- * +- * initialize cscope structure if not already +- */ +- static void +- cs_init() +- { +- short i; +- static int init_already = FALSE; +- +- if (init_already) +- return; +- +- for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) +- clear_csinfo(i); +- +- init_already = TRUE; +- } /* cs_init */ +- + static void + clear_csinfo(i) + int i; +--- 1336,1341 ---- +*************** +*** 1444,1450 **** + #endif + + i = -1; /* can be set to the index of an empty item in csinfo */ +! for (j = 0; j < CSCOPE_MAX_CONNECTIONS; j++) + { + if (csinfo[j].fname != NULL + #if defined(UNIX) +--- 1432,1438 ---- + #endif + + i = -1; /* can be set to the index of an empty item in csinfo */ +! for (j = 0; j < csinfo_size; j++) + { + if (csinfo[j].fname != NULL + #if defined(UNIX) +*************** +*** 1471,1479 **** + + if (i == -1) + { +! if (p_csverbose) +! (void)EMSG(_("E569: maximum number of cscope connections reached")); +! return -1; + } + + if ((csinfo[i].fname = (char *)alloc((unsigned)strlen(fname)+1)) == NULL) +--- 1459,1483 ---- + + if (i == -1) + { +! i = csinfo_size; +! if (csinfo_size == 0) +! { +! /* First time allocation: allocate only 1 connection. It should +! * be enough for most users. If more is needed, csinfo will be +! * reallocated. */ +! csinfo_size = 1; +! csinfo = (csinfo_T *)alloc_clear(sizeof(csinfo_T)); +! } +! else +! { +! /* Reallocate space for more connections. */ +! csinfo_size *= 2; +! csinfo = vim_realloc(csinfo, sizeof(csinfo_T)*csinfo_size); +! } +! if (csinfo == NULL) +! return -1; +! for (j = csinfo_size/2; j < csinfo_size; j++) +! clear_csinfo(j); + } + + if ((csinfo[i].fname = (char *)alloc((unsigned)strlen(fname)+1)) == NULL) +*************** +*** 1580,1594 **** + /* It must be part of a name. We will try to find a match + * within all the names in the csinfo data structure + */ +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok)) + break; + } + } + +! if ((i >= CSCOPE_MAX_CONNECTIONS || i < -1 || csinfo[i].fname == NULL) +! && i != -1) + { + if (p_csverbose) + (void)EMSG2(_("E261: cscope connection %s not found"), stok); +--- 1584,1597 ---- + /* It must be part of a name. We will try to find a match + * within all the names in the csinfo data structure + */ +! for (i = 0; i < csinfo_size; i++) + { + if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok)) + break; + } + } + +! if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL)) + { + if (p_csverbose) + (void)EMSG2(_("E261: cscope connection %s not found"), stok); +*************** +*** 1597,1603 **** + { + if (i == -1) + { +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (csinfo[i].fname) + cs_kill_execute(i, csinfo[i].fname); +--- 1600,1606 ---- + { + if (i == -1) + { +! for (i = 0; i < csinfo_size; i++) + { + if (csinfo[i].fname) + cs_kill_execute(i, csinfo[i].fname); +*************** +*** 1857,1863 **** + if (buf == NULL) + return; + +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (nummatches_a[i] < 1) + continue; +--- 1860,1866 ---- + if (buf == NULL) + return; + +! for (i = 0; i < csinfo_size; i++) + { + if (nummatches_a[i] < 1) + continue; +*************** +*** 1929,1935 **** + if ((cntxts = (char **)alloc(sizeof(char *) * totmatches)) == NULL) + goto parse_out; + +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (nummatches_a[i] < 1) + continue; +--- 1932,1938 ---- + if ((cntxts = (char **)alloc(sizeof(char *) * totmatches)) == NULL) + goto parse_out; + +! for (i = 0; i < csinfo_size; i++) + { + if (nummatches_a[i] < 1) + continue; +*************** +*** 2383,2392 **** + int i; + char buf[20]; /* for sprintf " (#%d)" */ + + /* malloc our db and ppath list */ +! dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); +! pplist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); +! fllist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); + if (dblist == NULL || pplist == NULL || fllist == NULL) + { + vim_free(dblist); +--- 2386,2398 ---- + int i; + char buf[20]; /* for sprintf " (#%d)" */ + ++ if (csinfo_size == 0) ++ return CSCOPE_SUCCESS; ++ + /* malloc our db and ppath list */ +! dblist = (char **)alloc(csinfo_size * sizeof(char *)); +! pplist = (char **)alloc(csinfo_size * sizeof(char *)); +! fllist = (char **)alloc(csinfo_size * sizeof(char *)); + if (dblist == NULL || pplist == NULL || fllist == NULL) + { + vim_free(dblist); +*************** +*** 2395,2401 **** + return CSCOPE_FAILURE; + } + +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + dblist[i] = csinfo[i].fname; + pplist[i] = csinfo[i].ppath; +--- 2401,2407 ---- + return CSCOPE_FAILURE; + } + +! for (i = 0; i < csinfo_size; i++) + { + dblist[i] = csinfo[i].fname; + pplist[i] = csinfo[i].ppath; +*************** +*** 2405,2411 **** + } + + /* rebuild the cscope connection list */ +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (dblist[i] != NULL) + { +--- 2411,2417 ---- + } + + /* rebuild the cscope connection list */ +! for (i = 0; i < csinfo_size; i++) + { + if (dblist[i] != NULL) + { +*************** +*** 2502,2508 **** + MSG_PUTS_ATTR( + _(" # pid database name prepend path\n"), + hl_attr(HLF_T)); +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + { + if (csinfo[i].fname == NULL) + continue; +--- 2508,2514 ---- + MSG_PUTS_ATTR( + _(" # pid database name prepend path\n"), + hl_attr(HLF_T)); +! for (i = 0; i < csinfo_size; i++) + { + if (csinfo[i].fname == NULL) + continue; +*************** +*** 2531,2538 **** + { + int i; + +! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) + cs_release_csp(i, TRUE); + } + + #endif /* FEAT_CSCOPE */ +--- 2537,2546 ---- + { + int i; + +! for (i = 0; i < csinfo_size; i++) + cs_release_csp(i, TRUE); ++ vim_free(csinfo); ++ csinfo_size = 0; + } + + #endif /* FEAT_CSCOPE */ +*** ../vim-7.2.227/src/version.c 2009-07-09 20:13:59.000000000 +0200 +--- src/version.c 2009-07-09 21:21:48.000000000 +0200 +*************** +*** 678,679 **** +--- 678,681 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 228, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +84. Books in your bookcase bear the names Bongo, WinSock and Inside OLE + + /// 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 /// -- 2.44.0