From 626995c3e8e30a9168c1d7cb95276e9059f1a5d3 Mon Sep 17 00:00:00 2001 From: vimboss Date: Sun, 15 Jun 2008 12:21:50 +0000 Subject: [PATCH 01/16] updated for version 7.1-315 --- src/regexp.c | 48 ++++++++++++++++++++++++++++++------------------ src/version.c | 2 ++ 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/regexp.c b/src/regexp.c index 97181b8620..6347eeda99 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -3044,6 +3044,7 @@ typedef struct regbehind_S { regsave_T save_after; regsave_T save_behind; + int save_need_clear_subexpr; save_se_T save_start[NSUBEXP]; save_se_T save_end[NSUBEXP]; } regbehind_T; @@ -5858,17 +5859,23 @@ save_subexpr(bp) { int i; - for (i = 0; i < NSUBEXP; ++i) + /* When "need_clear_subexpr" is set we don't need to save the values, only + * remember that this flag needs to be set again when restoring. */ + bp->save_need_clear_subexpr = need_clear_subexpr; + if (!need_clear_subexpr) { - if (REG_MULTI) + for (i = 0; i < NSUBEXP; ++i) { - bp->save_start[i].se_u.pos = reg_startpos[i]; - bp->save_end[i].se_u.pos = reg_endpos[i]; - } - else - { - bp->save_start[i].se_u.ptr = reg_startp[i]; - bp->save_end[i].se_u.ptr = reg_endp[i]; + if (REG_MULTI) + { + bp->save_start[i].se_u.pos = reg_startpos[i]; + bp->save_end[i].se_u.pos = reg_endpos[i]; + } + else + { + bp->save_start[i].se_u.ptr = reg_startp[i]; + bp->save_end[i].se_u.ptr = reg_endp[i]; + } } } } @@ -5882,17 +5889,22 @@ restore_subexpr(bp) { int i; - for (i = 0; i < NSUBEXP; ++i) + /* Only need to restore saved values when they are not to be cleared. */ + need_clear_subexpr = bp->save_need_clear_subexpr; + if (!need_clear_subexpr) { - if (REG_MULTI) + for (i = 0; i < NSUBEXP; ++i) { - reg_startpos[i] = bp->save_start[i].se_u.pos; - reg_endpos[i] = bp->save_end[i].se_u.pos; - } - else - { - reg_startp[i] = bp->save_start[i].se_u.ptr; - reg_endp[i] = bp->save_end[i].se_u.ptr; + if (REG_MULTI) + { + reg_startpos[i] = bp->save_start[i].se_u.pos; + reg_endpos[i] = bp->save_end[i].se_u.pos; + } + else + { + reg_startp[i] = bp->save_start[i].se_u.ptr; + reg_endp[i] = bp->save_end[i].se_u.ptr; + } } } } diff --git a/src/version.c b/src/version.c index 61a8944f8c..aa283c4fc0 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 315, /**/ 314, /**/ From ee9959e56ceb9dde33014d822c76bf7c99d882f7 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 09:11:34 +0000 Subject: [PATCH 02/16] updated for version 7.1-316 --- src/ex_docmd.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 71a7b1bb9c..701354ee07 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -9300,7 +9300,7 @@ ex_tag_cmd(eap, name) break; default: /* ":tag" */ #ifdef FEAT_CSCOPE - if (p_cst) + if (p_cst && *eap->arg != NUL) { do_cstag(eap); return; diff --git a/src/version.c b/src/version.c index aa283c4fc0..fbde4b4692 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 316, /**/ 315, /**/ From 2d36c33fd516395a7598c0b869b23a2353c62f31 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 09:40:11 +0000 Subject: [PATCH 03/16] updated for version 7.1-317 --- src/gui_motif.c | 20 ++++++++++---------- src/testdir/test65.in | 0 src/testdir/test65.ok | 0 src/version.c | 2 ++ 4 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 src/testdir/test65.in create mode 100644 src/testdir/test65.ok diff --git a/src/gui_motif.c b/src/gui_motif.c index 6060b585c9..8285b16741 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -686,8 +686,8 @@ manage_centered(dialog_child) /* Temporarily set value of XmNmappedWhenManaged to stop the dialog from popping up right away */ - XtVaGetValues(shell, XmNmappedWhenManaged, &mappedWhenManaged, 0); - XtVaSetValues(shell, XmNmappedWhenManaged, False, 0); + XtVaGetValues(shell, XmNmappedWhenManaged, &mappedWhenManaged, NULL); + XtVaSetValues(shell, XmNmappedWhenManaged, False, NULL); XtManageChild(dialog_child); @@ -723,7 +723,7 @@ manage_centered(dialog_child) XtMapWidget(shell); /* Restore the value of XmNmappedWhenManaged */ - XtVaSetValues(shell, XmNmappedWhenManaged, mappedWhenManaged, 0); + XtVaSetValues(shell, XmNmappedWhenManaged, mappedWhenManaged, NULL); } #if defined(FEAT_MENU) || defined(FEAT_SUN_WORKSHOP) \ @@ -1993,7 +1993,7 @@ do_mnemonic(Widget w, unsigned int keycode) { if (XtClass(w) == xmRowColumnWidgetClass) { - XtVaGetValues(w, XmNrowColumnType, &rowColType, 0); + XtVaGetValues(w, XmNrowColumnType, &rowColType, NULL); isMenu = (rowColType != (unsigned char)XmWORK_AREA); } else @@ -2001,14 +2001,14 @@ do_mnemonic(Widget w, unsigned int keycode) if (!isMenu) { XtVaGetValues(w, XmNchildren, &children, XmNnumChildren, - &numChildren, 0); + &numChildren, NULL); for (i = 0; i < numChildren; i++) do_mnemonic(children[i], keycode); } } else { - XtVaGetValues(w, XmNmnemonic, &mnemonic, 0); + XtVaGetValues(w, XmNmnemonic, &mnemonic, NULL); if (mnemonic != '\0') { mneString[0] = mnemonic; @@ -2019,7 +2019,7 @@ do_mnemonic(Widget w, unsigned int keycode) if (XtClass(w) == xmLabelWidgetClass || XtClass(w) == xmLabelGadgetClass) { - XtVaGetValues(w, XmNuserData, &userData, 0); + XtVaGetValues(w, XmNuserData, &userData, NULL); if (userData != NULL && XtIsWidget(userData)) XmProcessTraversal(userData, XmTRAVERSE_CURRENT); } @@ -2073,7 +2073,7 @@ add_mnemonic_grabs(Widget dialog, Widget w) { if (XtClass(w) == xmRowColumnWidgetClass) { - XtVaGetValues(w, XmNrowColumnType, &rowColType, 0); + XtVaGetValues(w, XmNrowColumnType, &rowColType, NULL); isMenu = (rowColType != (unsigned char)XmWORK_AREA); } else @@ -2081,14 +2081,14 @@ add_mnemonic_grabs(Widget dialog, Widget w) if (!isMenu) { XtVaGetValues(w, XmNchildren, &children, XmNnumChildren, - &numChildren, 0); + &numChildren, NULL); for (i = 0; i < numChildren; i++) add_mnemonic_grabs(dialog, children[i]); } } else { - XtVaGetValues(w, XmNmnemonic, &mnemonic, 0); + XtVaGetValues(w, XmNmnemonic, &mnemonic, NULL); if (mnemonic != '\0') { mneString[0] = mnemonic; diff --git a/src/testdir/test65.in b/src/testdir/test65.in new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/testdir/test65.ok b/src/testdir/test65.ok new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/version.c b/src/version.c index fbde4b4692..508d8478d8 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 317, /**/ 316, /**/ From 67d03b985b4edd064d56b72f6073e25e0b8cabd1 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 09:59:25 +0000 Subject: [PATCH 04/16] updated for version 7.1-318 --- src/gui_x11.c | 3 +++ src/os_unix.c | 30 ++++++++++++++++++++++-------- src/version.c | 2 ++ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/gui_x11.c b/src/gui_x11.c index 3f2a256756..2842fa092b 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -1538,8 +1538,11 @@ gui_mch_init() attr.depth = DefaultDepthOfScreen(scr); if (!icon) + { XpmCreatePixmapFromData(dsp, root_window, magick, &icon, &icon_mask, &attr); + XpmFreeAttributes(&attr); + } # ifdef FEAT_GUI_ATHENA XtVaSetValues(vimShell, XtNiconPixmap, icon, XtNiconMask, icon_mask, NULL); diff --git a/src/os_unix.c b/src/os_unix.c index b9bab94785..7bad7e9d41 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -209,6 +209,7 @@ typedef struct { SmcConn smcconn; /* The SM connection ID */ IceConn iceconn; /* The ICE connection ID */ + char *clientid; /* The client ID for the current smc session */ Bool save_yourself; /* If we're in the middle of a save_yourself */ Bool shutdown; /* If we're in shutdown mode */ } xsmp_config_T; @@ -2887,16 +2888,28 @@ mch_free_mem() if (clip_plus.owned) clip_lose_selection(&clip_plus); # endif -# if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) || defined(PROTO) +# if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) if (xterm_Shell != (Widget)0) XtDestroyWidget(xterm_Shell); +# ifndef LESSTIF_VERSION + /* Lesstif crashes here, lose some memory */ if (xterm_dpy != NULL) XtCloseDisplay(xterm_dpy); if (app_context != (XtAppContext)NULL) + { XtDestroyApplicationContext(app_context); +# ifdef FEAT_X11 + x11_display = NULL; /* freed by XtDestroyApplicationContext() */ +# endif + } +# endif # endif # ifdef FEAT_X11 - if (x11_display != NULL && x11_display != xterm_dpy) + if (x11_display != NULL +# ifdef FEAT_XCLIPBOARD + && x11_display != xterm_dpy +# endif + ) XCloseDisplay(x11_display); # endif # if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK) @@ -6290,22 +6303,22 @@ clear_xterm_clip() } if (xterm_dpy != NULL) { -#if 0 +# if 0 /* Lesstif and Solaris crash here, lose some memory */ XtCloseDisplay(xterm_dpy); -#endif +# endif if (x11_display == xterm_dpy) x11_display = NULL; xterm_dpy = NULL; } -#if 0 +# if 0 if (app_context != (XtAppContext)NULL) { /* Lesstif and Solaris crash here, lose some memory */ XtDestroyApplicationContext(app_context); app_context = (XtAppContext)NULL; } -#endif +# endif } # endif @@ -6557,7 +6570,6 @@ static int dummy; xsmp_init(void) { char errorstring[80]; - char *clientid; SmcCallbacks smcallbacks; #if 0 SmPropValue smname; @@ -6599,7 +6611,7 @@ xsmp_init(void) | SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask, &smcallbacks, NULL, - &clientid, + &xsmp.clientid, sizeof(errorstring), errorstring); if (xsmp.smcconn == NULL) @@ -6638,6 +6650,8 @@ xsmp_close() if (xsmp_icefd != -1) { SmcCloseConnection(xsmp.smcconn, 0, NULL); + vim_free(xsmp.clientid); + xsmp.clientid = NULL; xsmp_icefd = -1; } } diff --git a/src/version.c b/src/version.c index 508d8478d8..cf910b97b0 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 318, /**/ 317, /**/ From bca5b2086eee9f4e8a02b9059d75b7cc4ea9ff00 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 10:56:16 +0000 Subject: [PATCH 05/16] updated for version 7.1-319 --- src/ex_getln.c | 5 +---- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index 928fe2075a..dabd65d143 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -3032,10 +3032,7 @@ cmdline_paste_str(s, literally) ++s; #ifdef FEAT_MBYTE if (has_mbyte) - { - c = mb_ptr2char(s); - s += mb_char2len(c); - } + c = mb_cptr2char_adv(&s); else #endif c = *s++; diff --git a/src/version.c b/src/version.c index cf910b97b0..5a3f014bdc 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 319, /**/ 318, /**/ From 82038bc905c3270ff9337417a09498c9dffb5c10 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 14:32:41 +0000 Subject: [PATCH 06/16] updated for version 7.1-320 --- src/if_python.c | 174 ++++++++++++++++++++++++++---------------------- src/version.c | 20 ++++-- 2 files changed, 106 insertions(+), 88 deletions(-) diff --git a/src/if_python.c b/src/if_python.c index 09510d538f..8fcb109302 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -50,11 +50,11 @@ #if !defined(FEAT_PYTHON) && defined(PROTO) /* Use this to be able to generate prototypes without python being used. */ -# define PyObject int -# define PyThreadState int -# define PyTypeObject int -struct PyMethodDef { int a; }; -# define PySequenceMethods int +# define PyObject Py_ssize_t +# define PyThreadState Py_ssize_t +# define PyTypeObject Py_ssize_t +struct PyMethodDef { Py_ssize_t a; }; +# define PySequenceMethods Py_ssize_t #endif #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 @@ -64,6 +64,7 @@ struct PyMethodDef { int a; }; # define PyIntIntArgFunc ssizessizeargfunc # define PyIntObjArgProc ssizeobjargproc # define PyIntIntObjArgProc ssizessizeobjargproc +# define Py_ssize_t_fmt "n" #else # define PyInt int # define PyInquiry inquiry @@ -71,6 +72,7 @@ struct PyMethodDef { int a; }; # define PyIntIntArgFunc intintargfunc # define PyIntObjArgProc intobjargproc # define PyIntIntObjArgProc intintobjargproc +# define Py_ssize_t_fmt "i" #endif /* Parser flags */ @@ -85,9 +87,18 @@ struct PyMethodDef { int a; }; #if defined(DYNAMIC_PYTHON) || defined(PROTO) # ifndef DYNAMIC_PYTHON -# define HINSTANCE int /* for generating prototypes */ +# define HINSTANCE long_u /* for generating prototypes */ # endif +/* This makes if_python.c compile without warnings against Python 2.5 + * on Win32 and Win64. */ +#undef PyRun_SimpleString +#undef PyArg_Parse +#undef PyArg_ParseTuple +#undef Py_BuildValue +#undef Py_InitModule4 +#undef Py_InitModule4_64 + /* * Wrapper defines */ @@ -269,7 +280,11 @@ static struct {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type}, {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue}, {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod}, +# if (PY_VERSION_HEX >= 0x02050000) && SIZEOF_SIZE_T != SIZEOF_INT + {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4}, +# else {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4}, +# endif {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize}, {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize}, {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized}, @@ -339,8 +354,7 @@ python_runtime_link_init(char *libname, int verbose) * TRUE, else FALSE. */ int -python_enabled(verbose) - int verbose; +python_enabled(int verbose) { return python_runtime_link_init(DYNAMIC_PYTHON_DLL, verbose) == OK; } @@ -374,8 +388,8 @@ get_exceptions() */ static void DoPythonCommand(exarg_T *, const char *); -static int RangeStart; -static int RangeEnd; +static PyInt RangeStart; +static PyInt RangeEnd; static void PythonIO_Flush(void); static int PythonIO_Init(void); @@ -384,12 +398,12 @@ static int PythonMod_Init(void); /* Utility functions for the vim/python interface * ---------------------------------------------- */ -static PyObject *GetBufferLine(buf_T *, int); +static PyObject *GetBufferLine(buf_T *, PyInt); static PyObject *GetBufferLineList(buf_T *, PyInt, PyInt); -static int SetBufferLine(buf_T *, int, PyObject *, int *); -static int SetBufferLineList(buf_T *, PyInt, PyInt, PyObject *, int *); -static int InsertBufferLines(buf_T *, int, PyObject *, int *); +static int SetBufferLine(buf_T *, PyInt, PyObject *, PyInt *); +static int SetBufferLineList(buf_T *, PyInt, PyInt, PyObject *, PyInt *); +static int InsertBufferLines(buf_T *, PyInt, PyObject *, PyInt *); static PyObject *LineToString(const char *); static char *StringToLine(PyObject *); @@ -690,7 +704,7 @@ static PyObject *OutputWrite(PyObject *, PyObject *); static PyObject *OutputWritelines(PyObject *, PyObject *); typedef void (*writefn)(char_u *); -static void writer(writefn fn, char_u *str, int n); +static void writer(writefn fn, char_u *str, PyInt n); /* Output object definition */ @@ -812,7 +826,7 @@ OutputWritelines(PyObject *self, PyObject *args) { PyObject *line = PyList_GetItem(list, i); char *str; - int len; + PyInt len; if (!PyArg_Parse(line, "s#", &str, &len)) { PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); @@ -836,15 +850,15 @@ OutputWritelines(PyObject *self, PyObject *args) */ static char_u *buffer = NULL; -static int buffer_len = 0; -static int buffer_size = 0; +static PyInt buffer_len = 0; +static PyInt buffer_size = 0; static writefn old_fn = NULL; static void -buffer_ensure(int n) +buffer_ensure(PyInt n) { - int new_size; + PyInt new_size; char_u *new_buffer; if (n < buffer_size) @@ -884,7 +898,7 @@ PythonIO_Flush(void) } static void -writer(writefn fn, char_u *str, int n) +writer(writefn fn, char_u *str, PyInt n) { char_u *ptr; @@ -895,7 +909,7 @@ writer(writefn fn, char_u *str, int n) while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL) { - int len = ptr - str; + PyInt len = ptr - str; buffer_ensure(buffer_len + len + 1); @@ -1022,14 +1036,14 @@ typedef struct { PyObject_HEAD BufferObject *buf; - int start; - int end; + PyInt start; + PyInt end; } RangeObject; #define RangeType_Check(obj) ((obj)->ob_type == &RangeType) -static PyObject *RangeNew(buf_T *, int, int); +static PyObject *RangeNew(buf_T *, PyInt, PyInt); static void RangeDestructor(PyObject *); static PyObject *RangeGetattr(PyObject *, char *); @@ -1069,8 +1083,8 @@ static int CurrentSetattr(PyObject *, char *, PyObject *); static struct PyMethodDef VimMethods[] = { /* name, function, calling, documentation */ - {"command", VimCommand, 1, "" }, - {"eval", VimEval, 1, "" }, + {"command", VimCommand, 1, "Execute a Vim ex-mode command" }, + {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" }, { NULL, NULL, 0, NULL } }; @@ -1110,7 +1124,7 @@ VimCommand(PyObject *self, PyObject *args) * Function to translate a typval_T into a PyObject; this will recursively * translate lists/dictionaries into their Python equivalents. * - * The depth parameter is too avoid infinite recursion, set it to 1 when + * The depth parameter is to avoid infinite recursion, set it to 1 when * you call VimToPython. */ static PyObject * @@ -1130,7 +1144,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict) /* Check if we run into a recursive loop. The item must be in lookupDict * then and we can use it again. */ - sprintf(ptrBuf, "%ld", (long)our_tv); + sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U, (long_u)our_tv); result = PyDict_GetItemString(lookupDict, ptrBuf); if (result != NULL) Py_INCREF(result); @@ -1184,7 +1198,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict) if (our_tv->vval.v_dict != NULL) { hashtab_T *ht = &our_tv->vval.v_dict->dv_hashtab; - int todo = ht->ht_used; + long_u todo = ht->ht_used; hashitem_T *hi; dictitem_T *di; @@ -1273,7 +1287,7 @@ CheckBuffer(BufferObject *this) } static PyObject * -RBItem(BufferObject *self, PyInt n, int start, int end) +RBItem(BufferObject *self, PyInt n, PyInt start, PyInt end) { if (CheckBuffer(self)) return NULL; @@ -1288,7 +1302,7 @@ RBItem(BufferObject *self, PyInt n, int start, int end) } static PyObject * -RBSlice(BufferObject *self, PyInt lo, PyInt hi, int start, int end) +RBSlice(BufferObject *self, PyInt lo, PyInt hi, PyInt start, PyInt end) { PyInt size; @@ -1312,9 +1326,9 @@ RBSlice(BufferObject *self, PyInt lo, PyInt hi, int start, int end) } static PyInt -RBAssItem(BufferObject *self, PyInt n, PyObject *val, int start, int end, int *new_end) +RBAssItem(BufferObject *self, PyInt n, PyObject *val, PyInt start, PyInt end, PyInt *new_end) { - int len_change; + PyInt len_change; if (CheckBuffer(self)) return -1; @@ -1335,10 +1349,10 @@ RBAssItem(BufferObject *self, PyInt n, PyObject *val, int start, int end, int *n } static PyInt -RBAssSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, int start, int end, int *new_end) +RBAssSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, PyInt start, PyInt end, PyInt *new_end) { - int size; - int len_change; + PyInt size; + PyInt len_change; /* Self must be a valid buffer */ if (CheckBuffer(self)) @@ -1368,19 +1382,19 @@ RBAssSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, int start, int } static PyObject * -RBAppend(BufferObject *self, PyObject *args, int start, int end, int *new_end) +RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end) { PyObject *lines; - int len_change; - int max; - int n; + PyInt len_change; + PyInt max; + PyInt n; if (CheckBuffer(self)) return NULL; max = n = end - start + 1; - if (!PyArg_ParseTuple(args, "O|i", &lines, &n)) + if (!PyArg_ParseTuple(args, "O|" Py_ssize_t_fmt, &lines, &n)) return NULL; if (n < 0 || n > max) @@ -1405,9 +1419,9 @@ RBAppend(BufferObject *self, PyObject *args, int start, int end, int *new_end) static struct PyMethodDef BufferMethods[] = { /* name, function, calling, documentation */ - {"append", BufferAppend, 1, "" }, - {"mark", BufferMark, 1, "" }, - {"range", BufferRange, 1, "" }, + {"append", BufferAppend, 1, "Append data to Vim buffer" }, + {"mark", BufferMark, 1, "Return (row,col) representing position of named mark" }, + {"range", BufferRange, 1, "Return a range object which represents the part of the given buffer between line numbers s and e" }, { NULL, NULL, 0, NULL } }; @@ -1503,9 +1517,9 @@ BufferGetattr(PyObject *self, char *name) return NULL; if (strcmp(name, "name") == 0) - return Py_BuildValue("s",this->buf->b_ffname); + return Py_BuildValue("s", this->buf->b_ffname); else if (strcmp(name, "number") == 0) - return Py_BuildValue("i",this->buf->b_fnum); + return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); else if (strcmp(name,"__members__") == 0) return Py_BuildValue("[ss]", "name", "number"); else @@ -1520,14 +1534,13 @@ BufferRepr(PyObject *self) if (this->buf == INVALID_BUFFER_VALUE) { - vim_snprintf(repr, 100, _(""), - (long)(self)); + vim_snprintf(repr, 100, _(""), (self)); return PyString_FromString(repr); } else { char *name = (char *)this->buf->b_fname; - int len; + PyInt len; if (name == NULL) name = ""; @@ -1572,7 +1585,7 @@ BufferSlice(PyObject *self, PyInt lo, PyInt hi) BufferAssItem(PyObject *self, PyInt n, PyObject *val) { return RBAssItem((BufferObject *)(self), n, val, 1, - (int)((BufferObject *)(self))->buf->b_ml.ml_line_count, + (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, NULL); } @@ -1580,7 +1593,7 @@ BufferAssItem(PyObject *self, PyInt n, PyObject *val) BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) { return RBAssSlice((BufferObject *)(self), lo, hi, val, 1, - (int)((BufferObject *)(self))->buf->b_ml.ml_line_count, + (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, NULL); } @@ -1588,7 +1601,7 @@ BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) BufferAppend(PyObject *self, PyObject *args) { return RBAppend((BufferObject *)(self), args, 1, - (int)((BufferObject *)(self))->buf->b_ml.ml_line_count, + (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, NULL); } @@ -1633,13 +1646,13 @@ BufferMark(PyObject *self, PyObject *args) static PyObject * BufferRange(PyObject *self, PyObject *args) { - int start; - int end; + PyInt start; + PyInt end; if (CheckBuffer((BufferObject *)(self))) return NULL; - if (!PyArg_ParseTuple(args, "ii", &start, &end)) + if (!PyArg_ParseTuple(args, Py_ssize_t_fmt Py_ssize_t_fmt, &start, &end)) return NULL; return RangeNew(((BufferObject *)(self))->buf, start, end); @@ -1650,7 +1663,7 @@ BufferRange(PyObject *self, PyObject *args) static struct PyMethodDef RangeMethods[] = { /* name, function, calling, documentation */ - {"append", RangeAppend, 1, "" }, + {"append", RangeAppend, 1, "Append data to the Vim range" }, { NULL, NULL, 0, NULL } }; @@ -1691,7 +1704,7 @@ static PyTypeObject RangeType = { */ static PyObject * -RangeNew(buf_T *buf, int start, int end) +RangeNew(buf_T *buf, PyInt start, PyInt end) { BufferObject *bufr; RangeObject *self; @@ -1725,9 +1738,9 @@ RangeDestructor(PyObject *self) RangeGetattr(PyObject *self, char *name) { if (strcmp(name, "start") == 0) - return Py_BuildValue("i",((RangeObject *)(self))->start - 1); + return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->start - 1); else if (strcmp(name, "end") == 0) - return Py_BuildValue("i",((RangeObject *)(self))->end - 1); + return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->end - 1); else return Py_FindMethod(RangeMethods, self, name); } @@ -1740,8 +1753,8 @@ RangeRepr(PyObject *self) if (this->buf->buf == INVALID_BUFFER_VALUE) { - vim_snprintf(repr, 100, "", - (long)(self)); + vim_snprintf(repr, 100, "", + (self)); return PyString_FromString(repr); } else @@ -1869,7 +1882,7 @@ static PyTypeObject BufListType = { BufListLength(PyObject *self) { buf_T *b = firstbuf; - int n = 0; + PyInt n = 0; while (b) { @@ -2115,8 +2128,7 @@ WindowRepr(PyObject *self) if (this->win == INVALID_WINDOW_VALUE) { - vim_snprintf(repr, 100, _(""), - (long)(self)); + vim_snprintf(repr, 100, _(""), (self)); return PyString_FromString(repr); } else @@ -2128,8 +2140,8 @@ WindowRepr(PyObject *self) ++i; if (w == NULL) - vim_snprintf(repr, 100, _(""), - (long)(self)); + vim_snprintf(repr, 100, _(""), + (self)); else vim_snprintf(repr, 100, _(""), i); @@ -2186,7 +2198,7 @@ static PyTypeObject WinListType = { WinListLength(PyObject *self) { win_T *w = firstwin; - int n = 0; + PyInt n = 0; while (w != NULL) { @@ -2254,7 +2266,7 @@ CurrentGetattr(PyObject *self, char *name) else if (strcmp(name, "window") == 0) return (PyObject *)WindowNew(curwin); else if (strcmp(name, "line") == 0) - return GetBufferLine(curbuf, (int)curwin->w_cursor.lnum); + return GetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum); else if (strcmp(name, "range") == 0) return RangeNew(curbuf, RangeStart, RangeEnd); else if (strcmp(name,"__members__") == 0) @@ -2272,7 +2284,7 @@ CurrentSetattr(PyObject *self, char *name, PyObject *value) { if (strcmp(name, "line") == 0) { - if (SetBufferLine(curbuf, (int)curwin->w_cursor.lnum, value, NULL) == FAIL) + if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, value, NULL) == FAIL) return -1; return 0; @@ -2344,7 +2356,7 @@ PythonMod_Init(void) /* Set sys.argv[] to avoid a crash in warn(). */ PySys_SetArgv(1, argv); - mod = Py_InitModule("vim", VimMethods); + mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION); dict = PyModule_GetDict(mod); VimError = Py_BuildValue("s", "vim.error"); @@ -2369,7 +2381,7 @@ PythonMod_Init(void) * string object. */ static PyObject * -GetBufferLine(buf_T *buf, int n) +GetBufferLine(buf_T *buf, PyInt n) { return LineToString((char *)ml_get_buf(buf, (linenr_T)n, FALSE)); } @@ -2422,7 +2434,7 @@ GetBufferLineList(buf_T *buf, PyInt lo, PyInt hi) * deleted). */ static void -py_fix_cursor(int lo, int hi, int extra) +py_fix_cursor(linenr_T lo, linenr_T hi, linenr_T extra) { if (curwin->w_cursor.lnum >= lo) { @@ -2454,7 +2466,7 @@ py_fix_cursor(int lo, int hi, int extra) * is set to the change in the buffer length. */ static int -SetBufferLine(buf_T *buf, int n, PyObject *line, int *len_change) +SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change) { /* First of all, we check the thpe of the supplied Python object. * There are three cases: @@ -2477,7 +2489,7 @@ SetBufferLine(buf_T *buf, int n, PyObject *line, int *len_change) { deleted_lines_mark((linenr_T)n, 1L); if (buf == curwin->w_buffer) - py_fix_cursor(n, n + 1, -1); + py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1); } curbuf = savebuf; @@ -2545,7 +2557,7 @@ SetBufferLine(buf_T *buf, int n, PyObject *line, int *len_change) * is set to the change in the buffer length. */ static int -SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_change) +SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_change) { /* First of all, we check the thpe of the supplied Python object. * There are three cases: @@ -2556,7 +2568,7 @@ SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_chang if (list == Py_None || list == NULL) { PyInt i; - PyInt n = hi - lo; + PyInt n = (int)(hi - lo); buf_T *savebuf = curbuf; PyErr_Clear(); @@ -2577,7 +2589,7 @@ SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_chang deleted_lines_mark((linenr_T)lo, (long)i); if (buf == curwin->w_buffer) - py_fix_cursor(lo, hi, -n); + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n); } curbuf = savebuf; @@ -2595,7 +2607,7 @@ SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_chang PyInt i; PyInt new_len = PyList_Size(list); PyInt old_len = hi - lo; - int extra = 0; /* lines added to text, can be negative */ + PyInt extra = 0; /* lines added to text, can be negative */ char **array; buf_T *savebuf; @@ -2706,7 +2718,7 @@ SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_chang changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra); if (buf == curwin->w_buffer) - py_fix_cursor(lo, hi, extra); + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra); curbuf = savebuf; @@ -2734,7 +2746,7 @@ SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, int *len_chang * is set to the change in the buffer length. */ static int -InsertBufferLines(buf_T *buf, int n, PyObject *lines, int *len_change) +InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change) { /* First of all, we check the type of the supplied Python object. * It must be a string or a list, or the call is in error. diff --git a/src/version.c b/src/version.c index 5a3f014bdc..be037615a2 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 320, /**/ 319, /**/ @@ -1367,12 +1369,12 @@ list_version() # ifdef FEAT_GUI_W32 # if defined(_MSC_VER) && (_MSC_VER <= 1010) /* Only MS VC 4.1 and earlier can do Win32s */ - MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version")); + MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version")); # else # ifdef _WIN64 - MSG_PUTS(_("\nMS-Windows 64 bit GUI version")); + MSG_PUTS(_("\nMS-Windows 64-bit GUI version")); # else - MSG_PUTS(_("\nMS-Windows 32 bit GUI version")); + MSG_PUTS(_("\nMS-Windows 32-bit GUI version")); # endif # endif if (gui_is_win32s()) @@ -1381,17 +1383,21 @@ list_version() MSG_PUTS(_(" with OLE support")); # endif # else - MSG_PUTS(_("\nMS-Windows 32 bit console version")); +# ifdef _WIN64 + MSG_PUTS(_("\nMS-Windows 64-bit console version")); +# else + MSG_PUTS(_("\nMS-Windows 32-bit console version")); +# endif # endif #endif #ifdef WIN16 - MSG_PUTS(_("\nMS-Windows 16 bit version")); + MSG_PUTS(_("\nMS-Windows 16-bit version")); #endif #ifdef MSDOS # ifdef DJGPP - MSG_PUTS(_("\n32 bit MS-DOS version")); + MSG_PUTS(_("\n32-bit MS-DOS version")); # else - MSG_PUTS(_("\n16 bit MS-DOS version")); + MSG_PUTS(_("\n16-bit MS-DOS version")); # endif #endif #ifdef MACOS From 255571d05e0df84ea16a9e8b9040400aa3c9203d Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 14:52:32 +0000 Subject: [PATCH 07/16] updated for version 7.1-321 --- src/INSTALLpc.txt | 12 ++++++++++-- src/version.c | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt index f256ac13de..2c4102624a 100644 --- a/src/INSTALLpc.txt +++ b/src/INSTALLpc.txt @@ -36,7 +36,7 @@ The currently preferred method is using the free Visual C++ Toolkit 2003. Visual Studio ------------- -Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, and VS .NET 2005) +Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, and VS 2008) is straightforward. (These instructions should also work for VS 4 and VS 5.) To build Vim from the command line with MSVC, use Make_mvc.mak. @@ -139,7 +139,7 @@ to debug Vim itself. An earlier version of the Debugging Tools is also available through the Platform SDK, |ms-platform-sdk|. -Visual C++ 2005 Express Edition +Visual C++ 2005 Express Edition *msvc-2005-express* ------------------------------- Visual C++ 2005 Express Edition can be downloaded for free from: @@ -159,6 +159,14 @@ Visual C++ 2008 Express Edition can be downloaded for free from: This includes the IDE and the debugger. You can build Vim with Make_mvc.mak. +Visual C++ 2008 Express Edition *msvc-2008-express* +------------------------------- + +Visual C++ 2008 Express Edition can be downloaded for free from: + http://msdn2.microsoft.com/en-us/express/default.aspx +This includes the IDE and the debugger. You can build Vim with Make_mvc.mak. + + 2. MinGW ======== diff --git a/src/version.c b/src/version.c index be037615a2..dc2d995d22 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 321, /**/ 320, /**/ From 603f746178894073c25964e992b15545b4fdc791 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 15:31:51 +0000 Subject: [PATCH 08/16] updated for version 7.1-322 --- runtime/doc/eval.txt | 4 ++++ src/eval.c | 12 ++++++++++-- src/version.c | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 57e2c4e43d..126b98b92d 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -3515,6 +3515,10 @@ line({expr}) The result is a Number, which is the line number of the file returned) w0 first line visible in current window w$ last line visible in current window + v In Visual mode: the start of the Visual area (the + cursor is the end). When not in Visual mode + returns the cursor position. Differs from |'<| in + that it's updated right away. Note that a mark in another file can be used. The line number then applies to another buffer. To get the column number use |col()|. To get both use diff --git a/src/eval.c b/src/eval.c index 1ad9cec1ef..54ca054ca1 100644 --- a/src/eval.c +++ b/src/eval.c @@ -16907,9 +16907,17 @@ var2fpos(varp, dollar_lnum, fnum) name = get_tv_string_chk(varp); if (name == NULL) return NULL; - if (name[0] == '.') /* cursor */ + if (name[0] == '.') /* cursor */ return &curwin->w_cursor; - if (name[0] == '\'') /* mark */ +#ifdef FEAT_VISUAL + if (name[0] == 'v' && name[1] == NUL) /* Visual start */ + { + if (VIsual_active) + return &VIsual; + return &curwin->w_cursor; + } +#endif + if (name[0] == '\'') /* mark */ { pp = getmark_fnum(name[1], FALSE, fnum); if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0) diff --git a/src/version.c b/src/version.c index dc2d995d22..c8d4958cde 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 322, /**/ 321, /**/ From 279b3f843cc6ac8bcfde85a3e71bd5bc66266a4f Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 15:53:31 +0000 Subject: [PATCH 09/16] updated for version 7.1-323 --- src/testdir/test19.in | 2 ++ src/testdir/test38.in | 2 ++ src/version.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/testdir/test19.in b/src/testdir/test19.in index 0d9b421a23..bdcfb77dba 100644 --- a/src/testdir/test19.in +++ b/src/testdir/test19.in @@ -2,6 +2,8 @@ Tests for "r" with 'smarttab' and 'expandtab' set/not set. STARTTEST :set smarttab expandtab ts=8 sw=4 +:" make sure that backspace works, no matter what termcap is used +:set t_kD=x7f t_kb=x08 /some r :set noexpandtab /other diff --git a/src/testdir/test38.in b/src/testdir/test38.in index 885bd0967f..3e0236251b 100644 --- a/src/testdir/test38.in +++ b/src/testdir/test38.in @@ -3,6 +3,8 @@ Test Virtual replace mode. STARTTEST :so small.vim +:" make sure that backspace works, no matter what termcap is used +:set t_kD=x7f t_kb=x08 ggdGa abcdefghi jk lmn diff --git a/src/version.c b/src/version.c index c8d4958cde..ab34115a14 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 323, /**/ 322, /**/ From bafdc2c3e19fbda613bd151a3dae54a2988f98b8 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 16:07:02 +0000 Subject: [PATCH 10/16] updated for version 7.1-324 --- src/os_unix.h | 8 +++++++- src/version.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/os_unix.h b/src/os_unix.h index be6048fa5d..a337183c4a 100644 --- a/src/os_unix.h +++ b/src/os_unix.h @@ -432,7 +432,13 @@ typedef struct dsc$descriptor DESC; * Unix has plenty of memory, use large buffers */ #define CMDBUFFSIZE 1024 /* size of the command processing buffer */ -#define MAXPATHL 1024 /* Unix has long paths and plenty of memory */ + +/* Use the system path length if it makes sense. */ +#if defined(PATH_MAX) && (PATH_MAX > 1000) +# define MAXPATHL PATH_MAX +#else +# define MAXPATHL 1024 +#endif #define CHECK_INODE /* used when checking if a swap file already exists for a file */ diff --git a/src/version.c b/src/version.c index ab34115a14..8406e897d8 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 324, /**/ 323, /**/ From bc9688ffdc48b7d08496c2d9e28eaf29cd2f5340 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 16:31:07 +0000 Subject: [PATCH 11/16] updated for version 7.1-325 --- src/ex_getln.c | 17 +++++++++-------- src/version.c | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index dabd65d143..6671589359 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -2053,10 +2053,10 @@ set_cmdspos_cursor() if (has_mbyte) correct_cmdspos(i, c); #endif - /* If the cmdline doesn't fit, put cursor on last visible char. */ + /* If the cmdline doesn't fit, show cursor on last visible char. + * Don't move the cursor itself, so we can still append. */ if ((ccline.cmdspos += c) >= m) { - ccline.cmdpos = i - 1; ccline.cmdspos -= c; break; } @@ -2829,10 +2829,11 @@ put_on_cmdline(str, len, redraw) if (has_mbyte) correct_cmdspos(ccline.cmdpos, c); #endif - /* Stop cursor at the end of the screen */ - if (ccline.cmdspos + c >= m) - break; - ccline.cmdspos += c; + /* Stop cursor at the end of the screen, but do increment the + * insert position, so that entering a very long command + * works, even though you can't see it. */ + if (ccline.cmdspos + c < m) + ccline.cmdspos += c; #ifdef FEAT_MBYTE if (has_mbyte) { @@ -3332,7 +3333,7 @@ nextwild(xp, type, options) /* * Do wildcard expansion on the string 'str'. * Chars that should not be expanded must be preceded with a backslash. - * Return a pointer to alloced memory containing the new string. + * Return a pointer to allocated memory containing the new string. * Return NULL for failure. * * "orig" is the originally expanded string, copied to allocated memory. It @@ -6111,7 +6112,7 @@ ex_window() exmode_active = save_exmode; - /* Safety check: The old window or buffer was deleted: It's a a bug when + /* Safety check: The old window or buffer was deleted: It's a bug when * this happens! */ if (!win_valid(old_curwin) || !buf_valid(old_curbuf)) { diff --git a/src/version.c b/src/version.c index 8406e897d8..00cbfa33e1 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 325, /**/ 324, /**/ From 95fb95ebcc58caaf0f155828d354700d6bb91278 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 16:51:41 +0000 Subject: [PATCH 12/16] updated for version 7.1-326 --- src/ex_docmd.c | 4 +++- src/version.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 701354ee07..c5b520c666 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2142,7 +2142,9 @@ do_one_cmd(cmdlinep, sourcing, #endif - if (*p == '!' && ea.cmdidx != CMD_substitute) /* forced commands */ + /* forced commands */ + if (*p == '!' && ea.cmdidx != CMD_substitute + && ea.cmdidx != CMD_smagic && ea.cmdidx != CMD_snomagic) { ++p; ea.forceit = TRUE; diff --git a/src/version.c b/src/version.c index 00cbfa33e1..66c5fdaa86 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 326, /**/ 325, /**/ From f63e3834b4f5827424af3420b8ba1f61767f0041 Mon Sep 17 00:00:00 2001 From: vimboss Date: Fri, 20 Jun 2008 19:29:35 +0000 Subject: [PATCH 13/16] updated for version 7.1-327 --- src/Makefile | 30 +++++++++++++++++------------- src/version.c | 2 ++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Makefile b/src/Makefile index f82e7c7f19..44c9c6f387 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1113,7 +1113,7 @@ GTK_IPATH = $(GUI_INC_LOC) GTK_LIBS_DIR = $(GUI_LIB_LOC) GTK_LIBS1 = GTK_LIBS2 = $(GTK_LIBNAME) -GTK_INSTALL = install_normal +GTK_INSTALL = install_normal install_gui_extra GTK_TARGETS = installglinks GTK_MAN_TARGETS = yes GTK_TESTTARGET = gui @@ -1130,7 +1130,7 @@ MOTIF_IPATH = $(GUI_INC_LOC) MOTIF_LIBS_DIR = $(GUI_LIB_LOC) MOTIF_LIBS1 = MOTIF_LIBS2 = $(MOTIF_LIBNAME) -lXt -MOTIF_INSTALL = install_normal +MOTIF_INSTALL = install_normal install_gui_extra MOTIF_TARGETS = installglinks MOTIF_MAN_TARGETS = yes MOTIF_TESTTARGET = gui @@ -1160,7 +1160,7 @@ ATHENA_IPATH = $(GUI_INC_LOC) ATHENA_LIBS_DIR = $(GUI_LIB_LOC) ATHENA_LIBS1 = $(XAW_LIB) ATHENA_LIBS2 = -lXt -ATHENA_INSTALL = install_normal +ATHENA_INSTALL = install_normal install_gui_extra ATHENA_TARGETS = installglinks ATHENA_MAN_TARGETS = yes ATHENA_TESTTARGET = gui @@ -1178,7 +1178,7 @@ NEXTAW_IPATH = $(GUI_INC_LOC) NEXTAW_LIBS_DIR = $(GUI_LIB_LOC) NEXTAW_LIBS1 = $(NEXTAW_LIB) NEXTAW_LIBS2 = -lXt -NEXTAW_INSTALL = install_normal +NEXTAW_INSTALL = install_normal install_gui_extra NEXTAW_TARGETS = installglinks NEXTAW_MAN_TARGETS = yes NEXTAW_TESTTARGET = gui @@ -1203,7 +1203,7 @@ PHOTONGUI_IPATH = PHOTONGUI_LIBS_DIR = PHOTONGUI_LIBS1 = -lph -lphexlib PHOTONGUI_LIBS2 = -PHOTONGUI_INSTALL = install_normal +PHOTONGUI_INSTALL = install_normal install_gui_extra PHOTONGUI_TARGETS = installglinks PHOTONGUI_MAN_TARGETS = yes PHOTONGUI_TESTTARGET = gui @@ -1219,7 +1219,7 @@ CARBONGUI_IPATH = -I. -Iproto CARBONGUI_LIBS_DIR = CARBONGUI_LIBS1 = -framework Carbon CARBONGUI_LIBS2 = -CARBONGUI_INSTALL = install_macosx +CARBONGUI_INSTALL = install_macosx install_gui_extra CARBONGUI_TARGETS = CARBONGUI_MAN_TARGETS = CARBONGUI_TESTTARGET = gui @@ -1741,6 +1741,15 @@ testclean: cd $(PODIR); $(MAKE) checkclean; \ fi +install: $(GUI_INSTALL) + +install_normal: installvim installtools $(INSTALL_LANGS) install-icons + +install_gui_extra: installgtutorbin + +installvim: installvimbin installtutorbin \ + installruntime installlinks installmanlinks + # # Avoid overwriting an existing executable, somebody might be running it and # overwriting it could cause it to crash. Deleting it is OK, it won't be @@ -1750,13 +1759,6 @@ testclean: # If you want to keep an older version, rename it before running "make # install". # -install: $(GUI_INSTALL) - -install_normal: installvim installtools $(INSTALL_LANGS) install-icons - -installvim: installvimbin installtutorbin \ - installruntime installlinks installmanlinks - installvimbin: $(VIMTARGET) $(DESTDIR)$(exec_prefix) $(DEST_BIN) -if test -f $(DEST_BIN)/$(VIMTARGET); then \ mv -f $(DEST_BIN)/$(VIMTARGET) $(DEST_BIN)/$(VIMNAME).rm; \ @@ -1872,6 +1874,8 @@ installmacros: $(DEST_VIM) $(DEST_RT) $(DEST_MACRO) installtutorbin: $(DEST_VIM) $(INSTALL_DATA) vimtutor $(DEST_BIN)/$(VIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(VIMNAME)tutor + +installgtutorbin: $(DEST_VIM) $(INSTALL_DATA) gvimtutor $(DEST_BIN)/$(GVIMNAME)tutor chmod $(SCRIPTMOD) $(DEST_BIN)/$(GVIMNAME)tutor diff --git a/src/version.c b/src/version.c index 66c5fdaa86..516b342c39 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 327, /**/ 326, /**/ From 6255f52fc5b2e8d79544c14a366b3b14aef18365 Mon Sep 17 00:00:00 2001 From: vimboss Date: Sat, 21 Jun 2008 11:12:49 +0000 Subject: [PATCH 14/16] updated for version 7.1-328 --- src/os_unix.c | 7 ++++++- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/os_unix.c b/src/os_unix.c index 7bad7e9d41..4c3f39f2c7 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2278,6 +2278,10 @@ mch_FullName(fname, buf, len, force) char_u olddir[MAXPATHL]; char_u *p; int retval = OK; +#ifdef __CYGWIN__ + char_u posix_fname[MAX_PATH]; +#endif + #ifdef VMS fname = vms_fixfilename(fname); @@ -2287,7 +2291,8 @@ mch_FullName(fname, buf, len, force) /* * This helps for when "/etc/hosts" is a symlink to "c:/something/hosts". */ - cygwin_conv_to_posix_path(fname, fname); + cygwin_conv_to_posix_path(fname, posix_fname); + fname = posix_fname; #endif /* expand it if forced or not an absolute path */ diff --git a/src/version.c b/src/version.c index 516b342c39..bd4a99f5c1 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 328, /**/ 327, /**/ From b53ee76b5e6394fe676f2756ad95a1c88a54a2c3 Mon Sep 17 00:00:00 2001 From: vimboss Date: Sat, 21 Jun 2008 12:14:30 +0000 Subject: [PATCH 15/16] updated for version 7.1-329 --- src/screen.c | 5 ++++- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 3a585ffa9c..7945866f69 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4863,6 +4863,7 @@ comp_char_differs(off_from, off_to) * - the (first byte of the) character is different * - the attributes are different * - the character is multi-byte and the next byte is different + * - the character is two cells wide and the second cell differs. */ static int char_needs_redraw(off_from, off_to, cols) @@ -4884,7 +4885,9 @@ char_needs_redraw(off_from, off_to, cols) || (enc_utf8 && (ScreenLinesUC[off_from] != ScreenLinesUC[off_to] || (ScreenLinesUC[off_from] != 0 - && comp_char_differs(off_from, off_to)))) + && comp_char_differs(off_from, off_to)) + || (cols > 1 && ScreenLines[off_from + 1] + != ScreenLines[off_to + 1]))) #endif )) return TRUE; diff --git a/src/version.c b/src/version.c index bd4a99f5c1..f9b88868e0 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 329, /**/ 328, /**/ From d165ccb4bc26384f70d845e2d17d85e5935cf420 Mon Sep 17 00:00:00 2001 From: vimboss Date: Sat, 21 Jun 2008 14:30:28 +0000 Subject: [PATCH 16/16] updated for version 7.1-330 --- src/misc1.c | 21 +++++++++++++-------- src/version.c | 2 ++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/misc1.c b/src/misc1.c index f621a8949c..1992cf9974 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -1880,15 +1880,20 @@ ins_bytes_len(p, len) # ifdef FEAT_MBYTE int n; - for (i = 0; i < len; i += n) - { - n = (*mb_ptr2len)(p + i); - ins_char_bytes(p + i, n); - } -# else - for (i = 0; i < len; ++i) - ins_char(p[i]); + if (has_mbyte) + for (i = 0; i < len; i += n) + { + if (enc_utf8) + /* avoid reading past p[len] */ + n = utfc_ptr2len_len(p + i, len - i); + else + n = (*mb_ptr2len)(p + i); + ins_char_bytes(p + i, n); + } + else # endif + for (i = 0; i < len; ++i) + ins_char(p[i]); } #endif diff --git a/src/version.c b/src/version.c index f9b88868e0..5d1958485e 100644 --- a/src/version.c +++ b/src/version.c @@ -666,6 +666,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 330, /**/ 329, /**/