diff --git a/7.3.904 b/7.3.904 new file mode 100644 index 0000000..a41b469 --- /dev/null +++ b/7.3.904 @@ -0,0 +1,47 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.904 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.904 (after 7.3.893) +Problem: Using memory freed by the garbage collector. +Solution: Mark items in aucmd_win as used. +Files: src/eval.c + + +*** ../vim-7.3.903/src/eval.c 2013-04-15 15:15:31.000000000 +0200 +--- src/eval.c 2013-04-15 18:20:35.000000000 +0200 +*************** +*** 6792,6797 **** +--- 6792,6801 ---- + /* window-local variables */ + FOR_ALL_TAB_WINDOWS(tp, wp) + set_ref_in_item(&wp->w_winvar.di_tv, copyID); ++ #ifdef FEAT_AUTOCMD ++ if (aucmd_win != NULL) ++ set_ref_in_item(&aucmd_win->w_winvar.di_tv, copyID); ++ #endif + + #ifdef FEAT_WINDOWS + /* tabpage-local variables */ +*** ../vim-7.3.903/src/version.c 2013-04-15 16:14:15.000000000 +0200 +--- src/version.c 2013-04-15 18:21:49.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 904, + /**/ + +-- +Rule #1: Don't give somebody a tool that he's going to hurt himself with. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.905 b/7.3.905 new file mode 100644 index 0000000..60ff528 --- /dev/null +++ b/7.3.905 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.905 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.905 (after 7.3.903) +Problem: Crash when writing viminfo. (Ron Aaron) +Solution: Prevent freed history info to be used. +Files: src/ex_getln.c + + +*** ../vim-7.3.904/src/ex_getln.c 2013-04-15 16:14:15.000000000 +0200 +--- src/ex_getln.c 2013-04-15 22:12:33.000000000 +0200 +*************** +*** 6264,6269 **** +--- 6264,6270 ---- + vim_free(viminfo_history[type][i]); + vim_free(viminfo_history[type]); + viminfo_history[type] = NULL; ++ viminfo_hisidx[type] = 0; + } + } + #endif /* FEAT_VIMINFO */ +*** ../vim-7.3.904/src/version.c 2013-04-15 18:25:55.000000000 +0200 +--- src/version.c 2013-04-15 22:19:03.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 905, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +180. You maintain more than six e-mail addresses. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.906 b/7.3.906 new file mode 100644 index 0000000..8495031 --- /dev/null +++ b/7.3.906 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.906 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.906 +Problem: The "sleep .2" for running tests does not work on Solaris. +Solution: Fall back to using "sleep 1". (Laurent Blume) +Files: src/testdir/Makefile + + +*** ../vim-7.3.905/src/testdir/Makefile 2013-04-12 13:44:49.000000000 +0200 +--- src/testdir/Makefile 2013-04-21 13:06:20.000000000 +0200 +*************** +*** 69,76 **** + .in.out: + -rm -rf $*.failed test.ok $(RM_ON_RUN) + cp $*.ok test.ok +! # Sleep a moment to avoid that the xterm title is messed up +! @-sleep .2 + -$(RUN_VIM) $*.in + + # For flaky tests retry one time. +--- 69,78 ---- + .in.out: + -rm -rf $*.failed test.ok $(RM_ON_RUN) + cp $*.ok test.ok +! # Sleep a moment to avoid that the xterm title is messed up. +! # 200 msec is sufficient, but only modern sleep supports a fraction of +! # a second, fall back to a second if it fails. +! @-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1" + -$(RUN_VIM) $*.in + + # For flaky tests retry one time. +*** ../vim-7.3.905/src/version.c 2013-04-15 22:22:48.000000000 +0200 +--- src/version.c 2013-04-24 12:54:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 906, + /**/ + +-- +Don't be humble ... you're not that great. + -- Golda Meir + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.907 b/7.3.907 new file mode 100644 index 0000000..28d4234 --- /dev/null +++ b/7.3.907 @@ -0,0 +1,162 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.907 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.907 +Problem: Python uses IndexError when a dict key is not found. +Solution: Use KeyError instead. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.906/src/if_py_both.h 2013-04-05 19:32:30.000000000 +0200 +--- src/if_py_both.h 2013-04-24 13:00:01.000000000 +0200 +*************** +*** 861,867 **** + + if (di == NULL) + { +! PyErr_SetString(PyExc_IndexError, _("no such key in dictionary")); + return NULL; + } + +--- 861,867 ---- + + if (di == NULL) + { +! PyErr_SetString(PyExc_KeyError, _("no such key in dictionary")); + return NULL; + } + +*** ../vim-7.3.906/src/if_python3.c 2013-02-20 16:09:35.000000000 +0100 +--- src/if_python3.c 2013-04-24 13:00:01.000000000 +0200 +*************** +*** 327,338 **** +--- 327,340 ---- + /* Imported exception objects */ + static PyObject *p3imp_PyExc_AttributeError; + static PyObject *p3imp_PyExc_IndexError; ++ static PyObject *p3imp_PyExc_KeyError; + static PyObject *p3imp_PyExc_KeyboardInterrupt; + static PyObject *p3imp_PyExc_TypeError; + static PyObject *p3imp_PyExc_ValueError; + + # define PyExc_AttributeError p3imp_PyExc_AttributeError + # define PyExc_IndexError p3imp_PyExc_IndexError ++ # define PyExc_KeyError p3imp_PyExc_KeyError + # define PyExc_KeyboardInterrupt p3imp_PyExc_KeyboardInterrupt + # define PyExc_TypeError p3imp_PyExc_TypeError + # define PyExc_ValueError p3imp_PyExc_ValueError +*************** +*** 567,577 **** +--- 569,581 ---- + PyObject *exdict = PyModule_GetDict(exmod); + p3imp_PyExc_AttributeError = PyDict_GetItemString(exdict, "AttributeError"); + p3imp_PyExc_IndexError = PyDict_GetItemString(exdict, "IndexError"); ++ p3imp_PyExc_KeyError = PyDict_GetItemString(exdict, "KeyError"); + p3imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt"); + p3imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError"); + p3imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + Py_XINCREF(p3imp_PyExc_AttributeError); + Py_XINCREF(p3imp_PyExc_IndexError); ++ Py_XINCREF(p3imp_PyExc_KeyError); + Py_XINCREF(p3imp_PyExc_KeyboardInterrupt); + Py_XINCREF(p3imp_PyExc_TypeError); + Py_XINCREF(p3imp_PyExc_ValueError); +*** ../vim-7.3.906/src/if_python.c 2013-02-20 16:09:35.000000000 +0100 +--- src/if_python.c 2013-04-24 13:00:01.000000000 +0200 +*************** +*** 348,359 **** +--- 348,361 ---- + /* Imported exception objects */ + static PyObject *imp_PyExc_AttributeError; + static PyObject *imp_PyExc_IndexError; ++ static PyObject *imp_PyExc_KeyError; + static PyObject *imp_PyExc_KeyboardInterrupt; + static PyObject *imp_PyExc_TypeError; + static PyObject *imp_PyExc_ValueError; + + # define PyExc_AttributeError imp_PyExc_AttributeError + # define PyExc_IndexError imp_PyExc_IndexError ++ # define PyExc_KeyError imp_PyExc_KeyError + # define PyExc_KeyboardInterrupt imp_PyExc_KeyboardInterrupt + # define PyExc_TypeError imp_PyExc_TypeError + # define PyExc_ValueError imp_PyExc_ValueError +*************** +*** 579,589 **** +--- 581,593 ---- + PyObject *exdict = PyModule_GetDict(exmod); + imp_PyExc_AttributeError = PyDict_GetItemString(exdict, "AttributeError"); + imp_PyExc_IndexError = PyDict_GetItemString(exdict, "IndexError"); ++ imp_PyExc_KeyError = PyDict_GetItemString(exdict, "KeyError"); + imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt"); + imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError"); + imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + Py_XINCREF(imp_PyExc_AttributeError); + Py_XINCREF(imp_PyExc_IndexError); ++ Py_XINCREF(imp_PyExc_KeyError); + Py_XINCREF(imp_PyExc_KeyboardInterrupt); + Py_XINCREF(imp_PyExc_TypeError); + Py_XINCREF(imp_PyExc_ValueError); +*** ../vim-7.3.906/src/testdir/test86.ok 2013-04-05 19:32:30.000000000 +0200 +--- src/testdir/test86.ok 2013-04-24 13:00:01.000000000 +0200 +*************** +*** 38,44 **** + Vim(python):E725: + Vim(python):E117: + [0.0, 0.0] +! IndexError + TypeError + TypeError + ValueError +--- 38,44 ---- + Vim(python):E725: + Vim(python):E117: + [0.0, 0.0] +! KeyError + TypeError + TypeError + ValueError +*** ../vim-7.3.906/src/testdir/test87.ok 2013-02-20 16:54:24.000000000 +0100 +--- src/testdir/test87.ok 2013-04-24 13:00:01.000000000 +0200 +*************** +*** 38,44 **** + Vim(py3):E725: + Vim(py3):E117: + [0.0, 0.0] +! IndexError + TypeError + TypeError + ValueError +--- 38,44 ---- + Vim(py3):E725: + Vim(py3):E117: + [0.0, 0.0] +! KeyError + TypeError + TypeError + ValueError +*** ../vim-7.3.906/src/version.c 2013-04-24 12:56:13.000000000 +0200 +--- src/version.c 2013-04-24 13:00:13.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 907, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +219. Your spouse has his or her lawyer deliver the divorce papers... + via e-mail. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.908 b/7.3.908 new file mode 100644 index 0000000..1b71dca --- /dev/null +++ b/7.3.908 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.908 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.908 +Problem: Possible crash when using a list in Python. +Solution: Return early if the list is NULL. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.907/src/if_py_both.h 2013-04-24 13:04:21.000000000 +0200 +--- src/if_py_both.h 2013-04-24 13:10:20.000000000 +0200 +*************** +*** 738,743 **** +--- 738,745 ---- + tv->vval.v_dict = d; + + list = PyMapping_Items(obj); ++ if (list == NULL) ++ return -1; + lsize = PyList_Size(list); + while (lsize--) + { +*** ../vim-7.3.907/src/version.c 2013-04-24 13:04:21.000000000 +0200 +--- src/version.c 2013-04-24 13:09:30.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 908, + /**/ + +-- +How do I set the laser printer to stun? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.909 b/7.3.909 new file mode 100644 index 0000000..1dbf453 --- /dev/null +++ b/7.3.909 @@ -0,0 +1,2129 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.909 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.909 +Problem: Duplicate Python code. +Solution: Move more items to if_py_both.h. (ZyX) Also avoid compiler + warnings for missing initializers. +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c + + +*** ../vim-7.3.908/src/if_py_both.h 2013-04-24 13:10:35.000000000 +0200 +--- src/if_py_both.h 2013-04-24 13:26:54.000000000 +0200 +*************** +*** 542,547 **** +--- 542,555 ---- + * Buffer list object - Implementation + */ + ++ typedef struct ++ { ++ PyObject_HEAD ++ } BufListObject; ++ ++ static PyTypeObject BufListType; ++ static PySequenceMethods WinListAsSeq; ++ + static PyInt + BufListLength(PyObject *self UNUSED) + { +*************** +*** 578,583 **** +--- 586,596 ---- + win_T *win; + } WindowObject; + ++ static struct PyMethodDef WindowMethods[] = { ++ /* name, function, calling, documentation */ ++ { NULL, NULL, 0, NULL } ++ }; ++ + static int ConvertFromPyObject(PyObject *, typval_T *); + static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); + +*************** +*** 642,647 **** +--- 655,670 ---- + pylinkedlist_T ref; + } DictionaryObject; + ++ static PyInt DictionaryAssItem(PyObject *, PyObject *, PyObject *); ++ static PyInt DictionaryLength(PyObject *); ++ static PyObject *DictionaryItem(PyObject *, PyObject *); ++ ++ static PyMappingMethods DictionaryAsMapping = { ++ (lenfunc) DictionaryLength, ++ (binaryfunc) DictionaryItem, ++ (objobjargproc) DictionaryAssItem, ++ }; ++ + static PyObject * + DictionaryNew(dict_T *dict) + { +*************** +*** 658,663 **** +--- 681,697 ---- + return (PyObject *)(self); + } + ++ static void ++ DictionaryDestructor(PyObject *self) ++ { ++ DictionaryObject *this = ((DictionaryObject *) (self)); ++ ++ pyll_remove(&this->ref, &lastdict); ++ dict_unref(this->dict); ++ ++ DESTRUCTOR_FINISH(self); ++ } ++ + static int + pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { +*************** +*** 804,812 **** + return 0; + } + +! static PyInt +! DictionarySetattr(DictionaryObject *self, char *name, PyObject *val) + { + if (val == NULL) + { + PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); +--- 838,848 ---- + return 0; + } + +! static int +! DictionarySetattr(PyObject *self, char *name, PyObject *val) + { ++ DictionaryObject *this = (DictionaryObject *)(self); ++ + if (val == NULL) + { + PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); +*************** +*** 815,821 **** + + if (strcmp(name, "locked") == 0) + { +! if (self->dict->dv_lock == VAR_FIXED) + { + PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary")); + return -1; +--- 851,857 ---- + + if (strcmp(name, "locked") == 0) + { +! if (this->dict->dv_lock == VAR_FIXED) + { + PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary")); + return -1; +*************** +*** 829,837 **** + } + + if (val == Py_True) +! self->dict->dv_lock = VAR_LOCKED; + else +! self->dict->dv_lock = 0; + } + return 0; + } +--- 865,873 ---- + } + + if (val == Py_True) +! this->dict->dv_lock = VAR_LOCKED; + else +! this->dict->dv_lock = 0; + } + return 0; + } +*************** +*** 963,968 **** +--- 999,1006 ---- + }; + + static PyTypeObject ListType; ++ static PySequenceMethods ListAsSeq; ++ static PyMappingMethods ListAsMapping; + + typedef struct + { +*************** +*** 987,992 **** +--- 1025,1041 ---- + return (PyObject *)(self); + } + ++ static void ++ ListDestructor(PyObject *self) ++ { ++ ListObject *this = (ListObject *)(self); ++ ++ pyll_remove(&this->ref, &lastlist); ++ list_unref(this->list); ++ ++ DESTRUCTOR_FINISH(self); ++ } ++ + static int + list_py_concat(list_T *l, PyObject *obj, PyObject *lookupDict) + { +*************** +*** 1307,1314 **** + } + + static int +! ListSetattr(ListObject *self, char *name, PyObject *val) + { + if (val == NULL) + { + PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); +--- 1356,1365 ---- + } + + static int +! ListSetattr(PyObject *self, char *name, PyObject *val) + { ++ ListObject *this = (ListObject *)(self); ++ + if (val == NULL) + { + PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); +*************** +*** 1317,1323 **** + + if (strcmp(name, "locked") == 0) + { +! if (self->list->lv_lock == VAR_FIXED) + { + PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed list")); + return -1; +--- 1368,1374 ---- + + if (strcmp(name, "locked") == 0) + { +! if (this->list->lv_lock == VAR_FIXED) + { + PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed list")); + return -1; +*************** +*** 1331,1339 **** + } + + if (val == Py_True) +! self->list->lv_lock = VAR_LOCKED; + else +! self->list->lv_lock = 0; + } + return 0; + } +--- 1382,1390 ---- + } + + if (val == Py_True) +! this->list->lv_lock = VAR_LOCKED; + else +! this->list->lv_lock = 0; + } + return 0; + } +*************** +*** 1376,1381 **** +--- 1427,1443 ---- + return (PyObject *)(self); + } + ++ static void ++ FunctionDestructor(PyObject *self) ++ { ++ FunctionObject *this = (FunctionObject *) (self); ++ ++ func_unref(this->name); ++ PyMem_Del(this->name); ++ ++ DESTRUCTOR_FINISH(self); ++ } ++ + static PyObject * + FunctionCall(PyObject *self, PyObject *argsObject, PyObject *kwargs) + { +*************** +*** 1451,1456 **** +--- 1513,1557 ---- + + static int WindowSetattr(PyObject *, char *, PyObject *); + static PyObject *WindowRepr(PyObject *); ++ static PyTypeObject WindowType; ++ ++ static PyObject * ++ WindowAttr(WindowObject *this, char *name) ++ { ++ if (strcmp(name, "buffer") == 0) ++ return (PyObject *)BufferNew(this->win->w_buffer); ++ else if (strcmp(name, "cursor") == 0) ++ { ++ pos_T *pos = &this->win->w_cursor; ++ ++ return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); ++ } ++ else if (strcmp(name, "height") == 0) ++ return Py_BuildValue("l", (long)(this->win->w_height)); ++ #ifdef FEAT_VERTSPLIT ++ else if (strcmp(name, "width") == 0) ++ return Py_BuildValue("l", (long)(W_WIDTH(this->win))); ++ #endif ++ else if (strcmp(name,"__members__") == 0) ++ return Py_BuildValue("[sss]", "buffer", "cursor", "height"); ++ else ++ return NULL; ++ } ++ ++ static void ++ WindowDestructor(PyObject *self) ++ { ++ WindowObject *this = (WindowObject *)(self); ++ ++ if (this->win && this->win != INVALID_WINDOW_VALUE) ++ #if PY_MAJOR_VERSION >= 3 ++ this->win->w_python3_ref = NULL; ++ #else ++ this->win->w_python_ref = NULL; ++ #endif ++ ++ DESTRUCTOR_FINISH(self); ++ } + + static int + WindowSetattr(PyObject *self, char *name, PyObject *val) +*************** +*** 1579,1584 **** +--- 1680,1694 ---- + /* + * Window list object - Implementation + */ ++ ++ typedef struct ++ { ++ PyObject_HEAD ++ } WinListObject; ++ ++ static PyTypeObject WinListType; ++ static PySequenceMethods BufListAsSeq; ++ + static PyInt + WinListLength(PyObject *self UNUSED) + { +*************** +*** 2310,2319 **** + return Py_None; + } + +! +! /* Buffer object - Definitions + */ + + typedef struct + { + PyObject_HEAD +--- 2420,2430 ---- + return Py_None; + } + +! /* Range object - Definitions + */ + ++ static PyTypeObject RangeType; ++ + typedef struct + { + PyObject_HEAD +*************** +*** 2322,2327 **** +--- 2433,2442 ---- + PyInt end; + } RangeObject; + ++ static void RangeDestructor(PyObject *); ++ static PySequenceMethods RangeAsSeq; ++ static PyMappingMethods RangeAsMapping; ++ + static PyObject * + RangeNew(buf_T *buf, PyInt start, PyInt end) + { +*************** +*** 2346,2351 **** +--- 2461,2506 ---- + return (PyObject *)(self); + } + ++ static void ++ RangeDestructor(PyObject *self) ++ { ++ Py_DECREF(((RangeObject *)(self))->buf); ++ DESTRUCTOR_FINISH(self); ++ } ++ ++ static PyTypeObject BufferType; ++ static PyObject *BufferRepr(PyObject *); ++ static PySequenceMethods BufferAsSeq; ++ static PyMappingMethods BufferAsMapping; ++ ++ static void ++ BufferDestructor(PyObject *self) ++ { ++ BufferObject *this = (BufferObject *)(self); ++ ++ if (this->buf && this->buf != INVALID_BUFFER_VALUE) ++ #if PY_MAJOR_VERSION >= 3 ++ this->buf->b_python3_ref = NULL; ++ #else ++ this->buf->b_python_ref = NULL; ++ #endif ++ ++ DESTRUCTOR_FINISH(self); ++ } ++ ++ static PyObject * ++ BufferAttr(BufferObject *this, char *name) ++ { ++ if (strcmp(name, "name") == 0) ++ return Py_BuildValue("s", this->buf->b_ffname); ++ else if (strcmp(name, "number") == 0) ++ return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); ++ else if (strcmp(name,"__members__") == 0) ++ return Py_BuildValue("[ss]", "name", "number"); ++ else ++ return NULL; ++ } ++ + static PyObject * + BufferAppend(PyObject *self, PyObject *args) + { +*************** +*** 2409,2414 **** +--- 2564,2598 ---- + return RangeNew(((BufferObject *)(self))->buf, start, end); + } + ++ static PyObject * ++ BufferRepr(PyObject *self) ++ { ++ static char repr[100]; ++ BufferObject *this = (BufferObject *)(self); ++ ++ if (this->buf == INVALID_BUFFER_VALUE) ++ { ++ vim_snprintf(repr, 100, _(""), (self)); ++ return PyString_FromString(repr); ++ } ++ else ++ { ++ char *name = (char *)this->buf->b_fname; ++ PyInt len; ++ ++ if (name == NULL) ++ name = ""; ++ len = strlen(name); ++ ++ if (len > 35) ++ name = name + (35 - len); ++ ++ vim_snprintf(repr, 100, "", len > 35 ? "..." : "", name); ++ ++ return PyString_FromString(repr); ++ } ++ } ++ + static struct PyMethodDef BufferMethods[] = { + /* name, function, calling, documentation */ + {"append", BufferAppend, 1, "Append data to Vim buffer" }, +*************** +*** 2497,2502 **** +--- 2681,2729 ---- + { NULL, NULL, 0, NULL } + }; + ++ /* Current items object - Implementation ++ */ ++ ++ static PyInt RangeStart; ++ static PyInt RangeEnd; ++ ++ static PyObject * ++ CurrentGetattr(PyObject *self UNUSED, char *name) ++ { ++ if (strcmp(name, "buffer") == 0) ++ return (PyObject *)BufferNew(curbuf); ++ else if (strcmp(name, "window") == 0) ++ return (PyObject *)WindowNew(curwin); ++ else if (strcmp(name, "line") == 0) ++ 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) ++ return Py_BuildValue("[ssss]", "buffer", "window", "line", "range"); ++ else ++ { ++ PyErr_SetString(PyExc_AttributeError, name); ++ return NULL; ++ } ++ } ++ ++ static int ++ CurrentSetattr(PyObject *self UNUSED, char *name, PyObject *value) ++ { ++ if (strcmp(name, "line") == 0) ++ { ++ if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, value, NULL) == FAIL) ++ return -1; ++ ++ return 0; ++ } ++ else ++ { ++ PyErr_SetString(PyExc_AttributeError, name); ++ return -1; ++ } ++ } ++ + static void + set_ref_in_py(const int copyID) + { +*************** +*** 2770,2772 **** +--- 2997,3165 ---- + return NULL; + } + } ++ ++ typedef struct ++ { ++ PyObject_HEAD ++ } CurrentObject; ++ static PyTypeObject CurrentType; ++ ++ static void ++ init_structs(void) ++ { ++ vim_memset(&OutputType, 0, sizeof(OutputType)); ++ OutputType.tp_name = "vim.message"; ++ OutputType.tp_basicsize = sizeof(OutputObject); ++ OutputType.tp_flags = Py_TPFLAGS_DEFAULT; ++ OutputType.tp_doc = "vim message object"; ++ OutputType.tp_methods = OutputMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ OutputType.tp_getattro = OutputGetattro; ++ OutputType.tp_setattro = OutputSetattro; ++ OutputType.tp_alloc = call_PyType_GenericAlloc; ++ OutputType.tp_new = call_PyType_GenericNew; ++ OutputType.tp_free = call_PyObject_Free; ++ #else ++ OutputType.tp_getattr = OutputGetattr; ++ OutputType.tp_setattr = OutputSetattr; ++ #endif ++ ++ vim_memset(&BufferType, 0, sizeof(BufferType)); ++ BufferType.tp_name = "vim.buffer"; ++ BufferType.tp_basicsize = sizeof(BufferType); ++ BufferType.tp_dealloc = BufferDestructor; ++ BufferType.tp_repr = BufferRepr; ++ BufferType.tp_as_sequence = &BufferAsSeq; ++ BufferType.tp_as_mapping = &BufferAsMapping; ++ BufferType.tp_flags = Py_TPFLAGS_DEFAULT; ++ BufferType.tp_doc = "vim buffer object"; ++ BufferType.tp_methods = BufferMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ BufferType.tp_getattro = BufferGetattro; ++ BufferType.tp_alloc = call_PyType_GenericAlloc; ++ BufferType.tp_new = call_PyType_GenericNew; ++ BufferType.tp_free = call_PyObject_Free; ++ #else ++ BufferType.tp_getattr = BufferGetattr; ++ #endif ++ ++ vim_memset(&WindowType, 0, sizeof(WindowType)); ++ WindowType.tp_name = "vim.window"; ++ WindowType.tp_basicsize = sizeof(WindowObject); ++ WindowType.tp_dealloc = WindowDestructor; ++ WindowType.tp_repr = WindowRepr; ++ WindowType.tp_flags = Py_TPFLAGS_DEFAULT; ++ WindowType.tp_doc = "vim Window object"; ++ WindowType.tp_methods = WindowMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ WindowType.tp_getattro = WindowGetattro; ++ WindowType.tp_setattro = WindowSetattro; ++ WindowType.tp_alloc = call_PyType_GenericAlloc; ++ WindowType.tp_new = call_PyType_GenericNew; ++ WindowType.tp_free = call_PyObject_Free; ++ #else ++ WindowType.tp_getattr = WindowGetattr; ++ WindowType.tp_setattr = WindowSetattr; ++ #endif ++ ++ vim_memset(&BufListType, 0, sizeof(BufListType)); ++ BufListType.tp_name = "vim.bufferlist"; ++ BufListType.tp_basicsize = sizeof(BufListObject); ++ BufListType.tp_as_sequence = &BufListAsSeq; ++ BufListType.tp_flags = Py_TPFLAGS_DEFAULT; ++ BufferType.tp_doc = "vim buffer list"; ++ ++ vim_memset(&WinListType, 0, sizeof(WinListType)); ++ WinListType.tp_name = "vim.windowlist"; ++ WinListType.tp_basicsize = sizeof(WinListType); ++ WinListType.tp_as_sequence = &WinListAsSeq; ++ WinListType.tp_flags = Py_TPFLAGS_DEFAULT; ++ WinListType.tp_doc = "vim window list"; ++ ++ vim_memset(&RangeType, 0, sizeof(RangeType)); ++ RangeType.tp_name = "vim.range"; ++ RangeType.tp_basicsize = sizeof(RangeObject); ++ RangeType.tp_dealloc = RangeDestructor; ++ RangeType.tp_repr = RangeRepr; ++ RangeType.tp_as_sequence = &RangeAsSeq; ++ RangeType.tp_as_mapping = &RangeAsMapping; ++ RangeType.tp_flags = Py_TPFLAGS_DEFAULT; ++ RangeType.tp_doc = "vim Range object"; ++ RangeType.tp_methods = RangeMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ RangeType.tp_getattro = RangeGetattro; ++ RangeType.tp_alloc = call_PyType_GenericAlloc; ++ RangeType.tp_new = call_PyType_GenericNew; ++ RangeType.tp_free = call_PyObject_Free; ++ #else ++ RangeType.tp_getattr = RangeGetattr; ++ #endif ++ ++ vim_memset(&CurrentType, 0, sizeof(CurrentType)); ++ CurrentType.tp_name = "vim.currentdata"; ++ CurrentType.tp_basicsize = sizeof(CurrentObject); ++ CurrentType.tp_flags = Py_TPFLAGS_DEFAULT; ++ CurrentType.tp_doc = "vim current object"; ++ #if PY_MAJOR_VERSION >= 3 ++ CurrentType.tp_getattro = CurrentGetattro; ++ CurrentType.tp_setattro = CurrentSetattro; ++ #else ++ CurrentType.tp_getattr = CurrentGetattr; ++ CurrentType.tp_setattr = CurrentSetattr; ++ #endif ++ ++ vim_memset(&DictionaryType, 0, sizeof(DictionaryType)); ++ DictionaryType.tp_name = "vim.dictionary"; ++ DictionaryType.tp_basicsize = sizeof(DictionaryObject); ++ DictionaryType.tp_dealloc = DictionaryDestructor; ++ DictionaryType.tp_as_mapping = &DictionaryAsMapping; ++ DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT; ++ DictionaryType.tp_doc = "dictionary pushing modifications to vim structure"; ++ DictionaryType.tp_methods = DictionaryMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ DictionaryType.tp_getattro = DictionaryGetattro; ++ DictionaryType.tp_setattro = DictionarySetattro; ++ #else ++ DictionaryType.tp_getattr = DictionaryGetattr; ++ DictionaryType.tp_setattr = DictionarySetattr; ++ #endif ++ ++ vim_memset(&ListType, 0, sizeof(ListType)); ++ ListType.tp_name = "vim.list"; ++ ListType.tp_dealloc = ListDestructor; ++ ListType.tp_basicsize = sizeof(ListObject); ++ ListType.tp_as_sequence = &ListAsSeq; ++ ListType.tp_as_mapping = &ListAsMapping; ++ ListType.tp_flags = Py_TPFLAGS_DEFAULT; ++ ListType.tp_doc = "list pushing modifications to vim structure"; ++ ListType.tp_methods = ListMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ ListType.tp_getattro = ListGetattro; ++ ListType.tp_setattro = ListSetattro; ++ #else ++ ListType.tp_getattr = ListGetattr; ++ ListType.tp_setattr = ListSetattr; ++ #endif ++ ++ vim_memset(&FunctionType, 0, sizeof(FunctionType)); ++ FunctionType.tp_name = "vim.list"; ++ FunctionType.tp_basicsize = sizeof(FunctionObject); ++ FunctionType.tp_dealloc = FunctionDestructor; ++ FunctionType.tp_call = FunctionCall; ++ FunctionType.tp_flags = Py_TPFLAGS_DEFAULT; ++ FunctionType.tp_doc = "object that calls vim function"; ++ FunctionType.tp_methods = FunctionMethods; ++ #if PY_MAJOR_VERSION >= 3 ++ FunctionType.tp_getattro = FunctionGetattro; ++ #else ++ FunctionType.tp_getattr = FunctionGetattr; ++ #endif ++ ++ #if PY_MAJOR_VERSION >= 3 ++ vim_memset(&vimmodule, 0, sizeof(vimmodule)); ++ vimmodule.m_name = "vim"; ++ vimmodule.m_doc = "Vim Python interface\n"; ++ vimmodule.m_size = -1; ++ vimmodule.m_methods = VimMethods; ++ #endif ++ } +*** ../vim-7.3.908/src/if_python3.c 2013-04-24 13:04:21.000000000 +0200 +--- src/if_python3.c 2013-04-24 13:26:54.000000000 +0200 +*************** +*** 91,96 **** +--- 91,97 ---- + #define PyInt_Check(obj) PyLong_Check(obj) + #define PyInt_FromLong(i) PyLong_FromLong(i) + #define PyInt_AsLong(obj) PyLong_AsLong(obj) ++ #define Py_ssize_t_fmt "n" + + #if defined(DYNAMIC_PYTHON3) || defined(PROTO) + +*************** +*** 588,595 **** + static PyObject *LineToString(const char *); + static PyObject *BufferDir(PyObject *, PyObject *); + +- static PyTypeObject RangeType; +- + static int py3initialised = 0; + + #define PYINITIALISED py3initialised +--- 589,594 ---- +*************** +*** 620,636 **** + if (bytes != NULL) \ + Py_XDECREF(bytes); + +! /* +! * Include the code shared with if_python.c +! */ +! #include "if_py_both.h" +! +! #define GET_ATTR_STRING(name, nameobj) \ +! char *name = ""; \ +! if (PyUnicode_Check(nameobj)) \ +! name = _PyUnicode_AsString(nameobj) +! +! #define PY3OBJ_DELETED(obj) (obj->ob_base.ob_refcnt<=0) + + static void + call_PyObject_Free(void *p) +--- 619,625 ---- + if (bytes != NULL) \ + Py_XDECREF(bytes); + +! #define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self); + + static void + call_PyObject_Free(void *p) +*************** +*** 654,666 **** + return PyType_GenericAlloc(type,nitems); + } + + /****************************************************** + * Internal function prototypes. + */ + +- static Py_ssize_t RangeStart; +- static Py_ssize_t RangeEnd; +- + static PyObject *globals; + + static int PythonIO_Init(void); +--- 643,680 ---- + return PyType_GenericAlloc(type,nitems); + } + ++ static PyObject *OutputGetattro(PyObject *, PyObject *); ++ static int OutputSetattro(PyObject *, PyObject *, PyObject *); ++ static PyObject *BufferGetattro(PyObject *, PyObject *); ++ static PyObject *WindowGetattro(PyObject *, PyObject *); ++ static int WindowSetattro(PyObject *, PyObject *, PyObject *); ++ static PyObject *RangeGetattro(PyObject *, PyObject *); ++ static PyObject *CurrentGetattro(PyObject *, PyObject *); ++ static int CurrentSetattro(PyObject *, PyObject *, PyObject *); ++ static PyObject *DictionaryGetattro(PyObject *, PyObject *); ++ static int DictionarySetattro(PyObject *, PyObject *, PyObject *); ++ static PyObject *ListGetattro(PyObject *, PyObject *); ++ static int ListSetattro(PyObject *, PyObject *, PyObject *); ++ static PyObject *FunctionGetattro(PyObject *, PyObject *); ++ ++ static struct PyModuleDef vimmodule; ++ ++ /* ++ * Include the code shared with if_python.c ++ */ ++ #include "if_py_both.h" ++ ++ #define GET_ATTR_STRING(name, nameobj) \ ++ char *name = ""; \ ++ if (PyUnicode_Check(nameobj)) \ ++ name = _PyUnicode_AsString(nameobj) ++ ++ #define PY3OBJ_DELETED(obj) (obj->ob_base.ob_refcnt<=0) ++ + /****************************************************** + * Internal function prototypes. + */ + + static PyObject *globals; + + static int PythonIO_Init(void); +*************** +*** 1046,1052 **** + 0, /* sq_inplace_repeat */ + }; + +! PyMappingMethods BufferAsMapping = { + /* mp_length */ (lenfunc)BufferLength, + /* mp_subscript */ (binaryfunc)BufferSubscript, + /* mp_ass_subscript */ (objobjargproc)BufferAsSubscript, +--- 1060,1066 ---- + 0, /* sq_inplace_repeat */ + }; + +! static PyMappingMethods BufferAsMapping = { + /* mp_length */ (lenfunc)BufferLength, + /* mp_subscript */ (binaryfunc)BufferSubscript, + /* mp_ass_subscript */ (objobjargproc)BufferAsSubscript, +*************** +*** 1056,1063 **** + /* Buffer object - Definitions + */ + +- static PyTypeObject BufferType; +- + static PyObject * + BufferNew(buf_T *buf) + { +--- 1070,1075 ---- +*************** +*** 1094,1124 **** + return (PyObject *)(self); + } + +- static void +- BufferDestructor(PyObject *self) +- { +- BufferObject *this = (BufferObject *)(self); +- +- if (this->buf && this->buf != INVALID_BUFFER_VALUE) +- this->buf->b_python3_ref = NULL; +- +- Py_TYPE(self)->tp_free((PyObject*)self); +- } +- + static PyObject * + BufferGetattro(PyObject *self, PyObject*nameobj) + { +! BufferObject *this = (BufferObject *)(self); + + GET_ATTR_STRING(name, nameobj); + +! if (CheckBuffer(this)) + return NULL; + +! if (strcmp(name, "name") == 0) +! return Py_BuildValue("s", this->buf->b_ffname); +! else if (strcmp(name, "number") == 0) +! return Py_BuildValue("n", this->buf->b_fnum); + else + return PyObject_GenericGetAttr(self, nameobj); + } +--- 1106,1124 ---- + return (PyObject *)(self); + } + + static PyObject * + BufferGetattro(PyObject *self, PyObject*nameobj) + { +! PyObject *r; + + GET_ATTR_STRING(name, nameobj); + +! if (CheckBuffer((BufferObject *)(self))) + return NULL; + +! r = BufferAttr((BufferObject *)(self), name); +! if (r || PyErr_Occurred()) +! return r; + else + return PyObject_GenericGetAttr(self, nameobj); + } +*************** +*** 1130,1164 **** + "append", "mark", "range"); + } + +- static PyObject * +- BufferRepr(PyObject *self) +- { +- static char repr[100]; +- BufferObject *this = (BufferObject *)(self); +- +- if (this->buf == INVALID_BUFFER_VALUE) +- { +- vim_snprintf(repr, 100, _(""), (self)); +- return PyUnicode_FromString(repr); +- } +- else +- { +- char *name = (char *)this->buf->b_fname; +- Py_ssize_t len; +- +- if (name == NULL) +- name = ""; +- len = strlen(name); +- +- if (len > 35) +- name = name + (35 - len); +- +- vim_snprintf(repr, 100, "", len > 35 ? "..." : "", name); +- +- return PyUnicode_FromString(repr); +- } +- } +- + /******************/ + + static Py_ssize_t +--- 1130,1135 ---- +*************** +*** 1255,1261 **** + 0, /* sq_inplace_repeat */ + }; + +! PyMappingMethods RangeAsMapping = { + /* mp_length */ (lenfunc)RangeLength, + /* mp_subscript */ (binaryfunc)RangeSubscript, + /* mp_ass_subscript */ (objobjargproc)RangeAsSubscript, +--- 1226,1232 ---- + 0, /* sq_inplace_repeat */ + }; + +! static PyMappingMethods RangeAsMapping = { + /* mp_length */ (lenfunc)RangeLength, + /* mp_subscript */ (binaryfunc)RangeSubscript, + /* mp_ass_subscript */ (objobjargproc)RangeAsSubscript, +*************** +*** 1264,1276 **** + /* Line range object - Implementation + */ + +- static void +- RangeDestructor(PyObject *self) +- { +- Py_DECREF(((RangeObject *)(self))->buf); +- Py_TYPE(self)->tp_free((PyObject*)self); +- } +- + static PyObject * + RangeGetattro(PyObject *self, PyObject *nameobj) + { +--- 1235,1240 ---- +*************** +*** 1358,1372 **** + } + } + +- + /* Buffer list object - Definitions + */ + +- typedef struct +- { +- PyObject_HEAD +- } BufListObject; +- + static PySequenceMethods BufListAsSeq = { + (lenfunc) BufListLength, /* sq_length, len(x) */ + (binaryfunc) 0, /* sq_concat, x+y */ +--- 1322,1330 ---- +*************** +*** 1380,1397 **** + 0, /* sq_inplace_repeat */ + }; + +- static PyTypeObject BufListType; +- +- /* Window object - Definitions +- */ +- +- static struct PyMethodDef WindowMethods[] = { +- /* name, function, calling, documentation */ +- { NULL, NULL, 0, NULL } +- }; +- +- static PyTypeObject WindowType; +- + /* Window object - Implementation + */ + +--- 1338,1343 ---- +*************** +*** 1429,1471 **** + return (PyObject *)(self); + } + +- static void +- WindowDestructor(PyObject *self) +- { +- WindowObject *this = (WindowObject *)(self); +- +- if (this->win && this->win != INVALID_WINDOW_VALUE) +- this->win->w_python3_ref = NULL; +- +- Py_TYPE(self)->tp_free((PyObject*)self); +- } +- + static PyObject * + WindowGetattro(PyObject *self, PyObject *nameobj) + { +! WindowObject *this = (WindowObject *)(self); + + GET_ATTR_STRING(name, nameobj); + +! if (CheckWindow(this)) + return NULL; + +! if (strcmp(name, "buffer") == 0) +! return (PyObject *)BufferNew(this->win->w_buffer); +! else if (strcmp(name, "cursor") == 0) +! { +! pos_T *pos = &this->win->w_cursor; +! +! return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); +! } +! else if (strcmp(name, "height") == 0) +! return Py_BuildValue("l", (long)(this->win->w_height)); +! #ifdef FEAT_VERTSPLIT +! else if (strcmp(name, "width") == 0) +! return Py_BuildValue("l", (long)(W_WIDTH(this->win))); +! #endif +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sss]", "buffer", "cursor", "height"); + else + return PyObject_GenericGetAttr(self, nameobj); + } +--- 1375,1393 ---- + return (PyObject *)(self); + } + + static PyObject * + WindowGetattro(PyObject *self, PyObject *nameobj) + { +! PyObject *r; + + GET_ATTR_STRING(name, nameobj); + +! if (CheckWindow((WindowObject *)(self))) + return NULL; + +! r = WindowAttr((WindowObject *)(self), name); +! if (r || PyErr_Occurred()) +! return r; + else + return PyObject_GenericGetAttr(self, nameobj); + } +*************** +*** 1481,1492 **** + /* Window list object - Definitions + */ + +- typedef struct +- { +- PyObject_HEAD +- } +- WinListObject; +- + static PySequenceMethods WinListAsSeq = { + (lenfunc) WinListLength, /* sq_length, len(x) */ + (binaryfunc) 0, /* sq_concat, x+y */ +--- 1403,1408 ---- +*************** +*** 1500,1560 **** + 0, /* sq_inplace_repeat */ + }; + +- static PyTypeObject WinListType; +- +- /* Current items object - Definitions +- */ +- +- typedef struct +- { +- PyObject_HEAD +- } CurrentObject; +- +- static PyTypeObject CurrentType; +- + /* Current items object - Implementation + */ + static PyObject * +! CurrentGetattro(PyObject *self UNUSED, PyObject *nameobj) + { + GET_ATTR_STRING(name, nameobj); +! +! if (strcmp(name, "buffer") == 0) +! return (PyObject *)BufferNew(curbuf); +! else if (strcmp(name, "window") == 0) +! return (PyObject *)WindowNew(curwin); +! else if (strcmp(name, "line") == 0) +! return GetBufferLine(curbuf, (Py_ssize_t)curwin->w_cursor.lnum); +! else if (strcmp(name, "range") == 0) +! return RangeNew(curbuf, RangeStart, RangeEnd); +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssss]", "buffer", "window", "line", "range"); +! else +! { +! PyErr_SetString(PyExc_AttributeError, name); +! return NULL; +! } + } + + static int +! CurrentSetattro(PyObject *self UNUSED, PyObject *nameobj, PyObject *value) + { +! char *name = ""; +! if (PyUnicode_Check(nameobj)) +! name = _PyUnicode_AsString(nameobj); +! +! if (strcmp(name, "line") == 0) +! { +! if (SetBufferLine(curbuf, (Py_ssize_t)curwin->w_cursor.lnum, value, NULL) == FAIL) +! return -1; +! +! return 0; +! } +! else +! { +! PyErr_SetString(PyExc_AttributeError, name); +! return -1; +! } + } + + /* Dictionary object - Definitions +--- 1416,1435 ---- + 0, /* sq_inplace_repeat */ + }; + + /* Current items object - Implementation + */ + static PyObject * +! CurrentGetattro(PyObject *self, PyObject *nameobj) + { + GET_ATTR_STRING(name, nameobj); +! return CurrentGetattr(self, name); + } + + static int +! CurrentSetattro(PyObject *self, PyObject *nameobj, PyObject *value) + { +! GET_ATTR_STRING(name, nameobj); +! return CurrentSetattr(self, name, value); + } + + /* Dictionary object - Definitions +*************** +*** 1562,1573 **** + + static PyInt DictionaryLength(PyObject *); + +- static PyMappingMethods DictionaryAsMapping = { +- /* mp_length */ (lenfunc) DictionaryLength, +- /* mp_subscript */ (binaryfunc) DictionaryItem, +- /* mp_ass_subscript */ (objobjargproc) DictionaryAssItem, +- }; +- + static PyObject * + DictionaryGetattro(PyObject *self, PyObject *nameobj) + { +--- 1437,1442 ---- +*************** +*** 1587,1606 **** + DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val) + { + GET_ATTR_STRING(name, nameobj); +! return DictionarySetattr((DictionaryObject *) self, name, val); +! } +! +! static PyTypeObject DictionaryType; +! +! static void +! DictionaryDestructor(PyObject *self) +! { +! DictionaryObject *this = (DictionaryObject *)(self); +! +! pyll_remove(&this->ref, &lastdict); +! dict_unref(this->dict); +! +! Py_TYPE(self)->tp_free((PyObject*)self); + } + + /* List object - Definitions +--- 1456,1462 ---- + DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val) + { + GET_ATTR_STRING(name, nameobj); +! return DictionarySetattr(self, name, val); + } + + /* List object - Definitions +*************** +*** 1631,1638 **** + /* mp_ass_subscript */ (objobjargproc) ListAsSubscript, + }; + +- static PyTypeObject ListType; +- + static PyObject * + ListSubscript(PyObject *self, PyObject* idxObject) + { +--- 1487,1492 ---- +*************** +*** 1696,1729 **** + ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val) + { + GET_ATTR_STRING(name, nameobj); +! return ListSetattr((ListObject *) self, name, val); +! } +! +! static void +! ListDestructor(PyObject *self) +! { +! ListObject *this = (ListObject *)(self); +! +! pyll_remove(&this->ref, &lastlist); +! list_unref(this->list); +! +! Py_TYPE(self)->tp_free((PyObject*)self); + } + + /* Function object - Definitions + */ + +- static void +- FunctionDestructor(PyObject *self) +- { +- FunctionObject *this = (FunctionObject *) (self); +- +- func_unref(this->name); +- PyMem_Del(this->name); +- +- Py_TYPE(self)->tp_free((PyObject*)self); +- } +- + static PyObject * + FunctionGetattro(PyObject *self, PyObject *nameobj) + { +--- 1550,1561 ---- + ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val) + { + GET_ATTR_STRING(name, nameobj); +! return ListSetattr(self, name, val); + } + + /* Function object - Definitions + */ + + static PyObject * + FunctionGetattro(PyObject *self, PyObject *nameobj) + { +*************** +*** 1779,1788 **** + PyObject_HEAD_INIT(&CurrentType) + }; + +- PyDoc_STRVAR(vim_module_doc,"vim python interface\n"); +- +- static struct PyModuleDef vimmodule; +- + static PyObject * + Py3Init_vim(void) + { +--- 1611,1616 ---- +*************** +*** 1898,2021 **** + { + set_ref_in_py(copyID); + } +- +- static void +- init_structs(void) +- { +- vim_memset(&OutputType, 0, sizeof(OutputType)); +- OutputType.tp_name = "vim.message"; +- OutputType.tp_basicsize = sizeof(OutputObject); +- OutputType.tp_getattro = OutputGetattro; +- OutputType.tp_setattro = OutputSetattro; +- OutputType.tp_flags = Py_TPFLAGS_DEFAULT; +- OutputType.tp_doc = "vim message object"; +- OutputType.tp_methods = OutputMethods; +- OutputType.tp_alloc = call_PyType_GenericAlloc; +- OutputType.tp_new = call_PyType_GenericNew; +- OutputType.tp_free = call_PyObject_Free; +- +- vim_memset(&BufferType, 0, sizeof(BufferType)); +- BufferType.tp_name = "vim.buffer"; +- BufferType.tp_basicsize = sizeof(BufferType); +- BufferType.tp_dealloc = BufferDestructor; +- BufferType.tp_repr = BufferRepr; +- BufferType.tp_as_sequence = &BufferAsSeq; +- BufferType.tp_as_mapping = &BufferAsMapping; +- BufferType.tp_getattro = BufferGetattro; +- BufferType.tp_flags = Py_TPFLAGS_DEFAULT; +- BufferType.tp_doc = "vim buffer object"; +- BufferType.tp_methods = BufferMethods; +- BufferType.tp_alloc = call_PyType_GenericAlloc; +- BufferType.tp_new = call_PyType_GenericNew; +- BufferType.tp_free = call_PyObject_Free; +- +- vim_memset(&WindowType, 0, sizeof(WindowType)); +- WindowType.tp_name = "vim.window"; +- WindowType.tp_basicsize = sizeof(WindowObject); +- WindowType.tp_dealloc = WindowDestructor; +- WindowType.tp_repr = WindowRepr; +- WindowType.tp_getattro = WindowGetattro; +- WindowType.tp_setattro = WindowSetattro; +- WindowType.tp_flags = Py_TPFLAGS_DEFAULT; +- WindowType.tp_doc = "vim Window object"; +- WindowType.tp_methods = WindowMethods; +- WindowType.tp_alloc = call_PyType_GenericAlloc; +- WindowType.tp_new = call_PyType_GenericNew; +- WindowType.tp_free = call_PyObject_Free; +- +- vim_memset(&BufListType, 0, sizeof(BufListType)); +- BufListType.tp_name = "vim.bufferlist"; +- BufListType.tp_basicsize = sizeof(BufListObject); +- BufListType.tp_as_sequence = &BufListAsSeq; +- BufListType.tp_flags = Py_TPFLAGS_DEFAULT; +- BufferType.tp_doc = "vim buffer list"; +- +- vim_memset(&WinListType, 0, sizeof(WinListType)); +- WinListType.tp_name = "vim.windowlist"; +- WinListType.tp_basicsize = sizeof(WinListType); +- WinListType.tp_as_sequence = &WinListAsSeq; +- WinListType.tp_flags = Py_TPFLAGS_DEFAULT; +- WinListType.tp_doc = "vim window list"; +- +- vim_memset(&RangeType, 0, sizeof(RangeType)); +- RangeType.tp_name = "vim.range"; +- RangeType.tp_basicsize = sizeof(RangeObject); +- RangeType.tp_dealloc = RangeDestructor; +- RangeType.tp_repr = RangeRepr; +- RangeType.tp_as_sequence = &RangeAsSeq; +- RangeType.tp_as_mapping = &RangeAsMapping; +- RangeType.tp_getattro = RangeGetattro; +- RangeType.tp_flags = Py_TPFLAGS_DEFAULT; +- RangeType.tp_doc = "vim Range object"; +- RangeType.tp_methods = RangeMethods; +- RangeType.tp_alloc = call_PyType_GenericAlloc; +- RangeType.tp_new = call_PyType_GenericNew; +- RangeType.tp_free = call_PyObject_Free; +- +- vim_memset(&CurrentType, 0, sizeof(CurrentType)); +- CurrentType.tp_name = "vim.currentdata"; +- CurrentType.tp_basicsize = sizeof(CurrentObject); +- CurrentType.tp_getattro = CurrentGetattro; +- CurrentType.tp_setattro = CurrentSetattro; +- CurrentType.tp_flags = Py_TPFLAGS_DEFAULT; +- CurrentType.tp_doc = "vim current object"; +- +- vim_memset(&DictionaryType, 0, sizeof(DictionaryType)); +- DictionaryType.tp_name = "vim.dictionary"; +- DictionaryType.tp_basicsize = sizeof(DictionaryObject); +- DictionaryType.tp_getattro = DictionaryGetattro; +- DictionaryType.tp_setattro = DictionarySetattro; +- DictionaryType.tp_dealloc = DictionaryDestructor; +- DictionaryType.tp_as_mapping = &DictionaryAsMapping; +- DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT; +- DictionaryType.tp_doc = "dictionary pushing modifications to vim structure"; +- DictionaryType.tp_methods = DictionaryMethods; +- +- vim_memset(&ListType, 0, sizeof(ListType)); +- ListType.tp_name = "vim.list"; +- ListType.tp_dealloc = ListDestructor; +- ListType.tp_basicsize = sizeof(ListObject); +- ListType.tp_getattro = ListGetattro; +- ListType.tp_setattro = ListSetattro; +- ListType.tp_as_sequence = &ListAsSeq; +- ListType.tp_as_mapping = &ListAsMapping; +- ListType.tp_flags = Py_TPFLAGS_DEFAULT; +- ListType.tp_doc = "list pushing modifications to vim structure"; +- ListType.tp_methods = ListMethods; +- +- vim_memset(&FunctionType, 0, sizeof(FunctionType)); +- FunctionType.tp_name = "vim.list"; +- FunctionType.tp_basicsize = sizeof(FunctionObject); +- FunctionType.tp_getattro = FunctionGetattro; +- FunctionType.tp_dealloc = FunctionDestructor; +- FunctionType.tp_call = FunctionCall; +- FunctionType.tp_flags = Py_TPFLAGS_DEFAULT; +- FunctionType.tp_doc = "object that calls vim function"; +- FunctionType.tp_methods = FunctionMethods; +- +- vim_memset(&vimmodule, 0, sizeof(vimmodule)); +- vimmodule.m_name = "vim"; +- vimmodule.m_doc = vim_module_doc; +- vimmodule.m_size = -1; +- vimmodule.m_methods = VimMethods; +- } +--- 1726,1728 ---- +*** ../vim-7.3.908/src/if_python.c 2013-04-24 13:04:21.000000000 +0200 +--- src/if_python.c 2013-04-24 13:35:06.000000000 +0200 +*************** +*** 87,92 **** +--- 87,93 ---- + # define Py_ssize_t_fmt "n" + #else + # define PyInt int ++ # define lenfunc inquiry + # define PyInquiry inquiry + # define PyIntArgFunc intargfunc + # define PyIntIntArgFunc intintargfunc +*************** +*** 600,607 **** + static PyObject *DictionaryNew(dict_T *); + static PyObject *LineToString(const char *); + +- static PyTypeObject RangeType; +- + static int initialised = 0; + #define PYINITIALISED initialised + +--- 601,606 ---- +*************** +*** 617,622 **** +--- 616,631 ---- + #define DICTKEY_UNREF + #define DICTKEY_DECL + ++ #define DESTRUCTOR_FINISH(self) Py_DECREF(self); ++ ++ static PyObject *OutputGetattr(PyObject *, char *); ++ static PyObject *BufferGetattr(PyObject *, char *); ++ static PyObject *WindowGetattr(PyObject *, char *); ++ static PyObject *RangeGetattr(PyObject *, char *); ++ static PyObject *DictionaryGetattr(PyObject *, char*); ++ static PyObject *ListGetattr(PyObject *, char *); ++ static PyObject *FunctionGetattr(PyObject *, char *); ++ + /* + * Include the code shared with if_python3.c + */ +*************** +*** 627,635 **** + * Internal function prototypes. + */ + +- static PyInt RangeStart; +- static PyInt RangeEnd; +- + static PyObject *globals; + + static void PythonIO_Flush(void); +--- 636,641 ---- +*************** +*** 1003,1021 **** + + #define WindowType_Check(obj) ((obj)->ob_type == &WindowType) + +- static void WindowDestructor(PyObject *); +- static PyObject *WindowGetattr(PyObject *, char *); +- + /* Buffer type - Implementation functions + * -------------------------------------- + */ + + #define BufferType_Check(obj) ((obj)->ob_type == &BufferType) + +- static void BufferDestructor(PyObject *); +- static PyObject *BufferGetattr(PyObject *, char *); +- static PyObject *BufferRepr(PyObject *); +- + static PyInt BufferLength(PyObject *); + static PyObject *BufferItem(PyObject *, PyInt); + static PyObject *BufferSlice(PyObject *, PyInt, PyInt); +--- 1009,1020 ---- +*************** +*** 1035,1043 **** + * ----------------------------------------------- + */ + +- static PyObject *CurrentGetattr(PyObject *, char *); +- static int CurrentSetattr(PyObject *, char *, PyObject *); +- + static PySequenceMethods BufferAsSeq = { + (PyInquiry) BufferLength, /* sq_length, len(x) */ + (binaryfunc) 0, /* BufferConcat, sq_concat, x+y */ +--- 1034,1039 ---- +*************** +*** 1045,1074 **** + (PyIntArgFunc) BufferItem, /* sq_item, x[i] */ + (PyIntIntArgFunc) BufferSlice, /* sq_slice, x[i:j] */ + (PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */ +! }; +! +! static PyTypeObject BufferType = { +! PyObject_HEAD_INIT(0) +! 0, +! "buffer", +! sizeof(BufferObject), + 0, +! +! (destructor) BufferDestructor, /* tp_dealloc, refcount==0 */ +! (printfunc) 0, /* tp_print, print x */ +! (getattrfunc) BufferGetattr, /* tp_getattr, x.attr */ +! (setattrfunc) 0, /* tp_setattr, x.attr=v */ +! (cmpfunc) 0, /* tp_compare, x>y */ +! (reprfunc) BufferRepr, /* tp_repr, `x`, print x */ +! +! 0, /* as number */ +! &BufferAsSeq, /* as sequence */ +! 0, /* as mapping */ +! +! (hashfunc) 0, /* tp_hash, dict(x) */ +! (ternaryfunc) 0, /* tp_call, x() */ +! (reprfunc) 0, /* tp_str, str(x) */ + }; + + /* Buffer object - Implementation +--- 1041,1052 ---- + (PyIntArgFunc) BufferItem, /* sq_item, x[i] */ + (PyIntIntArgFunc) BufferSlice, /* sq_slice, x[i:j] */ + (PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */ +! (objobjproc) 0, +! #if PY_MAJOR_VERSION >= 2 +! (binaryfunc) 0, + 0, +! #endif + }; + + /* Buffer object - Implementation +*************** +*** 1110,1173 **** + return (PyObject *)(self); + } + +- static void +- BufferDestructor(PyObject *self) +- { +- BufferObject *this = (BufferObject *)(self); +- +- if (this->buf && this->buf != INVALID_BUFFER_VALUE) +- this->buf->b_python_ref = NULL; +- +- Py_DECREF(self); +- } +- + static PyObject * + BufferGetattr(PyObject *self, char *name) + { +! BufferObject *this = (BufferObject *)(self); + +! if (CheckBuffer(this)) + return NULL; + +! if (strcmp(name, "name") == 0) +! return Py_BuildValue("s", this->buf->b_ffname); +! else if (strcmp(name, "number") == 0) +! return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ss]", "name", "number"); + else + return Py_FindMethod(BufferMethods, self, name); + } + +- static PyObject * +- BufferRepr(PyObject *self) +- { +- static char repr[100]; +- BufferObject *this = (BufferObject *)(self); +- +- if (this->buf == INVALID_BUFFER_VALUE) +- { +- vim_snprintf(repr, 100, _(""), (self)); +- return PyString_FromString(repr); +- } +- else +- { +- char *name = (char *)this->buf->b_fname; +- PyInt len; +- +- if (name == NULL) +- name = ""; +- len = strlen(name); +- +- if (len > 35) +- name = name + (35 - len); +- +- vim_snprintf(repr, 100, "", len > 35 ? "..." : "", name); +- +- return PyString_FromString(repr); +- } +- } +- + /******************/ + + static PyInt +--- 1088,1108 ---- + return (PyObject *)(self); + } + + static PyObject * + BufferGetattr(PyObject *self, char *name) + { +! PyObject *r; + +! if (CheckBuffer((BufferObject *)(self))) + return NULL; + +! r = BufferAttr((BufferObject *)(self), name); +! if (r || PyErr_Occurred()) +! return r; + else + return Py_FindMethod(BufferMethods, self, name); + } + + /******************/ + + static PyInt +*************** +*** 1211,1235 **** + } + + static PySequenceMethods RangeAsSeq = { +! (PyInquiry) RangeLength, /* sq_length, len(x) */ +! (binaryfunc) 0, /* RangeConcat, */ /* sq_concat, x+y */ +! (PyIntArgFunc) 0, /* RangeRepeat, */ /* sq_repeat, x*n */ +! (PyIntArgFunc) RangeItem, /* sq_item, x[i] */ +! (PyIntIntArgFunc) RangeSlice, /* sq_slice, x[i:j] */ +! (PyIntObjArgProc) RangeAssItem, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) RangeAssSlice, /* sq_ass_slice, x[i:j]=v */ + }; + + /* Line range object - Implementation + */ + +- static void +- RangeDestructor(PyObject *self) +- { +- Py_DECREF(((RangeObject *)(self))->buf); +- Py_DECREF(self); +- } +- + static PyObject * + RangeGetattr(PyObject *self, char *name) + { +--- 1146,1168 ---- + } + + static PySequenceMethods RangeAsSeq = { +! (PyInquiry) RangeLength, /* sq_length, len(x) */ +! (binaryfunc) 0, /* RangeConcat, */ /* sq_concat, x+y */ +! (PyIntArgFunc) 0, /* RangeRepeat, */ /* sq_repeat, x*n */ +! (PyIntArgFunc) RangeItem, /* sq_item, x[i] */ +! (PyIntIntArgFunc) RangeSlice, /* sq_slice, x[i:j] */ +! (PyIntObjArgProc) RangeAssItem, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) RangeAssSlice, /* sq_ass_slice, x[i:j]=v */ +! (objobjproc) 0, +! #if PY_MAJOR_VERSION >= 2 +! (binaryfunc) 0, +! 0, +! #endif + }; + + /* Line range object - Implementation + */ + + static PyObject * + RangeGetattr(PyObject *self, char *name) + { +*************** +*** 1264,1274 **** + /* Buffer list object - Definitions + */ + +- typedef struct +- { +- PyObject_HEAD +- } BufListObject; +- + static PySequenceMethods BufListAsSeq = { + (PyInquiry) BufListLength, /* sq_length, len(x) */ + (binaryfunc) 0, /* sq_concat, x+y */ +--- 1197,1202 ---- +*************** +*** 1276,1336 **** + (PyIntArgFunc) BufListItem, /* sq_item, x[i] */ + (PyIntIntArgFunc) 0, /* sq_slice, x[i:j] */ + (PyIntObjArgProc) 0, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) 0, /* sq_ass_slice, x[i:j]=v */ +! }; +! +! static PyTypeObject BufListType = { +! PyObject_HEAD_INIT(0) +! 0, +! "buffer list", +! sizeof(BufListObject), +! 0, +! +! (destructor) 0, /* tp_dealloc, refcount==0 */ +! (printfunc) 0, /* tp_print, print x */ +! (getattrfunc) 0, /* tp_getattr, x.attr */ +! (setattrfunc) 0, /* tp_setattr, x.attr=v */ +! (cmpfunc) 0, /* tp_compare, x>y */ +! (reprfunc) 0, /* tp_repr, `x`, print x */ +! +! 0, /* as number */ +! &BufListAsSeq, /* as sequence */ +! 0, /* as mapping */ +! +! (hashfunc) 0, /* tp_hash, dict(x) */ +! (ternaryfunc) 0, /* tp_call, x() */ +! (reprfunc) 0, /* tp_str, str(x) */ +! }; +! +! /* Window object - Definitions +! */ +! +! static struct PyMethodDef WindowMethods[] = { +! /* name, function, calling, documentation */ +! { NULL, NULL, 0, NULL } +! }; +! +! static PyTypeObject WindowType = { +! PyObject_HEAD_INIT(0) +! 0, +! "window", +! sizeof(WindowObject), + 0, +! +! (destructor) WindowDestructor, /* tp_dealloc, refcount==0 */ +! (printfunc) 0, /* tp_print, print x */ +! (getattrfunc) WindowGetattr, /* tp_getattr, x.attr */ +! (setattrfunc) WindowSetattr, /* tp_setattr, x.attr=v */ +! (cmpfunc) 0, /* tp_compare, x>y */ +! (reprfunc) WindowRepr, /* tp_repr, `x`, print x */ +! +! 0, /* as number */ +! 0, /* as sequence */ +! 0, /* as mapping */ +! +! (hashfunc) 0, /* tp_hash, dict(x) */ +! (ternaryfunc) 0, /* tp_call, x() */ +! (reprfunc) 0, /* tp_str, str(x) */ + }; + + /* Window object - Implementation +--- 1204,1215 ---- + (PyIntArgFunc) BufListItem, /* sq_item, x[i] */ + (PyIntIntArgFunc) 0, /* sq_slice, x[i:j] */ + (PyIntObjArgProc) 0, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) 0, /* sq_ass_slice, x[i:j]=v */ +! (objobjproc) 0, +! #if PY_MAJOR_VERSION >= 2 +! (binaryfunc) 0, + 0, +! #endif + }; + + /* Window object - Implementation +*************** +*** 1370,1410 **** + return (PyObject *)(self); + } + +- static void +- WindowDestructor(PyObject *self) +- { +- WindowObject *this = (WindowObject *)(self); +- +- if (this->win && this->win != INVALID_WINDOW_VALUE) +- this->win->w_python_ref = NULL; +- +- Py_DECREF(self); +- } +- + static PyObject * + WindowGetattr(PyObject *self, char *name) + { +! WindowObject *this = (WindowObject *)(self); + +! if (CheckWindow(this)) + return NULL; + +! if (strcmp(name, "buffer") == 0) +! return (PyObject *)BufferNew(this->win->w_buffer); +! else if (strcmp(name, "cursor") == 0) +! { +! pos_T *pos = &this->win->w_cursor; +! +! return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); +! } +! else if (strcmp(name, "height") == 0) +! return Py_BuildValue("l", (long)(this->win->w_height)); +! #ifdef FEAT_VERTSPLIT +! else if (strcmp(name, "width") == 0) +! return Py_BuildValue("l", (long)(W_WIDTH(this->win))); +! #endif +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sss]", "buffer", "cursor", "height"); + else + return Py_FindMethod(WindowMethods, self, name); + } +--- 1249,1265 ---- + return (PyObject *)(self); + } + + static PyObject * + WindowGetattr(PyObject *self, char *name) + { +! PyObject *r; + +! if (CheckWindow((WindowObject *)(self))) + return NULL; + +! r = WindowAttr((WindowObject *)(self), name); +! if (r || PyErr_Occurred()) +! return r; + else + return Py_FindMethod(WindowMethods, self, name); + } +*************** +*** 1412,1423 **** + /* Window list object - Definitions + */ + +- typedef struct +- { +- PyObject_HEAD +- } +- WinListObject; +- + static PySequenceMethods WinListAsSeq = { + (PyInquiry) WinListLength, /* sq_length, len(x) */ + (binaryfunc) 0, /* sq_concat, x+y */ +--- 1267,1272 ---- +*************** +*** 1425,1526 **** + (PyIntArgFunc) WinListItem, /* sq_item, x[i] */ + (PyIntIntArgFunc) 0, /* sq_slice, x[i:j] */ + (PyIntObjArgProc) 0, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) 0, /* sq_ass_slice, x[i:j]=v */ +! }; +! +! static PyTypeObject WinListType = { +! PyObject_HEAD_INIT(0) +! 0, +! "window list", +! sizeof(WinListObject), +! 0, +! +! (destructor) 0, /* tp_dealloc, refcount==0 */ +! (printfunc) 0, /* tp_print, print x */ +! (getattrfunc) 0, /* tp_getattr, x.attr */ +! (setattrfunc) 0, /* tp_setattr, x.attr=v */ +! (cmpfunc) 0, /* tp_compare, x>y */ +! (reprfunc) 0, /* tp_repr, `x`, print x */ +! +! 0, /* as number */ +! &WinListAsSeq, /* as sequence */ +! 0, /* as mapping */ +! +! (hashfunc) 0, /* tp_hash, dict(x) */ +! (ternaryfunc) 0, /* tp_call, x() */ +! (reprfunc) 0, /* tp_str, str(x) */ +! }; +! +! /* Current items object - Definitions +! */ +! +! typedef struct +! { +! PyObject_HEAD +! } CurrentObject; +! +! static PyTypeObject CurrentType = { +! PyObject_HEAD_INIT(0) +! 0, +! "current data", +! sizeof(CurrentObject), + 0, +! +! (destructor) 0, /* tp_dealloc, refcount==0 */ +! (printfunc) 0, /* tp_print, print x */ +! (getattrfunc) CurrentGetattr, /* tp_getattr, x.attr */ +! (setattrfunc) CurrentSetattr, /* tp_setattr, x.attr=v */ +! (cmpfunc) 0, /* tp_compare, x>y */ +! (reprfunc) 0, /* tp_repr, `x`, print x */ +! +! 0, /* as number */ +! 0, /* as sequence */ +! 0, /* as mapping */ +! +! (hashfunc) 0, /* tp_hash, dict(x) */ +! (ternaryfunc) 0, /* tp_call, x() */ +! (reprfunc) 0, /* tp_str, str(x) */ + }; + +- /* Current items object - Implementation +- */ +- static PyObject * +- CurrentGetattr(PyObject *self UNUSED, char *name) +- { +- if (strcmp(name, "buffer") == 0) +- return (PyObject *)BufferNew(curbuf); +- else if (strcmp(name, "window") == 0) +- return (PyObject *)WindowNew(curwin); +- else if (strcmp(name, "line") == 0) +- 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) +- return Py_BuildValue("[ssss]", "buffer", "window", "line", "range"); +- else +- { +- PyErr_SetString(PyExc_AttributeError, name); +- return NULL; +- } +- } +- +- static int +- CurrentSetattr(PyObject *self UNUSED, char *name, PyObject *value) +- { +- if (strcmp(name, "line") == 0) +- { +- if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, value, NULL) == FAIL) +- return -1; +- +- return 0; +- } +- else +- { +- PyErr_SetString(PyExc_AttributeError, name); +- return -1; +- } +- } +- + /* External interface + */ + +--- 1274,1287 ---- + (PyIntArgFunc) WinListItem, /* sq_item, x[i] */ + (PyIntIntArgFunc) 0, /* sq_slice, x[i:j] */ + (PyIntObjArgProc) 0, /* sq_ass_item, x[i]=v */ +! (PyIntIntObjArgProc) 0, /* sq_ass_slice, x[i:j]=v */ +! (objobjproc) 0, +! #if PY_MAJOR_VERSION >= 2 +! (binaryfunc) 0, + 0, +! #endif + }; + + /* External interface + */ + +*************** +*** 1642,1690 **** + return result; + } + +- static void DictionaryDestructor(PyObject *); +- static PyObject *DictionaryGetattr(PyObject *, char*); +- +- static PyMappingMethods DictionaryAsMapping = { +- (PyInquiry) DictionaryLength, +- (binaryfunc) DictionaryItem, +- (objobjargproc) DictionaryAssItem, +- }; +- +- static PyTypeObject DictionaryType = { +- PyObject_HEAD_INIT(0) +- 0, +- "vimdictionary", +- sizeof(DictionaryObject), +- 0, +- +- (destructor) DictionaryDestructor, +- (printfunc) 0, +- (getattrfunc) DictionaryGetattr, +- (setattrfunc) DictionarySetattr, +- (cmpfunc) 0, +- (reprfunc) 0, +- +- 0, /* as number */ +- 0, /* as sequence */ +- &DictionaryAsMapping, /* as mapping */ +- +- (hashfunc) 0, +- (ternaryfunc) 0, +- (reprfunc) 0, +- }; +- +- static void +- DictionaryDestructor(PyObject *self) +- { +- DictionaryObject *this = ((DictionaryObject *) (self)); +- +- pyll_remove(&this->ref, &lastdict); +- dict_unref(this->dict); +- +- Py_DECREF(self); +- } +- + static PyObject * + DictionaryGetattr(PyObject *self, char *name) + { +--- 1403,1408 ---- +*************** +*** 1698,1706 **** + return Py_FindMethod(DictionaryMethods, self, name); + } + +- static void ListDestructor(PyObject *); +- static PyObject *ListGetattr(PyObject *, char *); +- + static PySequenceMethods ListAsSeq = { + (PyInquiry) ListLength, + (binaryfunc) 0, +--- 1416,1421 ---- +*************** +*** 1716,1755 **** + #endif + }; + +- static PyTypeObject ListType = { +- PyObject_HEAD_INIT(0) +- 0, +- "vimlist", +- sizeof(ListObject), +- 0, +- +- (destructor) ListDestructor, +- (printfunc) 0, +- (getattrfunc) ListGetattr, +- (setattrfunc) ListSetattr, +- (cmpfunc) 0, +- (reprfunc) 0, +- +- 0, /* as number */ +- &ListAsSeq, /* as sequence */ +- 0, /* as mapping */ +- +- (hashfunc) 0, +- (ternaryfunc) 0, +- (reprfunc) 0, +- }; +- +- static void +- ListDestructor(PyObject *self) +- { +- ListObject *this = ((ListObject *) (self)); +- +- pyll_remove(&this->ref, &lastlist); +- list_unref(this->list); +- +- Py_DECREF(self); +- } +- + static PyObject * + ListGetattr(PyObject *self, char *name) + { +--- 1431,1436 ---- +*************** +*** 1759,1801 **** + return Py_FindMethod(ListMethods, self, name); + } + +- static void FunctionDestructor(PyObject *); +- static PyObject *FunctionGetattr(PyObject *, char *); +- +- static PyTypeObject FunctionType = { +- PyObject_HEAD_INIT(0) +- 0, +- "vimfunction", +- sizeof(FunctionObject), +- 0, +- +- (destructor) FunctionDestructor, +- (printfunc) 0, +- (getattrfunc) FunctionGetattr, +- (setattrfunc) 0, +- (cmpfunc) 0, +- (reprfunc) 0, +- +- 0, /* as number */ +- 0, /* as sequence */ +- 0, /* as mapping */ +- +- (hashfunc) 0, +- (ternaryfunc) FunctionCall, +- (reprfunc) 0, +- }; +- +- static void +- FunctionDestructor(PyObject *self) +- { +- FunctionObject *this = (FunctionObject *) (self); +- +- func_unref(this->name); +- PyMem_Del(this->name); +- +- Py_DECREF(self); +- } +- + static PyObject * + FunctionGetattr(PyObject *self, char *name) + { +--- 1440,1445 ---- +*************** +*** 1839,1859 **** + { + set_ref_in_py(copyID); + } +- +- static void +- init_structs(void) +- { +- vim_memset(&OutputType, 0, sizeof(OutputType)); +- OutputType.tp_name = "message"; +- OutputType.tp_basicsize = sizeof(OutputObject); +- OutputType.tp_getattr = OutputGetattr; +- OutputType.tp_setattr = OutputSetattr; +- +- vim_memset(&RangeType, 0, sizeof(RangeType)); +- RangeType.tp_name = "range"; +- RangeType.tp_basicsize = sizeof(RangeObject); +- RangeType.tp_dealloc = RangeDestructor; +- RangeType.tp_getattr = RangeGetattr; +- RangeType.tp_repr = RangeRepr; +- RangeType.tp_as_sequence = &RangeAsSeq; +- } +--- 1483,1485 ---- +*** ../vim-7.3.908/src/version.c 2013-04-24 13:10:35.000000000 +0200 +--- src/version.c 2013-04-24 13:27:49.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 909, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +221. Your wife melts your keyboard in the oven. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.910 b/7.3.910 new file mode 100644 index 0000000..ae8deb5 --- /dev/null +++ b/7.3.910 @@ -0,0 +1,119 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.910 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.910 +Problem: Python code in #ifdef branches with only minor differences. +Solution: Merge the #ifdef branches. (ZyX) +Files: src/if_py_both.h, src/if_python.c + + +*** ../vim-7.3.909/src/if_py_both.h 2013-04-24 13:39:11.000000000 +0200 +--- src/if_py_both.h 2013-04-24 13:42:30.000000000 +0200 +*************** +*** 2853,2859 **** + tv->v_type = VAR_FUNC; + func_ref(tv->vval.v_string); + } +- #if PY_MAJOR_VERSION >= 3 + else if (PyBytes_Check(obj)) + { + char_u *result; +--- 2853,2858 ---- +*************** +*** 2873,2902 **** + PyObject *bytes; + char_u *result; + +- bytes = PyString_AsBytes(obj); +- if (bytes == NULL) +- return -1; +- +- if(PyString_AsStringAndSize(bytes, (char **) &result, NULL) == -1) +- return -1; +- if (result == NULL) +- return -1; +- +- if (set_string_copy(result, tv) == -1) +- { +- Py_XDECREF(bytes); +- return -1; +- } +- Py_XDECREF(bytes); +- +- tv->v_type = VAR_STRING; +- } +- #else +- else if (PyUnicode_Check(obj)) +- { +- PyObject *bytes; +- char_u *result; +- + bytes = PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL); + if (bytes == NULL) + return -1; +--- 2872,2877 ---- +*************** +*** 2915,2934 **** + + tv->v_type = VAR_STRING; + } +! else if (PyString_Check(obj)) +! { +! char_u *result; +! +! if(PyString_AsStringAndSize(obj, (char **) &result, NULL) == -1) +! return -1; +! if (result == NULL) +! return -1; +! +! if (set_string_copy(result, tv) == -1) +! return -1; +! +! tv->v_type = VAR_STRING; +! } + else if (PyInt_Check(obj)) + { + tv->v_type = VAR_NUMBER; +--- 2890,2896 ---- + + tv->v_type = VAR_STRING; + } +! #if PY_MAJOR_VERSION < 3 + else if (PyInt_Check(obj)) + { + tv->v_type = VAR_NUMBER; +*** ../vim-7.3.909/src/if_python.c 2013-04-24 13:39:11.000000000 +0200 +--- src/if_python.c 2013-04-24 13:42:30.000000000 +0200 +*************** +*** 59,64 **** +--- 59,65 ---- + static void init_structs(void); + + #define PyBytes_FromString PyString_FromString ++ #define PyBytes_Check PyString_Check + + /* No-op conversion functions, use with care! */ + #define PyString_AsBytes(obj) (obj) +*** ../vim-7.3.909/src/version.c 2013-04-24 13:39:11.000000000 +0200 +--- src/version.c 2013-04-24 13:43:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 910, + /**/ + +-- +Your fault: core dumped + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.911 b/7.3.911 new file mode 100644 index 0000000..9143cee --- /dev/null +++ b/7.3.911 @@ -0,0 +1,343 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.911 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.911 +Problem: Python: Access to Vim variables is not so easy. +Solution: Define vim.vars and vim.vvars. (ZyX) +Files: runtime/doc/if_pyth.txt, src/eval.c, src/globals.h, + src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.910/runtime/doc/if_pyth.txt 2012-09-21 14:00:05.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-04-24 13:54:23.000000000 +0200 +*************** +*** 54,61 **** + EOF + endfunction + < +! Note: Python is very sensitive to the indenting. Also make sure the "class" +! line and "EOF" do not have any indent. + + *:pyfile* *:pyf* + :[range]pyf[ile] {file} +--- 54,61 ---- + EOF + endfunction + < +! Note: Python is very sensitive to the indenting. Make sure the "class" line +! and "EOF" do not have any indent. + + *:pyfile* *:pyf* + :[range]pyf[ile] {file} +*************** +*** 165,171 **** + Value Meaning ~ + zero Variable is not locked + vim.VAR_LOCKED Variable is locked, but can be unlocked +! vim.VAR_FIXED Variable is locked and can’t be unlocked + integer constants. If variable is not fixed, you can do + `var.locked=True` to lock it and `var.locked=False` to unlock. + There is no recursive locking like |:lockvar|! does. There is also +--- 165,171 ---- + Value Meaning ~ + zero Variable is not locked + vim.VAR_LOCKED Variable is locked, but can be unlocked +! vim.VAR_FIXED Variable is locked and can't be unlocked + integer constants. If variable is not fixed, you can do + `var.locked=True` to lock it and `var.locked=False` to unlock. + There is no recursive locking like |:lockvar|! does. There is also +*************** +*** 237,242 **** +--- 237,247 ---- + "current range". A range is a bit like a buffer, but with all access + restricted to a subset of lines. See |python-range| for more details. + ++ vim.vars *python-vars* ++ vim.vvars *python-vvars* ++ Dictionary-like objects holding dictionaries with global (|g:|) and ++ vim (|v:|) variables respectively. Identical to `vim.bindeval("g:")`, ++ but faster. + + Output from Python *python-output* + Vim displays all Python code output in the Vim message area. Normal +*************** +*** 307,312 **** +--- 312,318 ---- + :py n = len(b) # number of lines + :py (row,col) = b.mark('a') # named mark + :py r = b.range(1,5) # a sub-range of the buffer ++ :py b.vars["foo"] = "bar" # assign b:foo variable + + ============================================================================== + 4. Range objects *python-range* +*************** +*** 354,359 **** +--- 360,368 ---- + This is a tuple, (row,col). + height (read-write) The window height, in rows + width (read-write) The window width, in columns ++ vars (read-only) The window |w:| variables. Attribute is ++ unassignable, but you can change window ++ variables this way + The height attribute is writable only if the screen is split horizontally. + The width attribute is writable only if the screen is split vertically. + +*************** +*** 385,391 **** + + *:py3* *:python3* + The |:py3| and |:python3| commands work similar to |:python|. A simple check +! if the `:py3` command is wrong: > + :py3 print("Hello") + < *:py3file* + The |:py3file| command works similar to |:pyfile|. +--- 394,400 ---- + + *:py3* *:python3* + The |:py3| and |:python3| commands work similar to |:python|. A simple check +! if the `:py3` command is working: > + :py3 print("Hello") + < *:py3file* + The |:py3file| command works similar to |:pyfile|. +*** ../vim-7.3.910/src/eval.c 2013-04-15 18:25:55.000000000 +0200 +--- src/eval.c 2013-04-24 14:02:45.000000000 +0200 +*************** +*** 113,124 **** + static char *e_nofunc = N_("E130: Unknown function: %s"); + static char *e_illvar = N_("E461: Illegal variable name: %s"); + +! /* +! * All user-defined global variables are stored in dictionary "globvardict". +! * "globvars_var" is the variable that is used for "g:". +! */ +! static dict_T globvardict; +! static dictitem_T globvars_var; + #define globvarht globvardict.dv_hashtab + + /* +--- 113,119 ---- + static char *e_nofunc = N_("E130: Unknown function: %s"); + static char *e_illvar = N_("E461: Illegal variable name: %s"); + +! static dictitem_T globvars_var; /* variable used for g: */ + #define globvarht globvardict.dv_hashtab + + /* +*************** +*** 370,381 **** + #define vv_list vv_di.di_tv.vval.v_list + #define vv_tv vv_di.di_tv + +! /* +! * The v: variables are stored in dictionary "vimvardict". +! * "vimvars_var" is the variable that is used for the "l:" scope. +! */ +! static dict_T vimvardict; +! static dictitem_T vimvars_var; + #define vimvarht vimvardict.dv_hashtab + + static void prepare_vimvar __ARGS((int idx, typval_T *save_tv)); +--- 365,371 ---- + #define vv_list vv_di.di_tv.vval.v_list + #define vv_tv vv_di.di_tv + +! static dictitem_T vimvars_var; /* variable used for v: */ + #define vimvarht vimvardict.dv_hashtab + + static void prepare_vimvar __ARGS((int idx, typval_T *save_tv)); +*** ../vim-7.3.910/src/globals.h 2013-03-19 13:33:18.000000000 +0100 +--- src/globals.h 2013-04-24 13:57:51.000000000 +0200 +*************** +*** 180,185 **** +--- 180,187 ---- + EXTERN int emsg_severe INIT(= FALSE); /* use message of next of several + emsg() calls for throw */ + EXTERN int did_endif INIT(= FALSE); /* just had ":endif" */ ++ EXTERN dict_T vimvardict; /* Dictionary with v: variables */ ++ EXTERN dict_T globvardict; /* Dictionary with g: variables */ + #endif + EXTERN int did_emsg; /* set by emsg() when the message + is displayed or thrown */ +*** ../vim-7.3.910/src/if_py_both.h 2013-04-24 13:47:36.000000000 +0200 +--- src/if_py_both.h 2013-04-24 13:54:23.000000000 +0200 +*************** +*** 1532,1539 **** + else if (strcmp(name, "width") == 0) + return Py_BuildValue("l", (long)(W_WIDTH(this->win))); + #endif + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sss]", "buffer", "cursor", "height"); + else + return NULL; + } +--- 1532,1541 ---- + else if (strcmp(name, "width") == 0) + return Py_BuildValue("l", (long)(W_WIDTH(this->win))); + #endif ++ else if (strcmp(name, "vars") == 0) ++ return DictionaryNew(this->win->w_vars); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssss]", "buffer", "cursor", "height", "vars"); + else + return NULL; + } +*************** +*** 2495,2502 **** + return Py_BuildValue("s", this->buf->b_ffname); + else if (strcmp(name, "number") == 0) + return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ss]", "name", "number"); + else + return NULL; + } +--- 2497,2506 ---- + return Py_BuildValue("s", this->buf->b_ffname); + else if (strcmp(name, "number") == 0) + return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); ++ else if (strcmp(name, "vars") == 0) ++ return DictionaryNew(this->buf->b_vars); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sss]", "name", "number", "vars"); + else + return NULL; + } +*** ../vim-7.3.910/src/if_python3.c 2013-04-24 13:39:11.000000000 +0200 +--- src/if_python3.c 2013-04-24 13:54:23.000000000 +0200 +*************** +*** 1647,1652 **** +--- 1647,1655 ---- + Py_INCREF((PyObject *)(void *)&TheWindowList); + PyModule_AddObject(mod, "windows", (PyObject *)(void *)&TheWindowList); + ++ PyModule_AddObject(mod, "vars", DictionaryNew(&globvardict)); ++ PyModule_AddObject(mod, "vvars", DictionaryNew(&vimvardict)); ++ + #define ADD_INT_CONSTANT(name, value) \ + tmp = PyLong_FromLong(value); \ + Py_INCREF(tmp); \ +*** ../vim-7.3.910/src/if_python.c 2013-04-24 13:47:36.000000000 +0200 +--- src/if_python.c 2013-04-24 13:54:33.000000000 +0200 +*************** +*** 1330,1335 **** +--- 1330,1336 ---- + { + PyObject *mod; + PyObject *dict; ++ PyObject *tmp; + /* The special value is removed from sys.path in Python_Init(). */ + static char *(argv[2]) = {"/must>not&exist/foo", NULL}; + +*************** +*** 1353,1358 **** +--- 1354,1365 ---- + PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferList); + PyDict_SetItemString(dict, "current", (PyObject *)(void *)&TheCurrent); + PyDict_SetItemString(dict, "windows", (PyObject *)(void *)&TheWindowList); ++ tmp = DictionaryNew(&globvardict); ++ PyDict_SetItemString(dict, "vars", tmp); ++ Py_DECREF(tmp); ++ tmp = DictionaryNew(&vimvardict); ++ PyDict_SetItemString(dict, "vvars", tmp); ++ Py_DECREF(tmp); + PyDict_SetItemString(dict, "VAR_LOCKED", PyInt_FromLong(VAR_LOCKED)); + PyDict_SetItemString(dict, "VAR_FIXED", PyInt_FromLong(VAR_FIXED)); + PyDict_SetItemString(dict, "VAR_SCOPE", PyInt_FromLong(VAR_SCOPE)); +*** ../vim-7.3.910/src/testdir/test86.in 2013-04-05 19:32:30.000000000 +0200 +--- src/testdir/test86.in 2013-04-24 13:54:33.000000000 +0200 +*************** +*** 346,351 **** +--- 346,364 ---- + :$put =string(pyeval('l')) + :py l = ll[-10:10] + :$put =string(pyeval('l')) ++ :" ++ :" Vars ++ :let g:foo = 'bac' ++ :let w:abc = 'def' ++ :let b:baz = 'bar' ++ :try ++ : throw "Abc" ++ :catch ++ : put =pyeval('vim.vvars[''exception'']') ++ :endtry ++ :put =pyeval('vim.vars[''foo'']') ++ :put =pyeval('vim.current.window.vars[''abc'']') ++ :put =pyeval('vim.current.buffer.vars[''baz'']') + :endfun + :" + :call Test() +*** ../vim-7.3.910/src/testdir/test86.ok 2013-04-24 13:04:21.000000000 +0200 +--- src/testdir/test86.ok 2013-04-24 13:54:33.000000000 +0200 +*************** +*** 76,78 **** +--- 76,82 ---- + [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5] + [0, 1, 2, 3, 4, 5] ++ Abc ++ bac ++ def ++ bar +*** ../vim-7.3.910/src/testdir/test87.in 2013-02-13 14:17:00.000000000 +0100 +--- src/testdir/test87.in 2013-04-24 13:54:33.000000000 +0200 +*************** +*** 315,320 **** +--- 315,333 ---- + :py3 trace_main() + :py3 sys.settrace(None) + :$put =string(l) ++ :" ++ :" Vars ++ :let g:foo = 'bac' ++ :let w:abc = 'def' ++ :let b:baz = 'bar' ++ :try ++ : throw "Abc" ++ :catch ++ : put =py3eval('vim.vvars[''exception'']') ++ :endtry ++ :put =py3eval('vim.vars[''foo'']') ++ :put =py3eval('vim.current.window.vars[''abc'']') ++ :put =py3eval('vim.current.buffer.vars[''baz'']') + :endfun + :" + :call Test() +*** ../vim-7.3.910/src/testdir/test87.ok 2013-04-24 13:04:21.000000000 +0200 +--- src/testdir/test87.ok 2013-04-24 13:54:33.000000000 +0200 +*************** +*** 65,67 **** +--- 65,71 ---- + vim: Vim(let):E861: + [1] + [1, 10, 11, 10, 11, 10, 11, 10, 11, 10, 11, 10, 1] ++ Abc ++ bac ++ def ++ bar +*** ../vim-7.3.910/src/version.c 2013-04-24 13:47:36.000000000 +0200 +--- src/version.c 2013-04-24 13:54:00.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 911, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +222. You send more than 20 personal e-mails a day. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.912 b/7.3.912 new file mode 100644 index 0000000..8a7ed92 --- /dev/null +++ b/7.3.912 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.912 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.912 +Problem: Typing a ":" command at the hit-enter dialog does not work if the + "file changed" dialog happens next. +Solution: Check for changed files before giving the hit-enter dialog. +Files: src/message.c + + +*** ../vim-7.3.911/src/message.c 2013-03-19 13:56:03.000000000 +0100 +--- src/message.c 2013-04-24 15:01:31.000000000 +0200 +*************** +*** 939,944 **** +--- 939,950 ---- + #ifdef USE_ON_FLY_SCROLL + dont_scroll = TRUE; /* disallow scrolling here */ + #endif ++ /* Avoid the sequence that the user types ":" at the hit-return prompt ++ * to start an Ex command, but the file-changed dialog gets in the ++ * way. */ ++ if (need_check_timestamps) ++ check_timestamps(FALSE); ++ + hit_return_msg(); + + do +*** ../vim-7.3.911/src/version.c 2013-04-24 14:06:42.000000000 +0200 +--- src/version.c 2013-04-24 15:04:30.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 912, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +224. You set up your own Web page. You set up a Web page for each + of your kids... and your pets. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.913 b/7.3.913 new file mode 100644 index 0000000..721959a --- /dev/null +++ b/7.3.913 @@ -0,0 +1,73 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.913 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.913 (after 7.3.905) +Problem: Still a crash when writing viminfo. +Solution: Add checks for NULL pointers. (Ron Aaron) +Files: src/ex_getln.c + + +*** ../vim-7.3.912/src/ex_getln.c 2013-04-15 22:22:48.000000000 +0200 +--- src/ex_getln.c 2013-04-24 15:35:22.000000000 +0200 +*************** +*** 6177,6182 **** +--- 6177,6183 ---- + } + vim_free(viminfo_history[type]); + viminfo_history[type] = NULL; ++ viminfo_hisidx[type] = 0; + } + } + +*************** +*** 6230,6235 **** +--- 6231,6237 ---- + && !(round == 2 && i >= viminfo_hisidx[type])) + { + p = round == 1 ? history[type][i].hisstr ++ : viminfo_history[type] == NULL ? NULL + : viminfo_history[type][i]; + if (p != NULL && (round == 2 || !history[type][i].viminfo)) + { +*************** +*** 6261,6267 **** + } + } + for (i = 0; i < viminfo_hisidx[type]; ++i) +! vim_free(viminfo_history[type][i]); + vim_free(viminfo_history[type]); + viminfo_history[type] = NULL; + viminfo_hisidx[type] = 0; +--- 6263,6270 ---- + } + } + for (i = 0; i < viminfo_hisidx[type]; ++i) +! if (viminfo_history[type] != NULL) +! vim_free(viminfo_history[type][i]); + vim_free(viminfo_history[type]); + viminfo_history[type] = NULL; + viminfo_hisidx[type] = 0; +*** ../vim-7.3.912/src/version.c 2013-04-24 15:12:27.000000000 +0200 +--- src/version.c 2013-04-24 15:38:22.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 913, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +225. You sign up for free subscriptions for all the computer magazines + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.914 b/7.3.914 new file mode 100644 index 0000000..e7cc58f --- /dev/null +++ b/7.3.914 @@ -0,0 +1,72 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.914 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.914 +Problem: ~/.viminfo is messed up when running tests. +Solution: Set the viminfo filename. +Files: src/testdir/test89.in, src/testdir/test94.in + + +*** ../vim-7.3.913/src/testdir/test89.in 2013-03-13 20:42:28.000000000 +0100 +--- src/testdir/test89.in 2013-04-24 15:42:05.000000000 +0200 +*************** +*** 2,8 **** + + STARTTEST + :so small.vim +! :set hidden nocp nu rnu + :redir @a | set nu? rnu? | redir END + :e! xx + :redir @b | set nu? rnu? | redir END +--- 2,8 ---- + + STARTTEST + :so small.vim +! :set hidden nocp nu rnu viminfo+=nviminfo + :redir @a | set nu? rnu? | redir END + :e! xx + :redir @b | set nu? rnu? | redir END +*** ../vim-7.3.913/src/testdir/test94.in 2013-04-12 13:44:49.000000000 +0200 +--- src/testdir/test94.in 2013-04-24 15:43:10.000000000 +0200 +*************** +*** 17,23 **** + + STARTTEST + :so small.vim +! :set nocp + : + :" User functions + :function MoveToCap() +--- 17,23 ---- + + STARTTEST + :so small.vim +! :set nocp viminfo+=nviminfo + : + :" User functions + :function MoveToCap() +*** ../vim-7.3.913/src/version.c 2013-04-24 15:39:06.000000000 +0200 +--- src/version.c 2013-04-24 15:44:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 914, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +226. You sit down at the computer right after dinner and your spouse + says "See you in the morning." + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.915 b/7.3.915 new file mode 100644 index 0000000..da1f12e --- /dev/null +++ b/7.3.915 @@ -0,0 +1,47 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.915 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.915 +Problem: When reading a file with encoding conversion fails at the end the + next encoding in 'fencs' is not used. +Solution: Retry with another encoding when possible. (Taro Muraoka) +Files: src/fileio.c + + +*** ../vim-7.3.914/src/fileio.c 2013-04-15 12:27:30.000000000 +0200 +--- src/fileio.c 2013-04-24 16:16:28.000000000 +0200 +*************** +*** 1380,1385 **** +--- 1380,1387 ---- + # endif + ) + { ++ if (can_retry) ++ goto rewind_retry; + if (conv_error == 0) + conv_error = curbuf->b_ml.ml_line_count + - linecnt + 1; +*** ../vim-7.3.914/src/version.c 2013-04-24 15:47:11.000000000 +0200 +--- src/version.c 2013-04-24 16:18:48.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 915, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +227. You sleep next to your monitor. Or on top of it. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.916 b/7.3.916 new file mode 100644 index 0000000..3ed5ec1 --- /dev/null +++ b/7.3.916 @@ -0,0 +1,115 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.916 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.916 +Problem: Using freed memory when pasting with the mouse (Issue 130). +Solution: Get the byte value early. (hint by Dominique Pelle) +Files: src/buffer.c + + +*** ../vim-7.3.915/src/buffer.c 2013-04-15 12:27:30.000000000 +0200 +--- src/buffer.c 2013-04-24 16:45:38.000000000 +0200 +*************** +*** 3506,3512 **** + char_u *p; + char_u *s; + char_u *t; +! char_u *linecont; + #ifdef FEAT_EVAL + win_T *o_curwin; + buf_T *o_curbuf; +--- 3506,3512 ---- + char_u *p; + char_u *s; + char_u *t; +! int byteval; + #ifdef FEAT_EVAL + win_T *o_curwin; + buf_T *o_curbuf; +*************** +*** 3573,3584 **** + fillchar = '-'; + #endif + +! /* +! * Get line & check if empty (cursorpos will show "0-1"). +! * If inversion is possible we use it. Else '=' characters are used. +! */ +! linecont = ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE); +! empty_line = (*linecont == NUL); + + groupdepth = 0; + p = out; +--- 3573,3593 ---- + fillchar = '-'; + #endif + +! /* Get line & check if empty (cursorpos will show "0-1"). Note that +! * p will become invalid when getting another buffer line. */ +! p = ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE); +! empty_line = (*p == NUL); +! +! /* Get the byte value now, in case we need it below. This is more +! * efficient than making a copy of the line. */ +! if (wp->w_cursor.col > (colnr_T)STRLEN(p)) +! byteval = 0; +! else +! #ifdef FEAT_MBYTE +! byteval = (*mb_ptr2char)(p + wp->w_cursor.col); +! #else +! byteval = p[wp->w_cursor.col]; +! #endif + + groupdepth = 0; + p = out; +*************** +*** 3956,3971 **** + case STL_BYTEVAL_X: + base = 'X'; + case STL_BYTEVAL: +! if (wp->w_cursor.col > (colnr_T)STRLEN(linecont)) +! num = 0; +! else +! { +! #ifdef FEAT_MBYTE +! num = (*mb_ptr2char)(linecont + wp->w_cursor.col); +! #else +! num = linecont[wp->w_cursor.col]; +! #endif +! } + if (num == NL) + num = 0; + else if (num == CAR && get_fileformat(wp->w_buffer) == EOL_MAC) +--- 3965,3971 ---- + case STL_BYTEVAL_X: + base = 'X'; + case STL_BYTEVAL: +! num = byteval; + if (num == NL) + num = 0; + else if (num == CAR && get_fileformat(wp->w_buffer) == EOL_MAC) +*** ../vim-7.3.915/src/version.c 2013-04-24 16:33:58.000000000 +0200 +--- src/version.c 2013-04-24 16:51:24.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 916, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +228. You spend Saturday night making the counter on your home page + pass that 2000 mark. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.917 b/7.3.917 new file mode 100644 index 0000000..00ed2f6 --- /dev/null +++ b/7.3.917 @@ -0,0 +1,85 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.917 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.917 +Problem: When a path ends in a backslash appending a comma has the wrong + effect. +Solution: Replace a trailing backslash with a slash. (Nazri Ramliy) +Files: src/misc1.c, src/testdir/test73.in, src/testdir/test73.ok + + +*** ../vim-7.3.916/src/misc1.c 2013-04-15 15:47:07.000000000 +0200 +--- src/misc1.c 2013-04-24 17:25:45.000000000 +0200 +*************** +*** 10135,10140 **** +--- 10135,10149 ---- + + if (ga_grow(gap, 1) == FAIL) + break; ++ ++ # if defined(MSWIN) || defined(MSDOS) ++ /* Avoid the path ending in a backslash, it fails when a comma is ++ * appended. */ ++ len = STRLEN(buf); ++ if (buf[len - 1] == '\\') ++ buf[len - 1] = '/'; ++ # endif ++ + p = vim_strsave(buf); + if (p == NULL) + break; +*** ../vim-7.3.916/src/testdir/test73.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test73.in 2013-04-24 17:22:14.000000000 +0200 +*************** +*** 158,163 **** +--- 158,173 ---- + :" Find the file containing 'E.T.' in the Xfind/in/path directory + :find file + :exec "w >>" . test_out ++ :" ++ :" Test that completion works when path=.,, ++ :" ++ :set path=.,, ++ :" Open Jimmy Hoffa file ++ :e in/file.txt ++ :exec "w >>" . test_out ++ :" Search for the file containing Holy Grail in same directory as in/path.txt ++ :find stu ++ :exec "w >>" . test_out + :q + :exec "cd " . cwd + :call DeleteDirectory("Xfind") +*** ../vim-7.3.916/src/testdir/test73.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test73.ok 2013-04-24 17:22:28.000000000 +0200 +*************** +*** 17,19 **** +--- 17,21 ---- + Voyager 2 + Jimmy Hoffa + E.T. ++ Jimmy Hoffa ++ Another Holy Grail +*** ../vim-7.3.916/src/version.c 2013-04-24 16:52:28.000000000 +0200 +--- src/version.c 2013-04-24 17:27:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 917, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +229. You spend so much time thinking what to add on this list. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.918 b/7.3.918 new file mode 100644 index 0000000..4367b65 --- /dev/null +++ b/7.3.918 @@ -0,0 +1,80 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.918 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.918 +Problem: Repeating an Ex command after using a Visual motion does not work. +Solution: Check for an Ex command being used. (David Bürgin) +Files: src/normal.c + + +*** ../vim-7.3.917/src/normal.c 2013-04-05 17:43:10.000000000 +0200 +--- src/normal.c 2013-04-24 18:12:43.000000000 +0200 +*************** +*** 1504,1514 **** + } + #endif + +! /* only redo yank when 'y' flag is in 'cpoptions' */ +! /* never redo "zf" (define fold) */ + if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK) + #ifdef FEAT_VISUAL +! && (!VIsual_active || oap->motion_force) + #endif + && cap->cmdchar != 'D' + #ifdef FEAT_FOLDING +--- 1504,1517 ---- + } + #endif + +! /* Only redo yank when 'y' flag is in 'cpoptions'. */ +! /* Never redo "zf" (define fold). */ + if ((vim_strchr(p_cpo, CPO_YANK) != NULL || oap->op_type != OP_YANK) + #ifdef FEAT_VISUAL +! && ((!VIsual_active || oap->motion_force) +! /* Also redo Operator-pending Visual mode mappings */ +! || (VIsual_active && cap->cmdchar == ':' +! && oap->op_type != OP_COLON)) + #endif + && cap->cmdchar != 'D' + #ifdef FEAT_FOLDING +*************** +*** 1797,1803 **** + prep_redo(oap->regname, 0L, NUL, cap->cmdchar, cap->nchar, + get_op_char(oap->op_type), + get_extra_op_char(oap->op_type)); +! else + prep_redo(oap->regname, 0L, NUL, 'v', + get_op_char(oap->op_type), + get_extra_op_char(oap->op_type), +--- 1800,1806 ---- + prep_redo(oap->regname, 0L, NUL, cap->cmdchar, cap->nchar, + get_op_char(oap->op_type), + get_extra_op_char(oap->op_type)); +! else if (cap->cmdchar != ':') + prep_redo(oap->regname, 0L, NUL, 'v', + get_op_char(oap->op_type), + get_extra_op_char(oap->op_type), +*** ../vim-7.3.917/src/version.c 2013-04-24 17:34:15.000000000 +0200 +--- src/version.c 2013-04-24 18:34:03.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 918, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +230. You spend your Friday nights typing away at your keyboard + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.919 b/7.3.919 new file mode 100644 index 0000000..f179985 --- /dev/null +++ b/7.3.919 @@ -0,0 +1,57 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.919 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.919 (after 7.3.788) +Problem: An empty nl.po file does not work with an old msgfmt. +Solution: Put a single # in the file. (Laurent Blume) +Files: src/po/Makefile + + +*** ../vim-7.3.918/src/po/Makefile 2013-01-30 12:50:50.000000000 +0100 +--- src/po/Makefile 2013-04-27 14:04:45.000000000 +0200 +*************** +*** 176,184 **** + + converted: $(MOCONVERTED) + +! # nl.po was added later, if it does not exist use an empty file. + nl.po: +! touch nl.po + + # Norwegian/Bokmal: "nb" is an alias for "no". + # Copying the file is not efficient, but I don't know of another way to make +--- 176,185 ---- + + converted: $(MOCONVERTED) + +! # nl.po was added later, if it does not exist use a file with just a # in it +! # (an empty file doesn't work with old msgfmt). + nl.po: +! @( echo \# > nl.po ) + + # Norwegian/Bokmal: "nb" is an alias for "no". + # Copying the file is not efficient, but I don't know of another way to make +*** ../vim-7.3.918/src/version.c 2013-04-24 18:34:40.000000000 +0200 +--- src/version.c 2013-05-04 03:30:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 919, + /**/ + +-- +God made the integers; all else is the work of Man. + -- Kronecker + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.920 b/7.3.920 new file mode 100644 index 0000000..d1f50ba --- /dev/null +++ b/7.3.920 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.920 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.920 +Problem: Compiler warning for size_t to int. +Solution: Add a type cast. (Mike Williams) +Files: src/misc1.c + + +*** ../vim-7.3.919/src/misc1.c 2013-04-24 17:34:15.000000000 +0200 +--- src/misc1.c 2013-04-29 22:33:49.000000000 +0200 +*************** +*** 10139,10145 **** + # if defined(MSWIN) || defined(MSDOS) + /* Avoid the path ending in a backslash, it fails when a comma is + * appended. */ +! len = STRLEN(buf); + if (buf[len - 1] == '\\') + buf[len - 1] = '/'; + # endif +--- 10139,10145 ---- + # if defined(MSWIN) || defined(MSDOS) + /* Avoid the path ending in a backslash, it fails when a comma is + * appended. */ +! len = (int)STRLEN(buf); + if (buf[len - 1] == '\\') + buf[len - 1] = '/'; + # endif +*** ../vim-7.3.919/src/version.c 2013-05-04 03:37:03.000000000 +0200 +--- src/version.c 2013-05-04 03:39:44.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 920, + /**/ + +-- +Women are probably the main cause of free software starvation. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.921 b/7.3.921 new file mode 100644 index 0000000..d95108e --- /dev/null +++ b/7.3.921 @@ -0,0 +1,58 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.921 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.921 (after 7.3.697) +Problem: Trying to create a fontset handle when 'guifontset' is not set. +Solution: Add curly braces around the code block. (Max Kirillov) +Files: src/syntax.c + + +*** ../vim-7.3.920/src/syntax.c 2013-01-23 15:53:08.000000000 +0100 +--- src/syntax.c 2013-05-02 03:51:38.000000000 +0200 +*************** +*** 8082,8087 **** +--- 8082,8088 ---- + || do_tooltip + # endif + ) ++ { + if (free_font) + gui_mch_free_fontset(HL_TABLE()[idx].sg_fontset); + HL_TABLE()[idx].sg_fontset = fontset_name2handle(arg, 0 +*************** +*** 8092,8097 **** +--- 8093,8099 ---- + || do_tooltip + # endif + ); ++ } + if (HL_TABLE()[idx].sg_fontset != NOFONTSET) + { + /* If it worked and it's the Normal group, use it as the normal +*** ../vim-7.3.920/src/version.c 2013-05-04 03:40:22.000000000 +0200 +--- src/version.c 2013-05-04 03:41:40.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 921, + /**/ + +-- +Edison's greatest achievement came in 1879, when he invented the +electric company. Edison's design was a brilliant adaptation of the +simple electrical circuit: the electric company sends electricity +through a wire to a customer, then immediately gets the electricity +back through another wire + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.922 b/7.3.922 new file mode 100644 index 0000000..8b78ca0 --- /dev/null +++ b/7.3.922 @@ -0,0 +1,83 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.922 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.922 +Problem: No test for what 7.3.918 fixes. +Solution: Add a test. (David Bürgin) +Files: src/testdir/test94.in, src/testdir/test94.ok + + +*** ../vim-7.3.921/src/testdir/test94.in 2013-04-24 15:47:11.000000000 +0200 +--- src/testdir/test94.in 2013-05-04 04:03:02.000000000 +0200 +*************** +*** 30,38 **** + : call setpos("'>", [0, line2, col2, 0]) + : normal! gv + :endfunction +- :function MoveToEndCount(count) +- : normal! v:count . e +- :endfunction + : + :" Visual modes followed by operator + /^apple +--- 30,35 ---- +*************** +*** 59,65 **** + /^Juniper + g?\WfD.: + /^Lemon +! yiWPlciWNew: + : + :" Patch 7.3.879: Properly abort Operator-pending mode for "dv:" etc. + /^zzzz +--- 56,62 ---- + /^Juniper + g?\WfD.: + /^Lemon +! yiWPlciWNewfr.: + : + :" Patch 7.3.879: Properly abort Operator-pending mode for "dv:" etc. + /^zzzz +*** ../vim-7.3.921/src/testdir/test94.ok 2013-04-12 13:44:49.000000000 +0200 +--- src/testdir/test94.ok 2013-05-04 04:06:46.000000000 +0200 +*************** +*** 13,19 **** + + ----Z + WhavcreQhevnaZ +! LemonNewNectarineZ + + zzz + ok +--- 13,19 ---- + + ----Z + WhavcreQhevnaZ +! LemonNewNewZ + + zzz + ok +*** ../vim-7.3.921/src/version.c 2013-05-04 03:42:30.000000000 +0200 +--- src/version.c 2013-05-04 04:07:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 922, + /**/ + +-- +This sentence is not sure that it exists, but if it does, it will +certainly consider the possibility that other sentences exist. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.923 b/7.3.923 new file mode 100644 index 0000000..c506b6b --- /dev/null +++ b/7.3.923 @@ -0,0 +1,82 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.923 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.923 +Problem: Check for X11 header files fails on Solaris. +Solution: Only use -Werror for gcc. (Laurent Blume) +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.3.922/src/configure.in 2013-04-15 14:44:53.000000000 +0200 +--- src/configure.in 2013-05-04 04:34:46.000000000 +0200 +*************** +*** 1751,1757 **** + dnl Check that the X11 header files don't use implicit declarations + AC_MSG_CHECKING(if X11 header files implicitly declare return values) + cflags_save=$CFLAGS +! CFLAGS="$CFLAGS $X_CFLAGS -Werror" + AC_TRY_COMPILE([#include ], , + AC_MSG_RESULT(no), + CFLAGS="$CFLAGS -Wno-implicit-int" +--- 1751,1762 ---- + dnl Check that the X11 header files don't use implicit declarations + AC_MSG_CHECKING(if X11 header files implicitly declare return values) + cflags_save=$CFLAGS +! dnl -Werror is GCC only, others like Solaris Studio might not like it +! if test "$GCC" = yes; then +! CFLAGS="$CFLAGS $X_CFLAGS -Werror" +! else +! CFLAGS="$CFLAGS $X_CFLAGS" +! fi + AC_TRY_COMPILE([#include ], , + AC_MSG_RESULT(no), + CFLAGS="$CFLAGS -Wno-implicit-int" +*** ../vim-7.3.922/src/auto/configure 2013-04-15 14:44:53.000000000 +0200 +--- src/auto/configure 2013-05-04 04:34:50.000000000 +0200 +*************** +*** 7656,7662 **** + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if X11 header files implicitly declare return values" >&5 + $as_echo_n "checking if X11 header files implicitly declare return values... " >&6; } + cflags_save=$CFLAGS +! CFLAGS="$CFLAGS $X_CFLAGS -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +--- 7656,7666 ---- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if X11 header files implicitly declare return values" >&5 + $as_echo_n "checking if X11 header files implicitly declare return values... " >&6; } + cflags_save=$CFLAGS +! if test "$GCC" = yes; then +! CFLAGS="$CFLAGS $X_CFLAGS -Werror" +! else +! CFLAGS="$CFLAGS $X_CFLAGS" +! fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +*** ../vim-7.3.922/src/version.c 2013-05-04 04:11:01.000000000 +0200 +--- src/version.c 2013-05-04 04:39:13.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 923, + /**/ + +-- +GALAHAD: Camelot ... +LAUNCELOT: Camelot ... +GAWAIN: It's only a model. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.924 b/7.3.924 new file mode 100644 index 0000000..c743c3e --- /dev/null +++ b/7.3.924 @@ -0,0 +1,1628 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.924 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.924 +Problem: Python interface can't easily access options. +Solution: Add vim.options, vim.window.options and vim.buffer.options. (ZyX) +Files: runtime/doc/if_pyth.txt, src/eval.c, src/if_py_both.h, + src/if_python.c, src/if_python3.c, src/option.c, + src/proto/eval.pro, src/proto/option.pro, src/testdir/test86.in, + src/testdir/test86.ok, src/testdir/test87.in, + src/testdir/test87.ok, src/vim.h + + +*** ../vim-7.3.923/runtime/doc/if_pyth.txt 2013-04-24 14:06:42.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-05-06 03:39:13.000000000 +0200 +*************** +*** 243,248 **** +--- 243,260 ---- + vim (|v:|) variables respectively. Identical to `vim.bindeval("g:")`, + but faster. + ++ vim.options *python-options* ++ Object partly supporting mapping protocol (supports setting and ++ getting items) providing a read-write access to global options. ++ Note: unlike |:set| this provides access only to global options. You ++ cannot use this object to obtain or set local options' values or ++ access local-only options in any fashion. Raises KeyError if no global ++ option with such name exists (i.e. does not raise KeyError for ++ |global-local| options and global only options, but does for window- ++ and buffer-local ones). Use |python-buffer| objects to access to ++ buffer-local options and |python-window| objects to access to ++ window-local options. ++ + Output from Python *python-output* + Vim displays all Python code output in the Vim message area. Normal + output appears as information messages, and error output appears as +*************** +*** 283,288 **** +--- 295,311 ---- + line numbers, which start from 1. This is particularly relevant when dealing + with marks (see below) which use vim line numbers. + ++ The buffer object attributes are: ++ b.vars Dictionary-like object used to access ++ |buffer-variable|s. ++ b.options Mapping object (supports item getting, setting and ++ deleting) that provides access to buffer-local options ++ and buffer-local values of |global-local| options. Use ++ |python-window|.options if option is window-local, ++ this object will raise KeyError. If option is ++ |global-local| and local value is missing getting it ++ will return None. ++ + The buffer object methods are: + b.append(str) Append a line to the buffer + b.append(str, nr) Idem, below line "nr" +*************** +*** 313,318 **** +--- 336,343 ---- + :py (row,col) = b.mark('a') # named mark + :py r = b.range(1,5) # a sub-range of the buffer + :py b.vars["foo"] = "bar" # assign b:foo variable ++ :py b.options["ff"] = "dos" # set fileformat ++ :py del b.options["ar"] # same as :set autoread< + + ============================================================================== + 4. Range objects *python-range* +*************** +*** 363,368 **** +--- 388,401 ---- + vars (read-only) The window |w:| variables. Attribute is + unassignable, but you can change window + variables this way ++ options (read-only) The window-local options. Attribute is ++ unassignable, but you can change window ++ options this way. Provides access only to ++ window-local options, for buffer-local use ++ |python-buffer| and for global ones use ++ |python-options|. If option is |global-local| ++ and local value is missing getting it will ++ return None. + The height attribute is writable only if the screen is split horizontally. + The width attribute is writable only if the screen is split vertically. + +*** ../vim-7.3.923/src/eval.c 2013-04-24 14:06:42.000000000 +0200 +--- src/eval.c 2013-05-06 03:42:00.000000000 +0200 +*************** +*** 16643,16651 **** +--- 16643,16690 ---- + setwinvar(argvars, rettv, 0); + } + ++ int ++ switch_win(save_curwin, save_curtab, win, tp) ++ win_T **save_curwin; ++ tabpage_T **save_curtab; ++ win_T *win; ++ tabpage_T *tp; ++ { ++ #ifdef FEAT_WINDOWS ++ /* set curwin to be our win, temporarily */ ++ *save_curwin = curwin; ++ *save_curtab = curtab; ++ goto_tabpage_tp(tp, TRUE); ++ if (!win_valid(win)) ++ return FAIL; ++ curwin = win; ++ curbuf = curwin->w_buffer; ++ #endif ++ return OK; ++ } ++ ++ void ++ restore_win(save_curwin, save_curtab) ++ win_T *save_curwin; ++ tabpage_T *save_curtab; ++ { ++ #ifdef FEAT_WINDOWS ++ /* Restore current tabpage and window, if still valid (autocomands can ++ * make them invalid). */ ++ if (valid_tabpage(save_curtab)) ++ goto_tabpage_tp(save_curtab, TRUE); ++ if (win_valid(save_curwin)) ++ { ++ curwin = save_curwin; ++ curbuf = curwin->w_buffer; ++ } ++ #endif ++ } ++ + /* + * "setwinvar()" and "settabwinvar()" functions + */ ++ + static void + setwinvar(argvars, rettv, off) + typval_T *argvars; +*************** +*** 16678,16691 **** + if (win != NULL && varname != NULL && varp != NULL) + { + #ifdef FEAT_WINDOWS +! /* set curwin to be our win, temporarily */ +! save_curwin = curwin; +! save_curtab = curtab; +! goto_tabpage_tp(tp, TRUE); +! if (!win_valid(win)) + return; +- curwin = win; +- curbuf = curwin->w_buffer; + #endif + + if (*varname == '&') +--- 16717,16724 ---- + if (win != NULL && varname != NULL && varp != NULL) + { + #ifdef FEAT_WINDOWS +! if (switch_win(&save_curwin, &save_curtab, win, tp) == FAIL) + return; + #endif + + if (*varname == '&') +*************** +*** 16713,16727 **** + } + + #ifdef FEAT_WINDOWS +! /* Restore current tabpage and window, if still valid (autocomands can +! * make them invalid). */ +! if (valid_tabpage(save_curtab)) +! goto_tabpage_tp(save_curtab, TRUE); +! if (win_valid(save_curwin)) +! { +! curwin = save_curwin; +! curbuf = curwin->w_buffer; +! } + #endif + } + } +--- 16746,16752 ---- + } + + #ifdef FEAT_WINDOWS +! restore_win(save_curwin, save_curtab); + #endif + } + } +*** ../vim-7.3.923/src/if_py_both.h 2013-04-24 14:06:42.000000000 +0200 +--- src/if_py_both.h 2013-05-06 03:47:38.000000000 +0200 +*************** +*** 1497,1502 **** +--- 1497,1775 ---- + { NULL, NULL, 0, NULL } + }; + ++ /* ++ * Options object ++ */ ++ ++ static PyTypeObject OptionsType; ++ ++ typedef int (*checkfun)(void *); ++ ++ typedef struct ++ { ++ PyObject_HEAD ++ int opt_type; ++ void *from; ++ checkfun Check; ++ PyObject *fromObj; ++ } OptionsObject; ++ ++ static PyObject * ++ OptionsItem(OptionsObject *this, PyObject *keyObject) ++ { ++ char_u *key; ++ int flags; ++ long numval; ++ char_u *stringval; ++ ++ if (this->Check(this->from)) ++ return NULL; ++ ++ DICTKEY_DECL ++ ++ DICTKEY_GET_NOTEMPTY(NULL) ++ ++ flags = get_option_value_strict(key, &numval, &stringval, ++ this->opt_type, this->from); ++ ++ DICTKEY_UNREF ++ ++ if (flags == 0) ++ { ++ PyErr_SetString(PyExc_KeyError, "Option does not exist in given scope"); ++ return NULL; ++ } ++ ++ if (flags & SOPT_UNSET) ++ { ++ Py_INCREF(Py_None); ++ return Py_None; ++ } ++ else if (flags & SOPT_BOOL) ++ { ++ PyObject *r; ++ r = numval ? Py_True : Py_False; ++ Py_INCREF(r); ++ return r; ++ } ++ else if (flags & SOPT_NUM) ++ return PyInt_FromLong(numval); ++ else if (flags & SOPT_STRING) ++ { ++ if (stringval) ++ return PyBytes_FromString((char *) stringval); ++ else ++ { ++ PyErr_SetString(PyExc_ValueError, "Unable to get option value"); ++ return NULL; ++ } ++ } ++ else ++ { ++ PyErr_SetVim("Internal error: unknown option type. Should not happen"); ++ return NULL; ++ } ++ } ++ ++ static int ++ set_option_value_for(key, numval, stringval, opt_flags, opt_type, from) ++ char_u *key; ++ int numval; ++ char_u *stringval; ++ int opt_flags; ++ int opt_type; ++ void *from; ++ { ++ win_T *save_curwin; ++ tabpage_T *save_curtab; ++ aco_save_T aco; ++ int r = 0; ++ ++ switch (opt_type) ++ { ++ case SREQ_WIN: ++ if (switch_win(&save_curwin, &save_curtab, (win_T *) from, curtab) ++ == FAIL) ++ { ++ PyErr_SetVim("Problem while switching windows."); ++ return -1; ++ } ++ set_option_value(key, numval, stringval, opt_flags); ++ restore_win(save_curwin, save_curtab); ++ break; ++ case SREQ_BUF: ++ aucmd_prepbuf(&aco, (buf_T *) from); ++ set_option_value(key, numval, stringval, opt_flags); ++ aucmd_restbuf(&aco); ++ break; ++ case SREQ_GLOBAL: ++ set_option_value(key, numval, stringval, opt_flags); ++ break; ++ } ++ return r; ++ } ++ ++ static int ++ OptionsAssItem(OptionsObject *this, PyObject *keyObject, PyObject *valObject) ++ { ++ char_u *key; ++ int flags; ++ int opt_flags; ++ int r = 0; ++ ++ if (this->Check(this->from)) ++ return -1; ++ ++ DICTKEY_DECL ++ ++ DICTKEY_GET_NOTEMPTY(-1) ++ ++ flags = get_option_value_strict(key, NULL, NULL, ++ this->opt_type, this->from); ++ ++ DICTKEY_UNREF ++ ++ if (flags == 0) ++ { ++ PyErr_SetString(PyExc_KeyError, "Option does not exist in given scope"); ++ return -1; ++ } ++ ++ if (valObject == NULL) ++ { ++ if (this->opt_type == SREQ_GLOBAL) ++ { ++ PyErr_SetString(PyExc_ValueError, "Unable to unset global option"); ++ return -1; ++ } ++ else if (!(flags & SOPT_GLOBAL)) ++ { ++ PyErr_SetString(PyExc_ValueError, "Unable to unset option without " ++ "global value"); ++ return -1; ++ } ++ else ++ { ++ unset_global_local_option(key, this->from); ++ return 0; ++ } ++ } ++ ++ opt_flags = (this->opt_type ? OPT_LOCAL : OPT_GLOBAL); ++ ++ if (flags & SOPT_BOOL) ++ { ++ if (!PyBool_Check(valObject)) ++ { ++ PyErr_SetString(PyExc_ValueError, "Object must be boolean"); ++ return -1; ++ } ++ ++ r = set_option_value_for(key, (valObject == Py_True), NULL, opt_flags, ++ this->opt_type, this->from); ++ } ++ else if (flags & SOPT_NUM) ++ { ++ int val; ++ ++ #if PY_MAJOR_VERSION < 3 ++ if (PyInt_Check(valObject)) ++ val = PyInt_AsLong(valObject); ++ else ++ #endif ++ if (PyLong_Check(valObject)) ++ val = PyLong_AsLong(valObject); ++ else ++ { ++ PyErr_SetString(PyExc_ValueError, "Object must be integer"); ++ return -1; ++ } ++ ++ r = set_option_value_for(key, val, NULL, opt_flags, ++ this->opt_type, this->from); ++ } ++ else ++ { ++ char_u *val; ++ if (PyBytes_Check(valObject)) ++ { ++ ++ if (PyString_AsStringAndSize(valObject, (char **) &val, NULL) == -1) ++ return -1; ++ if (val == NULL) ++ return -1; ++ ++ val = vim_strsave(val); ++ } ++ else if (PyUnicode_Check(valObject)) ++ { ++ PyObject *bytes; ++ ++ bytes = PyUnicode_AsEncodedString(valObject, (char *)ENC_OPT, NULL); ++ if (bytes == NULL) ++ return -1; ++ ++ if(PyString_AsStringAndSize(bytes, (char **) &val, NULL) == -1) ++ return -1; ++ if (val == NULL) ++ return -1; ++ ++ val = vim_strsave(val); ++ Py_XDECREF(bytes); ++ } ++ else ++ { ++ PyErr_SetString(PyExc_ValueError, "Object must be string"); ++ return -1; ++ } ++ ++ r = set_option_value_for(key, 0, val, opt_flags, ++ this->opt_type, this->from); ++ vim_free(val); ++ } ++ ++ return r; ++ } ++ ++ static int ++ dummy_check(void *arg UNUSED) ++ { ++ return 0; ++ } ++ ++ static PyObject * ++ OptionsNew(int opt_type, void *from, checkfun Check, PyObject *fromObj) ++ { ++ OptionsObject *self; ++ ++ self = PyObject_NEW(OptionsObject, &OptionsType); ++ if (self == NULL) ++ return NULL; ++ ++ self->opt_type = opt_type; ++ self->from = from; ++ self->Check = Check; ++ self->fromObj = fromObj; ++ if (fromObj) ++ Py_INCREF(fromObj); ++ ++ return (PyObject *)(self); ++ } ++ ++ static void ++ OptionsDestructor(PyObject *self) ++ { ++ if (((OptionsObject *)(self))->fromObj) ++ Py_DECREF(((OptionsObject *)(self))->fromObj); ++ DESTRUCTOR_FINISH(self); ++ } ++ ++ static PyMappingMethods OptionsAsMapping = { ++ (lenfunc) NULL, ++ (binaryfunc) OptionsItem, ++ (objobjargproc) OptionsAssItem, ++ }; ++ + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) + + static int +*************** +*** 1534,1541 **** + #endif + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->win->w_vars); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssss]", "buffer", "cursor", "height", "vars"); + else + return NULL; + } +--- 1807,1818 ---- + #endif + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->win->w_vars); ++ else if (strcmp(name, "options") == 0) ++ return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, ++ (PyObject *) this); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sssss]", "buffer", "cursor", "height", "vars", +! "options"); + else + return NULL; + } +*************** +*** 2499,2506 **** + return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->buf->b_vars); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sss]", "name", "number", "vars"); + else + return NULL; + } +--- 2776,2786 ---- + return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->buf->b_vars); ++ else if (strcmp(name, "options") == 0) ++ return OptionsNew(SREQ_BUF, this->buf, (checkfun) CheckBuffer, ++ (PyObject *) this); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssss]", "name", "number", "vars", "options"); + else + return NULL; + } +*************** +*** 3121,3126 **** +--- 3401,3414 ---- + FunctionType.tp_getattr = FunctionGetattr; + #endif + ++ vim_memset(&OptionsType, 0, sizeof(OptionsType)); ++ OptionsType.tp_name = "vim.options"; ++ OptionsType.tp_basicsize = sizeof(OptionsObject); ++ OptionsType.tp_flags = Py_TPFLAGS_DEFAULT; ++ OptionsType.tp_doc = "object for manipulating options"; ++ OptionsType.tp_as_mapping = &OptionsAsMapping; ++ OptionsType.tp_dealloc = OptionsDestructor; ++ + #if PY_MAJOR_VERSION >= 3 + vim_memset(&vimmodule, 0, sizeof(vimmodule)); + vimmodule.m_name = "vim"; +*** ../vim-7.3.923/src/if_python.c 2013-04-24 14:06:42.000000000 +0200 +--- src/if_python.c 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 1341,1346 **** +--- 1341,1347 ---- + PyType_Ready(&BufListType); + PyType_Ready(&WinListType); + PyType_Ready(&CurrentType); ++ PyType_Ready(&OptionsType); + + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); +*************** +*** 1360,1365 **** +--- 1361,1369 ---- + tmp = DictionaryNew(&vimvardict); + PyDict_SetItemString(dict, "vvars", tmp); + Py_DECREF(tmp); ++ tmp = OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL); ++ PyDict_SetItemString(dict, "options", tmp); ++ Py_DECREF(tmp); + PyDict_SetItemString(dict, "VAR_LOCKED", PyInt_FromLong(VAR_LOCKED)); + PyDict_SetItemString(dict, "VAR_FIXED", PyInt_FromLong(VAR_FIXED)); + PyDict_SetItemString(dict, "VAR_SCOPE", PyInt_FromLong(VAR_SCOPE)); +*** ../vim-7.3.923/src/if_python3.c 2013-04-24 14:06:42.000000000 +0200 +--- src/if_python3.c 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 1628,1633 **** +--- 1628,1634 ---- + PyType_Ready(&DictionaryType); + PyType_Ready(&ListType); + PyType_Ready(&FunctionType); ++ PyType_Ready(&OptionsType); + + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); +*************** +*** 1649,1654 **** +--- 1650,1657 ---- + + PyModule_AddObject(mod, "vars", DictionaryNew(&globvardict)); + PyModule_AddObject(mod, "vvars", DictionaryNew(&vimvardict)); ++ PyModule_AddObject(mod, "options", ++ OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL)); + + #define ADD_INT_CONSTANT(name, value) \ + tmp = PyLong_FromLong(value); \ +*** ../vim-7.3.923/src/option.c 2013-03-19 16:46:59.000000000 +0100 +--- src/option.c 2013-05-06 03:47:31.000000000 +0200 +*************** +*** 8820,8825 **** +--- 8820,8963 ---- + } + #endif + ++ #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) ++ /* ++ * Returns the option attributes and its value. Unlike the above function it ++ * will return either global value or local value of the option depending on ++ * what was requested, but it will never return global value if it was ++ * requested to return local one and vice versa. Neither it will return ++ * buffer-local value if it was requested to return window-local one. ++ * ++ * Pretends that option is absent if it is not present in the requested scope ++ * (i.e. has no global, window-local or buffer-local value depending on ++ * opt_type). Uses ++ * ++ * Returned flags: ++ * 0 hidden or unknown option ++ * see SOPT_* in vim.h for other flags ++ * ++ * Possible opt_type values: see SREQ_* in vim.h ++ */ ++ int ++ get_option_value_strict(name, numval, stringval, opt_type, from) ++ char_u *name; ++ long *numval; ++ char_u **stringval; /* NULL when only obtaining attributes */ ++ int opt_type; ++ void *from; ++ { ++ int opt_idx; ++ char_u *varp; ++ struct vimoption *p; ++ int r = 0; ++ ++ opt_idx = findoption(name); ++ if (opt_idx < 0) ++ return 0; ++ ++ p = &(options[opt_idx]); ++ ++ /* Hidden option */ ++ if (p->var == NULL) ++ return 0; ++ ++ if (p->flags & P_BOOL) ++ r |= SOPT_BOOL; ++ else if (p->flags & P_NUM) ++ r |= SOPT_NUM; ++ else if (p->flags & P_STRING) ++ r |= SOPT_STRING; ++ ++ if (p->indir == PV_NONE) ++ { ++ if (opt_type == SREQ_GLOBAL) ++ r |= SOPT_GLOBAL; ++ else ++ return 0; /* Did not request global-only option */ ++ } ++ else ++ { ++ if (p->indir & PV_BOTH) ++ r |= SOPT_GLOBAL; ++ else if (opt_type == SREQ_GLOBAL) ++ return 0; /* Requested global option */ ++ ++ if (p->indir & PV_WIN) ++ { ++ if (opt_type == SREQ_BUF) ++ return 0; /* Did not request window-local option */ ++ else ++ r |= SOPT_WIN; ++ } ++ else if (p->indir & PV_BUF) ++ { ++ if (opt_type == SREQ_WIN) ++ return 0; /* Did not request buffer-local option */ ++ else ++ r |= SOPT_BUF; ++ } ++ } ++ ++ if (stringval == NULL) ++ return r; ++ ++ if (opt_type == SREQ_GLOBAL) ++ varp = p->var; ++ else ++ { ++ if (opt_type == SREQ_BUF) ++ { ++ /* Special case: 'modified' is b_changed, but we also want to ++ * consider it set when 'ff' or 'fenc' changed. */ ++ if (p->indir == PV_MOD) ++ { ++ *numval = bufIsChanged((buf_T *) from); ++ varp = NULL; ++ } ++ #ifdef FEAT_CRYPT ++ else if (p->indir == PV_KEY) ++ { ++ /* never return the value of the crypt key */ ++ *stringval = NULL; ++ varp = NULL; ++ } ++ #endif ++ else ++ { ++ aco_save_T aco; ++ aucmd_prepbuf(&aco, (buf_T *) from); ++ varp = get_varp(p); ++ aucmd_restbuf(&aco); ++ } ++ } ++ else if (opt_type == SREQ_WIN) ++ { ++ win_T *save_curwin; ++ save_curwin = curwin; ++ curwin = (win_T *) from; ++ curbuf = curwin->w_buffer; ++ varp = get_varp(p); ++ curwin = save_curwin; ++ curbuf = curwin->w_buffer; ++ } ++ if (varp == p->var) ++ return (r | SOPT_UNSET); ++ } ++ ++ if (varp != NULL) ++ { ++ if (p->flags & P_STRING) ++ *stringval = vim_strsave(*(char_u **)(varp)); ++ else if (p->flags & P_NUM) ++ *numval = *(long *) varp; ++ else ++ *numval = *(int *)varp; ++ } ++ ++ return r; ++ } ++ #endif ++ + /* + * Set the value of option "name". + * Use "string" for string options, use "number" for other options. +*************** +*** 9557,9562 **** +--- 9695,9781 ---- + } + + /* ++ * Unset local option value, similar to ":set opt<". ++ */ ++ ++ void ++ unset_global_local_option(name, from) ++ char_u *name; ++ void *from; ++ { ++ struct vimoption *p; ++ int opt_idx; ++ ++ buf_T *buf = (buf_T *) from; ++ win_T *win = (win_T *) from; ++ ++ opt_idx = findoption(name); ++ p = &(options[opt_idx]); ++ ++ switch ((int)p->indir) ++ { ++ /* global option with local value: use local value if it's been set */ ++ case PV_EP: ++ *buf->b_p_ep = NUL; ++ break; ++ case PV_KP: ++ *buf->b_p_kp = NUL; ++ break; ++ case PV_PATH: ++ *buf->b_p_path = NUL; ++ break; ++ case PV_AR: ++ buf->b_p_ar = -1; ++ break; ++ case PV_TAGS: ++ *buf->b_p_tags = NUL; ++ break; ++ #ifdef FEAT_FIND_ID ++ case PV_DEF: ++ *buf->b_p_def = NUL; ++ break; ++ case PV_INC: ++ *buf->b_p_inc = NUL; ++ break; ++ #endif ++ #ifdef FEAT_INS_EXPAND ++ case PV_DICT: ++ *buf->b_p_dict = NUL; ++ break; ++ case PV_TSR: ++ *buf->b_p_tsr = NUL; ++ break; ++ #endif ++ #ifdef FEAT_QUICKFIX ++ case PV_EFM: ++ *buf->b_p_efm = NUL; ++ break; ++ case PV_GP: ++ *buf->b_p_gp = NUL; ++ break; ++ case PV_MP: ++ *buf->b_p_mp = NUL; ++ break; ++ #endif ++ #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) ++ case PV_BEXPR: ++ *buf->b_p_bexpr = NUL; ++ break; ++ #endif ++ #if defined(FEAT_CRYPT) ++ case PV_CM: ++ *buf->b_p_cm = NUL; ++ break; ++ #endif ++ #ifdef FEAT_STL_OPT ++ case PV_STL: ++ *win->w_p_stl = NUL; ++ break; ++ #endif ++ } ++ } ++ ++ /* + * Get pointer to option variable, depending on local or global scope. + */ + static char_u * +*** ../vim-7.3.923/src/proto/eval.pro 2013-04-15 12:27:30.000000000 +0200 +--- src/proto/eval.pro 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 125,128 **** +--- 125,130 ---- + void ex_oldfiles __ARGS((exarg_T *eap)); + int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen)); + char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags)); ++ int switch_win __ARGS((win_T **, tabpage_T **, win_T *, tabpage_T *)); ++ void restore_win __ARGS((win_T *, tabpage_T *)); + /* vim: set ft=c : */ +*** ../vim-7.3.923/src/proto/option.pro 2013-01-17 17:01:57.000000000 +0100 +--- src/proto/option.pro 2013-05-06 03:47:07.000000000 +0200 +*************** +*** 22,27 **** +--- 22,28 ---- + char_u *check_colorcolumn __ARGS((win_T *wp)); + char_u *check_stl_option __ARGS((char_u *s)); + int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval, int opt_flags)); ++ int get_option_value_strict __ARGS((char_u *name, long *numval, char_u **stringval, int opt_type, void *from)); + void set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags)); + char_u *get_term_code __ARGS((char_u *tname)); + char_u *get_highlight_default __ARGS((void)); +*************** +*** 33,38 **** +--- 34,40 ---- + void free_one_termoption __ARGS((char_u *var)); + void set_term_defaults __ARGS((void)); + void comp_col __ARGS((void)); ++ void unset_global_local_option __ARGS((char_u *name, void *from)); + char_u *get_equalprg __ARGS((void)); + void win_copy_options __ARGS((win_T *wp_from, win_T *wp_to)); + void copy_winopt __ARGS((winopt_T *from, winopt_T *to)); +*** ../vim-7.3.923/src/testdir/test86.in 2013-04-24 14:06:42.000000000 +0200 +--- src/testdir/test86.in 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 359,364 **** +--- 359,483 ---- + :put =pyeval('vim.vars[''foo'']') + :put =pyeval('vim.current.window.vars[''abc'']') + :put =pyeval('vim.current.buffer.vars[''baz'']') ++ :" ++ :" Options ++ :" paste: boolean, global ++ :" previewheight number, global ++ :" operatorfunc: string, global ++ :" number: boolean, window-local ++ :" numberwidth: number, window-local ++ :" colorcolumn: string, window-local ++ :" statusline: string, window-local/global ++ :" autoindent: boolean, buffer-local ++ :" iminsert: number, buffer-local ++ :" omnifunc: string, buffer-local ++ :" preserveindent: boolean, buffer-local/global ++ :" path: string, buffer-local/global ++ :let g:bufs=[bufnr('%')] ++ :new ++ :let g:bufs+=[bufnr('%')] ++ :vnew ++ :let g:bufs+=[bufnr('%')] ++ :wincmd j ++ :vnew ++ :let g:bufs+=[bufnr('%')] ++ :wincmd l ++ :fun RecVars(opt) ++ : let gval =string(eval('&g:'.a:opt)) ++ : let wvals=join(map(range(1, 4), 'v:val.":".string(getwinvar(v:val, "&".a:opt))')) ++ : let bvals=join(map(copy(g:bufs), 'v:val.":".string(getbufvar(v:val, "&".a:opt))')) ++ : put =' G: '.gval ++ : put =' W: '.wvals ++ : put =' B: '.wvals ++ :endfun ++ py << EOF ++ def e(s, g=globals(), l=locals()): ++ try: ++ exec(s, g, l) ++ except Exception as e: ++ vim.command('throw ' + repr(e.__class__.__name__)) ++ ++ def ev(s, g=globals(), l=locals()): ++ try: ++ return eval(s, g, l) ++ except Exception as e: ++ vim.command('throw ' + repr(e.__class__.__name__)) ++ return 0 ++ EOF ++ :function E(s) ++ : python e(vim.eval('a:s')) ++ :endfunction ++ :function Ev(s) ++ : return pyeval('ev(vim.eval("a:s"))') ++ :endfunction ++ :py gopts1=vim.options ++ :py wopts1=vim.windows[2].options ++ :py wopts2=vim.windows[0].options ++ :py wopts3=vim.windows[1].options ++ :py bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options ++ :py bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options ++ :py bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options ++ :let lst=[] ++ :let lst+=[['paste', 1, 0, 1, 2, 1, 1, 0 ]] ++ :let lst+=[['previewheight', 5, 1, 6, 'a', 0, 1, 0 ]] ++ :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] ++ :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] ++ :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] ++ :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc', 0, 0, 1 ]] ++ :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] ++ :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] ++ :let lst+=[['iminsert', 0, 2, 1, 3, 0, 0, 2 ]] ++ :let lst+=[['omnifunc', 'A', 'B', 'C', 1, 0, 0, 2 ]] ++ :let lst+=[['preserveindent', 0, 1, 1, 2, 1, 1, 2 ]] ++ :let lst+=[['path', '.,,', ',,', '.', 0, 0, 1, 2 ]] ++ :for [oname, oval1, oval2, oval3, invval, bool, global, local] in lst ++ : py oname=vim.eval('oname') ++ : py oval1=vim.bindeval('oval1') ++ : py oval2=vim.bindeval('oval2') ++ : py oval3=vim.bindeval('oval3') ++ : if invval is 0 || invval is 1 ++ : py invval=bool(vim.bindeval('invval')) ++ : else ++ : py invval=vim.bindeval('invval') ++ : endif ++ : if bool ++ : py oval1=bool(oval1) ++ : py oval2=bool(oval2) ++ : py oval3=bool(oval3) ++ : endif ++ : put ='>>> '.oname ++ : for v in ['gopts1', 'wopts1', 'bopts1'] ++ : try ++ : put =' p/'.v.': '.Ev('repr('.v.'['''.oname.'''])') ++ : catch ++ : put =' p/'.v.'! '.v:exception ++ : endtry ++ : try ++ : call E(v.'["'.oname.'"]=invval') ++ : catch ++ : put =' inv: '.string(invval).'! '.v:exception ++ : endtry ++ : for vv in (v is# 'gopts1' ? [v] : [v, v[:-2].'2', v[:-2].'3']) ++ : let val=substitute(vv, '^.opts', 'oval', '') ++ : try ++ : call E(vv.'["'.oname.'"]='.val) ++ : catch ++ : put =' '.vv.'! '.v:exception ++ : endtry ++ : endfor ++ : endfor ++ : call RecVars(oname) ++ : for v in ['wopts3', 'bopts3'] ++ : try ++ : call E('del '.v.'["'.oname.'"]') ++ : catch ++ : put =' del '.v.'! '.v:exception ++ : endtry ++ : endfor ++ : call RecVars(oname) ++ endtry ++ :endfor ++ :only + :endfun + :" + :call Test() +*** ../vim-7.3.923/src/testdir/test86.ok 2013-04-24 14:06:42.000000000 +0200 +--- src/testdir/test86.ok 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 80,82 **** +--- 80,308 ---- + bac + def + bar ++ >>> paste ++ p/gopts1: False ++ inv: 2! ValueError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1! KeyError ++ inv: 2! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 1 ++ W: 1:1 2:1 3:1 4:1 ++ B: 1:1 2:1 3:1 4:1 ++ del wopts3! KeyError ++ del bopts3! KeyError ++ G: 1 ++ W: 1:1 2:1 3:1 4:1 ++ B: 1:1 2:1 3:1 4:1 ++ >>> previewheight ++ p/gopts1: 12 ++ inv: 'a'! ValueError ++ p/wopts1! KeyError ++ inv: 'a'! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1! KeyError ++ inv: 'a'! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 5 ++ W: 1:5 2:5 3:5 4:5 ++ B: 1:5 2:5 3:5 4:5 ++ del wopts3! KeyError ++ del bopts3! KeyError ++ G: 5 ++ W: 1:5 2:5 3:5 4:5 ++ B: 1:5 2:5 3:5 4:5 ++ >>> operatorfunc ++ p/gopts1: '' ++ inv: 2! ValueError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1! KeyError ++ inv: 2! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 'A' ++ W: 1:'A' 2:'A' 3:'A' 4:'A' ++ B: 1:'A' 2:'A' 3:'A' 4:'A' ++ del wopts3! KeyError ++ del bopts3! KeyError ++ G: 'A' ++ W: 1:'A' 2:'A' 3:'A' 4:'A' ++ B: 1:'A' 2:'A' 3:'A' 4:'A' ++ >>> number ++ p/gopts1! KeyError ++ inv: 0! KeyError ++ gopts1! KeyError ++ p/wopts1: False ++ p/bopts1! KeyError ++ inv: 0! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ del wopts3! ValueError ++ del bopts3! KeyError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ >>> numberwidth ++ p/gopts1! KeyError ++ inv: -100! KeyError ++ gopts1! KeyError ++ p/wopts1: 8 ++ p/bopts1! KeyError ++ inv: -100! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 8 ++ W: 1:3 2:5 3:2 4:8 ++ B: 1:3 2:5 3:2 4:8 ++ del wopts3! ValueError ++ del bopts3! KeyError ++ G: 8 ++ W: 1:3 2:5 3:2 4:8 ++ B: 1:3 2:5 3:2 4:8 ++ >>> colorcolumn ++ p/gopts1! KeyError ++ inv: 'abc'! KeyError ++ gopts1! KeyError ++ p/wopts1: '' ++ p/bopts1! KeyError ++ inv: 'abc'! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: '' ++ W: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ B: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ del wopts3! ValueError ++ del bopts3! KeyError ++ G: '' ++ W: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ B: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ >>> statusline ++ p/gopts1: '' ++ inv: 0! ValueError ++ p/wopts1: None ++ inv: 0! ValueError ++ p/bopts1! KeyError ++ inv: 0! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: '1' ++ W: 1:'2' 2:'4' 3:'1' 4:'1' ++ B: 1:'2' 2:'4' 3:'1' 4:'1' ++ del bopts3! KeyError ++ G: '1' ++ W: 1:'2' 2:'1' 3:'1' 4:'1' ++ B: 1:'2' 2:'1' 3:'1' 4:'1' ++ >>> autoindent ++ p/gopts1! KeyError ++ inv: 2! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: False ++ inv: 2! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ >>> iminsert ++ p/gopts1! KeyError ++ inv: 3! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 3! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: 2 ++ G: 1 ++ W: 1:2 2:1 3:0 4:2 ++ B: 1:2 2:1 3:0 4:2 ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: 1 ++ W: 1:2 2:1 3:0 4:2 ++ B: 1:2 2:1 3:0 4:2 ++ >>> omnifunc ++ p/gopts1! KeyError ++ inv: 1! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 1! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: '' ++ inv: 1! ValueError ++ G: '' ++ W: 1:'B' 2:'C' 3:'A' 4:'' ++ B: 1:'B' 2:'C' 3:'A' 4:'' ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: '' ++ W: 1:'B' 2:'C' 3:'A' 4:'' ++ B: 1:'B' 2:'C' 3:'A' 4:'' ++ >>> preserveindent ++ p/gopts1! KeyError ++ inv: 2! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: False ++ inv: 2! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ >>> path ++ p/gopts1: '.,/usr/include,,' ++ inv: 0! ValueError ++ p/wopts1! KeyError ++ inv: 0! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: None ++ inv: 0! ValueError ++ G: '.,,' ++ W: 1:',,' 2:'.' 3:'.,,' 4:'.,,' ++ B: 1:',,' 2:'.' 3:'.,,' 4:'.,,' ++ del wopts3! KeyError ++ G: '.,,' ++ W: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' ++ B: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' +*** ../vim-7.3.923/src/testdir/test87.in 2013-04-24 14:06:42.000000000 +0200 +--- src/testdir/test87.in 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 328,333 **** +--- 328,452 ---- + :put =py3eval('vim.vars[''foo'']') + :put =py3eval('vim.current.window.vars[''abc'']') + :put =py3eval('vim.current.buffer.vars[''baz'']') ++ :" ++ :" Options ++ :" paste: boolean, global ++ :" previewheight number, global ++ :" operatorfunc: string, global ++ :" number: boolean, window-local ++ :" numberwidth: number, window-local ++ :" colorcolumn: string, window-local ++ :" statusline: string, window-local/global ++ :" autoindent: boolean, buffer-local ++ :" iminsert: number, buffer-local ++ :" omnifunc: string, buffer-local ++ :" preserveindent: boolean, buffer-local/global ++ :" path: string, buffer-local/global ++ :let g:bufs=[bufnr('%')] ++ :new ++ :let g:bufs+=[bufnr('%')] ++ :vnew ++ :let g:bufs+=[bufnr('%')] ++ :wincmd j ++ :vnew ++ :let g:bufs+=[bufnr('%')] ++ :wincmd l ++ :fun RecVars(opt) ++ : let gval =string(eval('&g:'.a:opt)) ++ : let wvals=join(map(range(1, 4), 'v:val.":".string(getwinvar(v:val, "&".a:opt))')) ++ : let bvals=join(map(copy(g:bufs), 'v:val.":".string(getbufvar(v:val, "&".a:opt))')) ++ : put =' G: '.gval ++ : put =' W: '.wvals ++ : put =' B: '.wvals ++ :endfun ++ py3 << EOF ++ def e(s, g=globals(), l=locals()): ++ try: ++ exec(s, g, l) ++ except Exception as e: ++ vim.command('throw ' + repr(e.__class__.__name__)) ++ ++ def ev(s, g=globals(), l=locals()): ++ try: ++ return eval(s, g, l) ++ except Exception as e: ++ vim.command('throw ' + repr(e.__class__.__name__)) ++ return 0 ++ EOF ++ :function E(s) ++ : python3 e(vim.eval('a:s')) ++ :endfunction ++ :function Ev(s) ++ : return py3eval('ev(vim.eval("a:s"))') ++ :endfunction ++ :py3 gopts1=vim.options ++ :py3 wopts1=vim.windows[2].options ++ :py3 wopts2=vim.windows[0].options ++ :py3 wopts3=vim.windows[1].options ++ :py3 bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options ++ :py3 bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options ++ :py3 bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options ++ :let lst=[] ++ :let lst+=[['paste', 1, 0, 1, 2, 1, 1, 0 ]] ++ :let lst+=[['previewheight', 5, 1, 6, 'a', 0, 1, 0 ]] ++ :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] ++ :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] ++ :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] ++ :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc', 0, 0, 1 ]] ++ :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] ++ :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] ++ :let lst+=[['iminsert', 0, 2, 1, 3, 0, 0, 2 ]] ++ :let lst+=[['omnifunc', 'A', 'B', 'C', 1, 0, 0, 2 ]] ++ :let lst+=[['preserveindent', 0, 1, 1, 2, 1, 1, 2 ]] ++ :let lst+=[['path', '.,,', ',,', '.', 0, 0, 1, 2 ]] ++ :for [oname, oval1, oval2, oval3, invval, bool, global, local] in lst ++ : py3 oname=vim.eval('oname') ++ : py3 oval1=vim.bindeval('oval1') ++ : py3 oval2=vim.bindeval('oval2') ++ : py3 oval3=vim.bindeval('oval3') ++ : if invval is 0 || invval is 1 ++ : py3 invval=bool(vim.bindeval('invval')) ++ : else ++ : py3 invval=vim.bindeval('invval') ++ : endif ++ : if bool ++ : py3 oval1=bool(oval1) ++ : py3 oval2=bool(oval2) ++ : py3 oval3=bool(oval3) ++ : endif ++ : put ='>>> '.oname ++ : for v in ['gopts1', 'wopts1', 'bopts1'] ++ : try ++ : put =' p/'.v.': '.Ev('repr('.v.'['''.oname.'''])') ++ : catch ++ : put =' p/'.v.'! '.v:exception ++ : endtry ++ : try ++ : call E(v.'["'.oname.'"]=invval') ++ : catch ++ : put =' inv: '.string(invval).'! '.v:exception ++ : endtry ++ : for vv in (v is# 'gopts1' ? [v] : [v, v[:-2].'2', v[:-2].'3']) ++ : let val=substitute(vv, '^.opts', 'oval', '') ++ : try ++ : call E(vv.'["'.oname.'"]='.val) ++ : catch ++ : put =' '.vv.'! '.v:exception ++ : endtry ++ : endfor ++ : endfor ++ : call RecVars(oname) ++ : for v in ['wopts3', 'bopts3'] ++ : try ++ : call E('del '.v.'["'.oname.'"]') ++ : catch ++ : put =' del '.v.'! '.v:exception ++ : endtry ++ : endfor ++ : call RecVars(oname) ++ endtry ++ :endfor ++ :only + :endfun + :" + :call Test() +*** ../vim-7.3.923/src/testdir/test87.ok 2013-04-24 14:06:42.000000000 +0200 +--- src/testdir/test87.ok 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 69,71 **** +--- 69,297 ---- + bac + def + bar ++ >>> paste ++ p/gopts1: False ++ inv: 2! ValueError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1! KeyError ++ inv: 2! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 1 ++ W: 1:1 2:1 3:1 4:1 ++ B: 1:1 2:1 3:1 4:1 ++ del wopts3! KeyError ++ del bopts3! KeyError ++ G: 1 ++ W: 1:1 2:1 3:1 4:1 ++ B: 1:1 2:1 3:1 4:1 ++ >>> previewheight ++ p/gopts1: 12 ++ inv: 'a'! ValueError ++ p/wopts1! KeyError ++ inv: 'a'! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1! KeyError ++ inv: 'a'! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 5 ++ W: 1:5 2:5 3:5 4:5 ++ B: 1:5 2:5 3:5 4:5 ++ del wopts3! KeyError ++ del bopts3! KeyError ++ G: 5 ++ W: 1:5 2:5 3:5 4:5 ++ B: 1:5 2:5 3:5 4:5 ++ >>> operatorfunc ++ p/gopts1: b'' ++ inv: 2! ValueError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1! KeyError ++ inv: 2! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 'A' ++ W: 1:'A' 2:'A' 3:'A' 4:'A' ++ B: 1:'A' 2:'A' 3:'A' 4:'A' ++ del wopts3! KeyError ++ del bopts3! KeyError ++ G: 'A' ++ W: 1:'A' 2:'A' 3:'A' 4:'A' ++ B: 1:'A' 2:'A' 3:'A' 4:'A' ++ >>> number ++ p/gopts1! KeyError ++ inv: 0! KeyError ++ gopts1! KeyError ++ p/wopts1: False ++ p/bopts1! KeyError ++ inv: 0! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ del wopts3! ValueError ++ del bopts3! KeyError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ >>> numberwidth ++ p/gopts1! KeyError ++ inv: -100! KeyError ++ gopts1! KeyError ++ p/wopts1: 8 ++ p/bopts1! KeyError ++ inv: -100! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: 8 ++ W: 1:3 2:5 3:2 4:8 ++ B: 1:3 2:5 3:2 4:8 ++ del wopts3! ValueError ++ del bopts3! KeyError ++ G: 8 ++ W: 1:3 2:5 3:2 4:8 ++ B: 1:3 2:5 3:2 4:8 ++ >>> colorcolumn ++ p/gopts1! KeyError ++ inv: 'abc'! KeyError ++ gopts1! KeyError ++ p/wopts1: b'' ++ p/bopts1! KeyError ++ inv: 'abc'! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: '' ++ W: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ B: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ del wopts3! ValueError ++ del bopts3! KeyError ++ G: '' ++ W: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ B: 1:'+2' 2:'+3' 3:'+1' 4:'' ++ >>> statusline ++ p/gopts1: b'' ++ inv: 0! ValueError ++ p/wopts1: None ++ inv: 0! ValueError ++ p/bopts1! KeyError ++ inv: 0! KeyError ++ bopts1! KeyError ++ bopts2! KeyError ++ bopts3! KeyError ++ G: '1' ++ W: 1:'2' 2:'4' 3:'1' 4:'1' ++ B: 1:'2' 2:'4' 3:'1' 4:'1' ++ del bopts3! KeyError ++ G: '1' ++ W: 1:'2' 2:'1' 3:'1' 4:'1' ++ B: 1:'2' 2:'1' 3:'1' 4:'1' ++ >>> autoindent ++ p/gopts1! KeyError ++ inv: 2! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: False ++ inv: 2! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ >>> iminsert ++ p/gopts1! KeyError ++ inv: 3! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 3! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: 2 ++ G: 1 ++ W: 1:2 2:1 3:0 4:2 ++ B: 1:2 2:1 3:0 4:2 ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: 1 ++ W: 1:2 2:1 3:0 4:2 ++ B: 1:2 2:1 3:0 4:2 ++ >>> omnifunc ++ p/gopts1! KeyError ++ inv: 1! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 1! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: b'' ++ inv: 1! ValueError ++ G: '' ++ W: 1:'B' 2:'C' 3:'A' 4:'' ++ B: 1:'B' 2:'C' 3:'A' 4:'' ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: '' ++ W: 1:'B' 2:'C' 3:'A' 4:'' ++ B: 1:'B' 2:'C' 3:'A' 4:'' ++ >>> preserveindent ++ p/gopts1! KeyError ++ inv: 2! KeyError ++ gopts1! KeyError ++ p/wopts1! KeyError ++ inv: 2! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: False ++ inv: 2! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ del wopts3! KeyError ++ del bopts3! ValueError ++ G: 0 ++ W: 1:1 2:1 3:0 4:0 ++ B: 1:1 2:1 3:0 4:0 ++ >>> path ++ p/gopts1: b'.,/usr/include,,' ++ inv: 0! ValueError ++ p/wopts1! KeyError ++ inv: 0! KeyError ++ wopts1! KeyError ++ wopts2! KeyError ++ wopts3! KeyError ++ p/bopts1: None ++ inv: 0! ValueError ++ G: '.,,' ++ W: 1:',,' 2:'.' 3:'.,,' 4:'.,,' ++ B: 1:',,' 2:'.' 3:'.,,' 4:'.,,' ++ del wopts3! KeyError ++ G: '.,,' ++ W: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' ++ B: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' +*** ../vim-7.3.923/src/vim.h 2013-03-19 16:46:59.000000000 +0100 +--- src/vim.h 2013-05-06 03:36:46.000000000 +0200 +*************** +*** 2230,2233 **** +--- 2230,2246 ---- + #define FILEINFO_READ_FAIL 2 /* CreateFile() failed */ + #define FILEINFO_INFO_FAIL 3 /* GetFileInformationByHandle() failed */ + ++ /* Return value from get_option_value_strict */ ++ #define SOPT_BOOL 0x01 /* Boolean option */ ++ #define SOPT_NUM 0x02 /* Number option */ ++ #define SOPT_STRING 0x04 /* String option */ ++ #define SOPT_GLOBAL 0x08 /* Option has global value */ ++ #define SOPT_WIN 0x10 /* Option has window-local value */ ++ #define SOPT_BUF 0x20 /* Option has buffer-local value */ ++ #define SOPT_UNSET 0x40 /* Option does not have local value set */ ++ ++ #define SREQ_GLOBAL 0 /* Request global option */ ++ #define SREQ_WIN 1 /* Request window-local option */ ++ #define SREQ_BUF 2 /* Request buffer-local option */ ++ + #endif /* VIM__H */ +*** ../vim-7.3.923/src/version.c 2013-05-04 04:40:06.000000000 +0200 +--- src/version.c 2013-05-06 03:38:06.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 924, + /**/ + +-- +ARTHUR: (as the MAN next to him is squashed by a sheep) Knights! Run away! + Midst echoing shouts of "run away" the KNIGHTS retreat to cover with the odd + cow or goose hitting them still. The KNIGHTS crouch down under cover. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.925 b/7.3.925 new file mode 100644 index 0000000..a7a0b5a --- /dev/null +++ b/7.3.925 @@ -0,0 +1,2899 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.925 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.925 +Problem: Typos in source files. +Solution: Fix the typos. (Ken Takata) +Files: runtime/plugin/matchparen.vim, runtime/tools/vim_vs_net.cmd, + src/GvimExt/gvimext.cpp, src/INSTALLvms.txt, src/Make_cyg.mak, + src/Make_mvc.mak, src/Make_sas.mak, src/Make_vms.mms, + src/Make_w16.mak, src/Makefile, src/VisVim/OleAut.cpp, + src/VisVim/README_VisVim.txt, src/auto/configure, src/buffer.c, + src/configure.in, src/diff.c, src/dosinst.c, src/edit.c, + src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c, + src/farsi.c, src/feature.h, src/fileio.c, src/glbl_ime.cpp, + src/gui.c, src/gui_athena.c, src/gui_beval.c, src/gui_gtk_x11.c, + src/gui_mac.c, src/gui_motif.c, src/gui_photon.c, src/gui_w16.c, + src/gui_w32.c, src/gui_w48.c, src/gui_xmebw.c, src/gui_xmebwp.h, + src/hardcopy.c, src/if_cscope.c, src/if_mzsch.c, src/if_ole.cpp, + src/if_perl.xs, src/if_py_both.h, src/if_python.c, + src/if_python3.c, src/if_ruby.c, src/main.aap, src/mbyte.c, + src/memfile.c, src/memline.c, src/misc1.c, src/misc2.c, + src/nbdebug.c, src/normal.c, src/ops.c, src/os_amiga.c, + src/os_mac.h, src/os_msdos.c, src/os_mswin.c, src/os_win16.h, + src/os_win32.c, src/os_win32.h, src/quickfix.c, src/screen.c, + src/search.c, src/spell.c, src/structs.h, src/syntax.c, + src/window.c, vimtutor.com + + +*** ../vim-7.3.924/runtime/plugin/matchparen.vim 2013-03-19 13:33:18.000000000 +0100 +--- runtime/plugin/matchparen.vim 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 5,11 **** + " Exit quickly when: + " - this plugin was already loaded (or disabled) + " - when 'compatible' is set +! " - the "CursorMoved" autocmd event is not availble. + if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved") + finish + endif +--- 5,11 ---- + " Exit quickly when: + " - this plugin was already loaded (or disabled) + " - when 'compatible' is set +! " - the "CursorMoved" autocmd event is not available. + if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved") + finish + endif +*** ../vim-7.3.924/runtime/tools/vim_vs_net.cmd 2010-08-15 21:57:12.000000000 +0200 +--- runtime/tools/vim_vs_net.cmd 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 7,18 **** + @rem Arguments - +$(CurLine) $(ItemPath) + @rem Init Dir - Empty + @rem +! @rem Coutesy of Brian Sturk + @rem + @rem --remote-silent +%1 is a command +954, move ahead 954 lines + @rem --remote-silent %2 full path to file + @rem In Vim +! @rem :h --remote-silent for mor details + @rem + @rem --servername VS_NET + @rem This will create a new instance of vim called VS_NET. So if you +--- 7,18 ---- + @rem Arguments - +$(CurLine) $(ItemPath) + @rem Init Dir - Empty + @rem +! @rem Courtesy of Brian Sturk + @rem + @rem --remote-silent +%1 is a command +954, move ahead 954 lines + @rem --remote-silent %2 full path to file + @rem In Vim +! @rem :h --remote-silent for more details + @rem + @rem --servername VS_NET + @rem This will create a new instance of vim called VS_NET. So if you +*** ../vim-7.3.924/src/GvimExt/gvimext.cpp 2011-08-10 16:31:18.000000000 +0200 +--- src/GvimExt/gvimext.cpp 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 527,533 **** + // + // PARAMETERS: + // pIDFolder - Specifies the parent folder +! // pDataObj - Spefifies the set of items selected in that folder. + // hRegKey - Specifies the type of the focused item in the selection. + // + // RETURN VALUE: +--- 527,533 ---- + // + // PARAMETERS: + // pIDFolder - Specifies the parent folder +! // pDataObj - Specifies the set of items selected in that folder. + // hRegKey - Specifies the type of the focused item in the selection. + // + // RETURN VALUE: +*** ../vim-7.3.924/src/INSTALLvms.txt 2010-08-15 21:57:25.000000000 +0200 +--- src/INSTALLvms.txt 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 330,336 **** + Also VMS_JACKETS.EXE from OpenVMS Porting Library. + + Please note, that GTK uses /name=(as_is,short)/float=ieee/ieee=denorm +! complier directives that is not compatible with "standard" VMS usage, + therefore other external features might fail as PERL, PYTHON and TCL + support. + +--- 330,336 ---- + Also VMS_JACKETS.EXE from OpenVMS Porting Library. + + Please note, that GTK uses /name=(as_is,short)/float=ieee/ieee=denorm +! compiler directives that is not compatible with "standard" VMS usage, + therefore other external features might fail as PERL, PYTHON and TCL + support. + +*** ../vim-7.3.924/src/Make_cyg.mak 2013-03-07 15:16:16.000000000 +0100 +--- src/Make_cyg.mak 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1,6 **** + # + # Makefile for VIM on Win32, using Cygnus gcc +! # Last updated by Dan Sharp. Last Change: 2013 Feb 17 + # + # Also read INSTALLpc.txt! + # +--- 1,6 ---- + # + # Makefile for VIM on Win32, using Cygnus gcc +! # Last updated by Dan Sharp. Last Change: 2013 Apr 22 + # + # Also read INSTALLpc.txt! + # +*************** +*** 48,54 **** + # USEDLL no or yes: set to yes to use the Runtime library DLL (no) + # For USEDLL=yes the cygwin1.dll is required to run Vim. + # For "no" the mingw-gcc-g++ package or the mingw64-i686-gcc-g++ +! # package is required to complie Vim. Or set CC to gcc-3 and add + # -L/lib/w32api to EXTRA_LIBS. + # POSTSCRIPT no or yes: set to yes for PostScript printing (no) + # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG) +--- 48,54 ---- + # USEDLL no or yes: set to yes to use the Runtime library DLL (no) + # For USEDLL=yes the cygwin1.dll is required to run Vim. + # For "no" the mingw-gcc-g++ package or the mingw64-i686-gcc-g++ +! # package is required to compile Vim. Or set CC to gcc-3 and add + # -L/lib/w32api to EXTRA_LIBS. + # POSTSCRIPT no or yes: set to yes for PostScript printing (no) + # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG) +*** ../vim-7.3.924/src/Make_mvc.mak 2013-02-26 14:56:24.000000000 +0100 +--- src/Make_mvc.mak 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 418,424 **** + !endif + !endif + +! # Abort bulding VIM if version of VC is unrecognised. + !ifndef MSVCVER + !message *** ERROR + !message Cannot determine Visual C version being used. If you are using the +--- 418,424 ---- + !endif + !endif + +! # Abort building VIM if version of VC is unrecognised. + !ifndef MSVCVER + !message *** ERROR + !message Cannot determine Visual C version being used. If you are using the +*** ../vim-7.3.924/src/Make_sas.mak 2010-08-15 21:57:27.000000000 +0200 +--- src/Make_sas.mak 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 251,257 **** + + # generate GlobalSymbolTable, which speeds up the compile time. + # +! # A preprocessing stage is used to work arounda bug in the GST generator, in + # that it does not handle nested makefiles properly in this stage. + # Ignore error message for not producing any code (105). + $(GST): scoptions vim.h keymap.h macros.h ascii.h term.h structs.h +--- 251,257 ---- + + # generate GlobalSymbolTable, which speeds up the compile time. + # +! # A preprocessing stage is used to work around a bug in the GST generator, in + # that it does not handle nested makefiles properly in this stage. + # Ignore error message for not producing any code (105). + $(GST): scoptions vim.h keymap.h macros.h ascii.h term.h structs.h +*************** +*** 283,289 **** + .c.pro: + $(CC) $(CFLAGS) GPFILE=proto/$*.pro $(PROPT) $*.c + +! # dependancies + blowfish.o: blowfish.c + proto/blowfish.pro: blowfish.c + buffer.o: buffer.c +--- 283,289 ---- + .c.pro: + $(CC) $(CFLAGS) GPFILE=proto/$*.pro $(PROPT) $*.c + +! # dependencies + blowfish.o: blowfish.c + proto/blowfish.pro: blowfish.c + buffer.o: buffer.c +*** ../vim-7.3.924/src/Make_vms.mms 2010-08-15 21:57:32.000000000 +0200 +--- src/Make_vms.mms 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 34,40 **** + # SMALL - Few features enabled, as basic as possible + # NORMAL - A default selection of features enabled + # BIG - Many features enabled, as rich as possible. (default) +! # HUGE - All possible featues enabled. + # Please select one of these alternatives above. + MODEL = HUGE + +--- 34,40 ---- + # SMALL - Few features enabled, as basic as possible + # NORMAL - A default selection of features enabled + # BIG - Many features enabled, as rich as possible. (default) +! # HUGE - All possible features enabled. + # Please select one of these alternatives above. + MODEL = HUGE + +*************** +*** 55,61 **** + # Comment out if you want the compiler version with :ver command. + # NOTE: This part can make some complications if you're using some + # predefined symbols/flags for your compiler. If does, just leave behind +! # the comment varialbe CCVER. + CCVER = YES + + # Uncomment if want a debug version. Resulting executable is DVIM.EXE +--- 55,61 ---- + # Comment out if you want the compiler version with :ver command. + # NOTE: This part can make some complications if you're using some + # predefined symbols/flags for your compiler. If does, just leave behind +! # the comment variable CCVER. + CCVER = YES + + # Uncomment if want a debug version. Resulting executable is DVIM.EXE +*** ../vim-7.3.924/src/Make_w16.mak 2013-02-26 14:56:24.000000000 +0100 +--- src/Make_w16.mak 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 4,10 **** + # ************************************************************* + # * WARNING! + # * This was originally produced by the IDE, but has since been +! # * modifed to make it work properly. Adjust with care! + # * In particular, leave LinkerLocalOptsAtW16_gvim16dexe alone + # * unless you are a guru. + # ************************************************************* +--- 4,10 ---- + # ************************************************************* + # * WARNING! + # * This was originally produced by the IDE, but has since been +! # * modified to make it work properly. Adjust with care! + # * In particular, leave LinkerLocalOptsAtW16_gvim16dexe alone + # * unless you are a guru. + # ************************************************************* +*** ../vim-7.3.924/src/Makefile 2013-02-26 14:56:24.000000000 +0100 +--- src/Makefile 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 200,206 **** + #Solaris 2.5 (sun4m) cc (SC4.0) +X11R6 +GUI (CDE) 4.6b (E) Andrew Large + #Solaris 2.5 cc +X11 +GUI Athena 4.2 (9) Sonia Heimann + #Solaris 2.5 gcc 2.5.6 +X11 Motif 5.0m (R) Ant. Colombo +! #Solaris 2.6 gcc 2.8.1 ncursus 5.3 (G) Larry W. Virden + #Solaris with -lthread 5.5 (W) K. Nagano + #Solaris gcc (b) Riccardo + #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar +--- 200,206 ---- + #Solaris 2.5 (sun4m) cc (SC4.0) +X11R6 +GUI (CDE) 4.6b (E) Andrew Large + #Solaris 2.5 cc +X11 +GUI Athena 4.2 (9) Sonia Heimann + #Solaris 2.5 gcc 2.5.6 +X11 Motif 5.0m (R) Ant. Colombo +! #Solaris 2.6 gcc 2.8.1 ncurses 5.3 (G) Larry W. Virden + #Solaris with -lthread 5.5 (W) K. Nagano + #Solaris gcc (b) Riccardo + #SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar +*************** +*** 231,238 **** + # (D) Uncomment lines below for QNX + # (E) You might want to use termlib instead of termcap, see below. + # (F) See below for instructions. +! # (G) Using ncursus version 4.2 has reported to cause a crash. Use the +! # Sun cursus library instead. + # (H) See line for EXTRA_LIBS below. + # (I) SINIX-N 5.42 and 5.43 need some EXTRA_LIBS. Also for Reliant-Unix. + # (J) If you get undefined symbols, see below for a solution. +--- 231,238 ---- + # (D) Uncomment lines below for QNX + # (E) You might want to use termlib instead of termcap, see below. + # (F) See below for instructions. +! # (G) Using ncurses version 4.2 has reported to cause a crash. Use the +! # Sun curses library instead. + # (H) See line for EXTRA_LIBS below. + # (I) SINIX-N 5.42 and 5.43 need some EXTRA_LIBS. Also for Reliant-Unix. + # (J) If you get undefined symbols, see below for a solution. +*************** +*** 402,408 **** + # to the command line. If you see strange flags during compilation, check in + # auto/config.mk where they come from. If it's PERL_CFLAGS, try commenting + # the next line. +! # When you get an error for a missing "perl.exp" file, try creating an emtpy + # one: "touch perl.exp". + # This requires at least "small" features, "tiny" doesn't work. + #CONF_OPT_PERL = --enable-perlinterp +--- 402,408 ---- + # to the command line. If you see strange flags during compilation, check in + # auto/config.mk where they come from. If it's PERL_CFLAGS, try commenting + # the next line. +! # When you get an error for a missing "perl.exp" file, try creating an empty + # one: "touch perl.exp". + # This requires at least "small" features, "tiny" doesn't work. + #CONF_OPT_PERL = --enable-perlinterp +*************** +*** 601,607 **** + # Might not work with GUI or Perl. + # For unknown reasons adding "-lc" fixes a linking problem with some versions + # of GCC. That's probably a bug in the "-pg" implementation. +! # After running Vim see the profile result with: gmon vim gmon.out | vim - + # Need to recompile everything after changing this: "make clean" "make". + #PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING + #PROFILE_LIBS = -pg +--- 601,607 ---- + # Might not work with GUI or Perl. + # For unknown reasons adding "-lc" fixes a linking problem with some versions + # of GCC. That's probably a bug in the "-pg" implementation. +! # After running Vim see the profile result with: gprof vim gmon.out | vim - + # Need to recompile everything after changing this: "make clean" "make". + #PROFILE_CFLAGS = -pg -g -DWE_ARE_PROFILING + #PROFILE_LIBS = -pg +*************** +*** 1294,1300 **** + ### prototype headers are ignored due to -DPROTO, system + ### headers #include <...> are ignored if we use the -MM option, as + ### e.g. provided by gcc-cpp. +! ### Include FEAT_GUI to get gependency on gui.h + ### Need to change "-I /" to "-isystem /" for GCC 3.x. + CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \ + `echo "$(DEPEND_CFLAGS)" $(DEPEND_CFLAGS_FILTER)` +--- 1294,1300 ---- + ### prototype headers are ignored due to -DPROTO, system + ### headers #include <...> are ignored if we use the -MM option, as + ### e.g. provided by gcc-cpp. +! ### Include FEAT_GUI to get dependency on gui.h + ### Need to change "-I /" to "-isystem /" for GCC 3.x. + CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \ + `echo "$(DEPEND_CFLAGS)" $(DEPEND_CFLAGS_FILTER)` +*************** +*** 1717,1723 **** + + + # Link the target for normal use or debugging. +! # A shell script is used to try linking without unneccesary libraries. + $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h + $(CCC) version.c -o objects/version.o + @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ +--- 1717,1723 ---- + + + # Link the target for normal use or debugging. +! # A shell script is used to try linking without unnecessary libraries. + $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h + $(CCC) version.c -o objects/version.o + @LINK="$(PURIFY) $(SHRPENV) $(CClink) $(ALL_LIB_DIRS) $(LDFLAGS) \ +*************** +*** 1837,1844 **** + # + # This will produce a lot of garbage on your screen, including a few error + # messages. Don't worry about that. +! # If there is a real error, there will be a difference between "test.out" and +! # a "test99.ok" file. + # If everything is alright, the final message will be "ALL DONE". If not you + # get "TEST FAILURE". + # +--- 1837,1844 ---- + # + # This will produce a lot of garbage on your screen, including a few error + # messages. Don't worry about that. +! # If there is a real error, there will be a difference between "testXX.out" and +! # a "testXX.ok" file. + # If everything is alright, the final message will be "ALL DONE". If not you + # get "TEST FAILURE". + # +*************** +*** 2779,2787 **** + mv gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc + + # po/Make_osx.pl says something about generating a Mac message file +! # for Ukrananian. Would somebody using Mac OS X in Ukranian + # *really* be upset that Carbon Vim was not localised in +! # Ukranian? + # + #bundle-language: bundle-dir po/Make_osx.pl + # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) +--- 2779,2787 ---- + mv gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc + + # po/Make_osx.pl says something about generating a Mac message file +! # for Ukrainian. Would somebody using Mac OS X in Ukrainian + # *really* be upset that Carbon Vim was not localised in +! # Ukrainian? + # + #bundle-language: bundle-dir po/Make_osx.pl + # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) +*** ../vim-7.3.924/src/VisVim/OleAut.cpp 2010-08-15 21:57:27.000000000 +0200 +--- src/VisVim/OleAut.cpp 2013-05-06 04:04:07.000000000 +0200 +*************** +*** 654,660 **** + } + + char Buf[256]; +! sprintf (Buf, "An OLE error occured:\r\nCode = %s\r\nResult = %lx.", + (char*) ErrName, m_hResult); + MessageBox (NULL, Buf, "OLE Error", MB_OK); + } +--- 654,660 ---- + } + + char Buf[256]; +! sprintf (Buf, "An OLE error occurred:\r\nCode = %s\r\nResult = %lx.", + (char*) ErrName, m_hResult); + MessageBox (NULL, Buf, "OLE Error", MB_OK); + } +*** ../vim-7.3.924/src/VisVim/README_VisVim.txt 2010-08-15 21:57:27.000000000 +0200 +--- src/VisVim/README_VisVim.txt 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 17,28 **** + VisVim is based upon VisEmacs by Christopher Payne + (Copyright (C) Christopher Payne 1997). + +! Author: Heiko Erhardt + Based upon: VisEmacs by Christopher Payne + Version: 1.0 + Created: 23 Oct 1997 + Date: 23 Oct 1997 + + VisVim is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) +--- 17,32 ---- + VisVim is based upon VisEmacs by Christopher Payne + (Copyright (C) Christopher Payne 1997). + +! Author: Heiko Erhardt + Based upon: VisEmacs by Christopher Payne + Version: 1.0 + Created: 23 Oct 1997 + Date: 23 Oct 1997 + ++ VisVim was originally GNU GPL licensed, as stated below. On March 21 2012 ++ Heiko Erhardt declared this work to be relicensed under the Vim license, as ++ stated in ../../runtime/doc/uganda.txt (or ":help uganda" in Vim). ++ + VisVim is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) +*************** +*** 216,222 **** + 2. Close Visual Studio. + 3. Delete VisVim.dll or move it somewhere it can't be found. + 4. Run Visual Studio. +! 5. Tools -> Cursomize ->Add-ins and Macro-Files. + 6. A message appears: + ".../VisVim.dll" "This add-in no longer exists. It will + no longer be displayed." +--- 220,226 ---- + 2. Close Visual Studio. + 3. Delete VisVim.dll or move it somewhere it can't be found. + 4. Run Visual Studio. +! 5. Tools -> Customize ->Add-ins and Macro-Files. + 6. A message appears: + ".../VisVim.dll" "This add-in no longer exists. It will + no longer be displayed." +*************** +*** 294,300 **** + P8 Execute :tag command in Vim for word under cursor in DevStudio + + P7 Controlling the Visual Studio Debugger from inside Vim +! See message above. Also a 'Debug' highligh group and a + command to highlight a certain line would be necessary. + + P6 Provide an option to open the current file in VisVim in +--- 298,304 ---- + P8 Execute :tag command in Vim for word under cursor in DevStudio + + P7 Controlling the Visual Studio Debugger from inside Vim +! See message above. Also a 'Debug' highlight group and a + command to highlight a certain line would be necessary. + + P6 Provide an option to open the current file in VisVim in +*************** +*** 318,322 **** + Have fun! + + Heiko Erhardt +! Heiko.Erhardt@munich.netsurf.de + +--- 322,326 ---- + Have fun! + + Heiko Erhardt +! heiko.erhardt@gmx.net + +*** ../vim-7.3.924/src/auto/configure 2013-05-04 04:40:06.000000000 +0200 +--- src/auto/configure 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 5831,5837 **** + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first pyhton version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, char *prefix) +--- 5831,5837 ---- + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first python version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, char *prefix) +*************** +*** 5897,5903 **** + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first pyhton version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) +--- 5897,5903 ---- + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first python version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) +*************** +*** 10593,10599 **** + _ACEOF + + if test "x$vim_cv_tty_mode" = "x" ; then +! as_fn_error "It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (propably 0620)" "$LINENO" 5 + else + $as_echo "#define PTYMODE 0620" >>confdefs.h + +--- 10593,10599 ---- + _ACEOF + + if test "x$vim_cv_tty_mode" = "x" ; then +! as_fn_error "It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)" "$LINENO" 5 + else + $as_echo "#define PTYMODE 0620" >>confdefs.h + +*** ../vim-7.3.924/src/buffer.c 2013-04-24 16:52:28.000000000 +0200 +--- src/buffer.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 2005,2011 **** + * "buf" if one exists */ + if (swb_flags & SWB_USEOPEN) + wp = buf_jump_open_win(buf); +! /* If 'switchbuf' contians "usetab": jump to first window in any tab + * page containing "buf" if one exists */ + if (wp == NULL && (swb_flags & SWB_USETAB)) + wp = buf_jump_open_tab(buf); +--- 2005,2011 ---- + * "buf" if one exists */ + if (swb_flags & SWB_USEOPEN) + wp = buf_jump_open_win(buf); +! /* If 'switchbuf' contains "usetab": jump to first window in any tab + * page containing "buf" if one exists */ + if (wp == NULL && (swb_flags & SWB_USETAB)) + wp = buf_jump_open_tab(buf); +*** ../vim-7.3.924/src/configure.in 2013-05-04 04:40:06.000000000 +0200 +--- src/configure.in 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 306,312 **** + AC_SUBST(line_break) + + if test "$cf_cv_ebcdic" = "yes"; then +! dnl If we have EBCDIC we most likley have z/OS Unix, let's test it! + AC_MSG_CHECKING(for z/OS Unix) + case `uname` in + OS/390) zOSUnix="yes"; +--- 306,312 ---- + AC_SUBST(line_break) + + if test "$cf_cv_ebcdic" = "yes"; then +! dnl If we have EBCDIC we most likely have z/OS Unix, let's test it! + AC_MSG_CHECKING(for z/OS Unix) + case `uname` in + OS/390) zOSUnix="yes"; +*************** +*** 1228,1234 **** + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first pyhton version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, char *prefix) +--- 1228,1234 ---- + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first python version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, char *prefix) +*************** +*** 1274,1280 **** + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first pyhton version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) +--- 1274,1280 ---- + /* If this program fails, then RTLD_GLOBAL is needed. + * RTLD_GLOBAL will be used and then it is not possible to + * have both python versions enabled in the same vim instance. +! * Only the first python version used will be switched on. + */ + + int no_rtl_global_needed_for(char *python_instsoname, wchar_t *prefix) +*************** +*** 3002,3008 **** + if test "x$vim_cv_tty_group" != "xworld" ; then + AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) + if test "x$vim_cv_tty_mode" = "x" ; then +! AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (propably 0620)]) + else + AC_DEFINE(PTYMODE, 0620) + fi +--- 3002,3008 ---- + if test "x$vim_cv_tty_group" != "xworld" ; then + AC_DEFINE_UNQUOTED(PTYGROUP,$vim_cv_tty_group) + if test "x$vim_cv_tty_mode" = "x" ; then +! AC_MSG_ERROR([It seems you're cross compiling and have 'vim_cv_tty_group' set, please also set the environment variable 'vim_cv_tty_mode' to the correct mode (probably 0620)]) + else + AC_DEFINE(PTYMODE, 0620) + fi +*** ../vim-7.3.924/src/diff.c 2013-03-19 14:25:50.000000000 +0100 +--- src/diff.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1110,1116 **** + } + + /* +! * Set options to show difs for the current window. + */ + void + ex_diffthis(eap) +--- 1110,1116 ---- + } + + /* +! * Set options to show diffs for the current window. + */ + void + ex_diffthis(eap) +*** ../vim-7.3.924/src/dosinst.c 2013-02-13 14:36:39.000000000 +0100 +--- src/dosinst.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1609,1615 **** + + /* + * Only add the choice for the open-with menu entry when gvim.exe was found +! * and and regedit.exe exist. + */ + static void + init_openwith_choice(void) +--- 1609,1615 ---- + + /* + * Only add the choice for the open-with menu entry when gvim.exe was found +! * and regedit.exe exist. + */ + static void + init_openwith_choice(void) +*** ../vim-7.3.924/src/edit.c 2013-03-19 16:46:59.000000000 +0100 +--- src/edit.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1418,1424 **** + + normalchar: + /* +! * Insert a nomal character. + */ + #ifdef FEAT_AUTOCMD + if (!p_paste) +--- 1418,1424 ---- + + normalchar: + /* +! * Insert a normal character. + */ + #ifdef FEAT_AUTOCMD + if (!p_paste) +*************** +*** 7162,7168 **** + /* + * Count each sequence of folded lines as one logical line. + */ +! /* go to the the start of the current fold */ + (void)hasFolding(lnum, &lnum, NULL); + + while (n--) +--- 7162,7168 ---- + /* + * Count each sequence of folded lines as one logical line. + */ +! /* go to the start of the current fold */ + (void)hasFolding(lnum, &lnum, NULL); + + while (n--) +*************** +*** 7213,7219 **** + (void)hasFolding(lnum, NULL, &lnum); + #endif + /* This fails if the cursor is already in the last line or would move +! * beyound the last line and '-' is in 'cpoptions' */ + if (lnum >= curbuf->b_ml.ml_line_count + || (lnum + n > curbuf->b_ml.ml_line_count + && vim_strchr(p_cpo, CPO_MINUS) != NULL)) +--- 7213,7219 ---- + (void)hasFolding(lnum, NULL, &lnum); + #endif + /* This fails if the cursor is already in the last line or would move +! * beyond the last line and '-' is in 'cpoptions' */ + if (lnum >= curbuf->b_ml.ml_line_count + || (lnum + n > curbuf->b_ml.ml_line_count + && vim_strchr(p_cpo, CPO_MINUS) != NULL)) +*************** +*** 7715,7721 **** + /* + * return TRUE if 'cinkeys' contains the key "keytyped", + * when == '*': Only if key is preceded with '*' (indent before insert) +! * when == '!': Only if key is prededed with '!' (don't insert) + * when == ' ': Only if key is not preceded with '*'(indent afterwards) + * + * "keytyped" can have a few special values: +--- 7715,7721 ---- + /* + * return TRUE if 'cinkeys' contains the key "keytyped", + * when == '*': Only if key is preceded with '*' (indent before insert) +! * when == '!': Only if key is preceded with '!' (don't insert) + * when == ' ': Only if key is not preceded with '*'(indent afterwards) + * + * "keytyped" can have a few special values: +*************** +*** 8541,8547 **** + #endif + + /* +! * key in Insert mode: toggle insert/remplace mode. + */ + static void + ins_insert(replaceState) +--- 8541,8547 ---- + #endif + + /* +! * key in Insert mode: toggle insert/replace mode. + */ + static void + ins_insert(replaceState) +*** ../vim-7.3.924/src/eval.c 2013-05-06 03:52:44.000000000 +0200 +--- src/eval.c 2013-05-06 04:07:45.000000000 +0200 +*************** +*** 16669,16675 **** + tabpage_T *save_curtab; + { + #ifdef FEAT_WINDOWS +! /* Restore current tabpage and window, if still valid (autocomands can + * make them invalid). */ + if (valid_tabpage(save_curtab)) + goto_tabpage_tp(save_curtab, TRUE); +--- 16669,16675 ---- + tabpage_T *save_curtab; + { + #ifdef FEAT_WINDOWS +! /* Restore current tabpage and window, if still valid (autocommands can + * make them invalid). */ + if (valid_tabpage(save_curtab)) + goto_tabpage_tp(save_curtab, TRUE); +*** ../vim-7.3.924/src/ex_cmds2.c 2013-03-19 16:46:59.000000000 +0100 +--- src/ex_cmds2.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 2851,2857 **** + EMSG(_(e_argreq)); + + else if (eap != NULL && eap->forceit) +! /* ":source!": read Normal mdoe commands + * Need to execute the commands directly. This is required at least + * for: + * - ":g" command busy +--- 2851,2857 ---- + EMSG(_(e_argreq)); + + else if (eap != NULL && eap->forceit) +! /* ":source!": read Normal mode commands + * Need to execute the commands directly. This is required at least + * for: + * - ":g" command busy +*** ../vim-7.3.924/src/ex_docmd.c 2013-03-19 14:25:50.000000000 +0100 +--- src/ex_docmd.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1093,1099 **** + msg_didany = FALSE; /* no output yet */ + msg_start(); + msg_scroll = TRUE; /* put messages below each other */ +! ++no_wait_return; /* dont wait for return until finished */ + ++RedrawingDisabled; + did_inc = TRUE; + } +--- 1093,1099 ---- + msg_didany = FALSE; /* no output yet */ + msg_start(); + msg_scroll = TRUE; /* put messages below each other */ +! ++no_wait_return; /* don't wait for return until finished */ + ++RedrawingDisabled; + did_inc = TRUE; + } +*************** +*** 1298,1304 **** + && !(did_emsg + #ifdef FEAT_EVAL + /* Keep going when inside try/catch, so that the error can be +! * dealth with, except when it is a syntax error, it may cause + * the :endtry to be missed. */ + && (cstack.cs_trylevel == 0 || did_emsg_syntax) + #endif +--- 1298,1304 ---- + && !(did_emsg + #ifdef FEAT_EVAL + /* Keep going when inside try/catch, so that the error can be +! * deal with, except when it is a syntax error, it may cause + * the :endtry to be missed. */ + && (cstack.cs_trylevel == 0 || did_emsg_syntax) + #endif +*************** +*** 10982,10988 **** + *p = '/'; + } + +! /* escapse special characters */ + p = vim_strsave_fnameescape(sname, FALSE); + vim_free(sname); + if (p == NULL) +--- 10982,10988 ---- + *p = '/'; + } + +! /* escape special characters */ + p = vim_strsave_fnameescape(sname, FALSE); + vim_free(sname); + if (p == NULL) +*** ../vim-7.3.924/src/ex_eval.c 2010-08-15 21:57:25.000000000 +0200 +--- src/ex_eval.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 44,50 **** + * executed. Otherwise, errors and/or interrupts are converted into catchable + * exceptions (did_throw additionally set), which terminate the script only if + * not caught. For user exceptions, only did_throw is set. (Note: got_int can +! * be set asyncronously afterwards by a SIGINT, so did_throw && got_int is not + * a reliant test that the exception currently being thrown is an interrupt + * exception. Similarly, did_emsg can be set afterwards on an error in an + * (unskipped) conditional command inside an inactive conditional, so did_throw +--- 44,50 ---- + * executed. Otherwise, errors and/or interrupts are converted into catchable + * exceptions (did_throw additionally set), which terminate the script only if + * not caught. For user exceptions, only did_throw is set. (Note: got_int can +! * be set asynchronously afterwards by a SIGINT, so did_throw && got_int is not + * a reliant test that the exception currently being thrown is an interrupt + * exception. Similarly, did_emsg can be set afterwards on an error in an + * (unskipped) conditional command inside an inactive conditional, so did_throw +*************** +*** 2091,2101 **** + * Values used for "searched_cond" are (CSF_WHILE | CSF_FOR) or CSF_TRY or 0, + * the latter meaning the innermost try conditional not in its finally clause. + * "inclusive" tells whether the conditional searched for should be made +! * inactive itself (a try conditional not in its finally claused possibly find + * before is always made inactive). If "inclusive" is TRUE and + * "searched_cond" is CSF_TRY|CSF_SILENT, the saved former value of + * "emsg_silent", if reset when the try conditional finally reached was +! * entered, is restored (unsed by ex_endtry()). This is normally done only + * when such a try conditional is left. + */ + int +--- 2091,2101 ---- + * Values used for "searched_cond" are (CSF_WHILE | CSF_FOR) or CSF_TRY or 0, + * the latter meaning the innermost try conditional not in its finally clause. + * "inclusive" tells whether the conditional searched for should be made +! * inactive itself (a try conditional not in its finally clause possibly find + * before is always made inactive). If "inclusive" is TRUE and + * "searched_cond" is CSF_TRY|CSF_SILENT, the saved former value of + * "emsg_silent", if reset when the try conditional finally reached was +! * entered, is restored (used by ex_endtry()). This is normally done only + * when such a try conditional is left. + */ + int +*** ../vim-7.3.924/src/farsi.c 2012-07-16 17:26:18.000000000 +0200 +--- src/farsi.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1841,1847 **** + } + + /* +! * Convert the Farsi VIM into Farsi 3342 standad. + */ + void + conv_to_pstd() +--- 1841,1847 ---- + } + + /* +! * Convert the Farsi VIM into Farsi 3342 standard. + */ + void + conv_to_pstd() +*** ../vim-7.3.924/src/feature.h 2013-04-15 15:40:08.000000000 +0200 +--- src/feature.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1007,1013 **** + + /* + * MODIFIED_BY Name of who modified Vim. Required when distributing +! * a modifed version of Vim. + * Also from the "--with-modified-by" configure argument. + */ + /* #define MODIFIED_BY "John Doe" */ +--- 1007,1013 ---- + + /* + * MODIFIED_BY Name of who modified Vim. Required when distributing +! * a modified version of Vim. + * Also from the "--with-modified-by" configure argument. + */ + /* #define MODIFIED_BY "John Doe" */ +*** ../vim-7.3.924/src/fileio.c 2013-04-24 16:33:58.000000000 +0200 +--- src/fileio.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 3279,3285 **** + overwriting = FALSE; + + if (exiting) +! settmode(TMODE_COOK); /* when exiting allow typahead now */ + + ++no_wait_return; /* don't wait for return yet */ + +--- 3279,3285 ---- + overwriting = FALSE; + + if (exiting) +! settmode(TMODE_COOK); /* when exiting allow typeahead now */ + + ++no_wait_return; /* don't wait for return yet */ + +*************** +*** 3303,3309 **** + int empty_memline = (buf->b_ml.ml_mfp == NULL); + + /* +! * Apply PRE aucocommands. + * Set curbuf to the buffer to be written. + * Careful: The autocommands may call buf_write() recursively! + */ +--- 3303,3309 ---- + int empty_memline = (buf->b_ml.ml_mfp == NULL); + + /* +! * Apply PRE autocommands. + * Set curbuf to the buffer to be written. + * Careful: The autocommands may call buf_write() recursively! + */ +*************** +*** 8866,8872 **** + else + { + /* There is no window for "buf", use "aucmd_win". To minimize the side +! * effects, insert it in a the current tab page. + * Anything related to a window (e.g., setting folds) may have + * unexpected results. */ + aco->use_aucmd_win = TRUE; +--- 8866,8872 ---- + else + { + /* There is no window for "buf", use "aucmd_win". To minimize the side +! * effects, insert it in the current tab page. + * Anything related to a window (e.g., setting folds) may have + * unexpected results. */ + aco->use_aucmd_win = TRUE; +*** ../vim-7.3.924/src/glbl_ime.cpp 2010-08-15 21:57:27.000000000 +0200 +--- src/glbl_ime.cpp 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 156,162 **** + } + + /* +! * Set position of IME compotision window. + * + * You have to call this before starting composition. If once composition + * started, this can take no effect until that composition have finished. So +--- 156,162 ---- + } + + /* +! * Set position of IME composition window. + * + * You have to call this before starting composition. If once composition + * started, this can take no effect until that composition have finished. So +*** ../vim-7.3.924/src/gui.c 2013-04-03 21:11:33.000000000 +0200 +--- src/gui.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 826,832 **** + #endif + + /* +! * Set the font. "font_list" is a a comma separated list of font names. The + * first font name that works is used. If none is found, use the default + * font. + * If "fontset" is TRUE, the "font_list" is used as one name for the fontset. +--- 826,832 ---- + #endif + + /* +! * Set the font. "font_list" is a comma separated list of font names. The + * first font name that works is used. If none is found, use the default + * font. + * If "fontset" is TRUE, the "font_list" is used as one name for the fontset. +*************** +*** 2376,2382 **** + { + int start; /* index of bytes to be drawn */ + int cells; /* cellwidth of bytes to be drawn */ +! int thislen; /* length of bytes to be drawin */ + int cn; /* cellwidth of current char */ + int i; /* index of current char */ + int c; /* current char value */ +--- 2376,2382 ---- + { + int start; /* index of bytes to be drawn */ + int cells; /* cellwidth of bytes to be drawn */ +! int thislen; /* length of bytes to be drawn */ + int cn; /* cellwidth of current char */ + int i; /* index of current char */ + int c; /* current char value */ +*************** +*** 3886,3892 **** + gui.dragged_sb = SBAR_NONE; + #ifdef FEAT_GUI_GTK + /* Keep the "dragged_wp" value until after the scrolling, for when the +! * moust button is released. GTK2 doesn't send the button-up event. */ + gui.dragged_wp = NULL; + #endif + } +--- 3886,3892 ---- + gui.dragged_sb = SBAR_NONE; + #ifdef FEAT_GUI_GTK + /* Keep the "dragged_wp" value until after the scrolling, for when the +! * mouse button is released. GTK2 doesn't send the button-up event. */ + gui.dragged_wp = NULL; + #endif + } +*** ../vim-7.3.924/src/gui_athena.c 2011-01-17 20:08:03.000000000 +0100 +--- src/gui_athena.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 519,525 **** + &color[TOP_SHADOW].pixel, + &color[HIGHLIGHT].pixel); + +! /* Setup the color subsititution table */ + attrs.valuemask = XpmColorSymbols; + attrs.colorsymbols = color; + attrs.numsymbols = 5; +--- 519,525 ---- + &color[TOP_SHADOW].pixel, + &color[HIGHLIGHT].pixel); + +! /* Setup the color substitution table */ + attrs.valuemask = XpmColorSymbols; + attrs.colorsymbols = color; + attrs.numsymbols = 5; +*** ../vim-7.3.924/src/gui_beval.c 2012-10-21 00:58:34.000000000 +0200 +--- src/gui_beval.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 726,732 **** + BalloonEval *beval; + XEvent *event; + { +! Position distance; /* a measure of how much the ponter moved */ + Position delta; /* used to compute distance */ + + switch (event->type) +--- 726,732 ---- + BalloonEval *beval; + XEvent *event; + { +! Position distance; /* a measure of how much the pointer moved */ + Position delta; /* used to compute distance */ + + switch (event->type) +*** ../vim-7.3.924/src/gui_gtk_x11.c 2013-03-13 17:50:20.000000000 +0100 +--- src/gui_gtk_x11.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1257,1263 **** + } + } + +! /* Chop off any traiing NUL bytes. OpenOffice sends these. */ + while (len > 0 && text[len - 1] == NUL) + --len; + +--- 1257,1263 ---- + } + } + +! /* Chop off any trailing NUL bytes. OpenOffice sends these. */ + while (len > 0 && text[len - 1] == NUL) + --len; + +*** ../vim-7.3.924/src/gui_mac.c 2012-11-20 17:18:56.000000000 +0100 +--- src/gui_mac.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 41,47 **** + #define USE_AEVENT /* Enable AEVENT */ + #undef USE_OFFSETED_WINDOW /* Debugging feature: start Vim window OFFSETed */ + +! /* Compile as CodeWarior External Editor */ + #if defined(FEAT_CW_EDITOR) && !defined(USE_AEVENT) + # define USE_AEVENT /* Need Apple Event Support */ + #endif +--- 41,47 ---- + #define USE_AEVENT /* Enable AEVENT */ + #undef USE_OFFSETED_WINDOW /* Debugging feature: start Vim window OFFSETed */ + +! /* Compile as CodeWarrior External Editor */ + #if defined(FEAT_CW_EDITOR) && !defined(USE_AEVENT) + # define USE_AEVENT /* Need Apple Event Support */ + #endif +*************** +*** 1478,1484 **** + /* + * gui_mac_get_menu_item_index + * +! * Returns the index inside the menu wher + */ + short /* Should we return MenuItemIndex? */ + gui_mac_get_menu_item_index(vimmenu_T *pMenu) +--- 1478,1484 ---- + /* + * gui_mac_get_menu_item_index + * +! * Returns the index inside the menu where + */ + short /* Should we return MenuItemIndex? */ + gui_mac_get_menu_item_index(vimmenu_T *pMenu) +*************** +*** 1693,1699 **** + + if (theControl != NUL) + { +! /* We hit a scollbar */ + + if (thePortion != kControlIndicatorPart) + { +--- 1693,1699 ---- + + if (theControl != NUL) + { +! /* We hit a scrollbar */ + + if (thePortion != kControlIndicatorPart) + { +*************** +*** 2630,2636 **** + { + /* Handle the menu CntxMenuID, CntxMenuItem */ + /* The submenu can be handle directly by gui_mac_handle_menu */ +! /* But what about the current menu, is the meny changed by ContextualMenuSelect */ + gui_mac_handle_menu((CntxMenuID << 16) + CntxMenuItem); + } + else if (CntxMenuID == kCMShowHelpSelected) +--- 2630,2636 ---- + { + /* Handle the menu CntxMenuID, CntxMenuItem */ + /* The submenu can be handle directly by gui_mac_handle_menu */ +! /* But what about the current menu, is the many changed by ContextualMenuSelect */ + gui_mac_handle_menu((CntxMenuID << 16) + CntxMenuItem); + } + else if (CntxMenuID == kCMShowHelpSelected) +*************** +*** 5356,5362 **** + char_u *initdir, + char_u *filter) + { +! /* TODO: Add Ammon's safety checl (Dany) */ + NavReplyRecord reply; + char_u *fname = NULL; + char_u **fnames = NULL; +--- 5356,5362 ---- + char_u *initdir, + char_u *filter) + { +! /* TODO: Add Ammon's safety check (Dany) */ + NavReplyRecord reply; + char_u *fname = NULL; + char_u **fnames = NULL; +*************** +*** 5704,5710 **** + + /* Resize the button to fit its name */ + width = StringWidth(name) + 2 * dfltButtonEdge; +! /* Limite the size of any button to an acceptable value. */ + /* TODO: Should be based on the message width */ + if (width > maxButtonWidth) + width = maxButtonWidth; +--- 5704,5710 ---- + + /* Resize the button to fit its name */ + width = StringWidth(name) + 2 * dfltButtonEdge; +! /* Limit the size of any button to an acceptable value. */ + /* TODO: Should be based on the message width */ + if (width > maxButtonWidth) + width = maxButtonWidth; +*************** +*** 5887,5893 **** + /* Free the modal filterProc */ + DisposeRoutineDescriptor(dialogUPP); + +! /* Get ride of th edialog (free memory) */ + DisposeDialog(theDialog); + + return itemHit; +--- 5887,5893 ---- + /* Free the modal filterProc */ + DisposeRoutineDescriptor(dialogUPP); + +! /* Get ride of the dialog (free memory) */ + DisposeDialog(theDialog); + + return itemHit; +*************** +*** 5967,5975 **** + /* New way */ + + /* +! * Get first devoice with one button. +! * This will probably be the standad mouse +! * startat head of cursor dev list + * + */ + +--- 5967,5975 ---- + /* New way */ + + /* +! * Get first device with one button. +! * This will probably be the standard mouse +! * start at head of cursor dev list + * + */ + +*************** +*** 6151,6157 **** + } + + /* +! * Convert a FSSpec to a fuill path + */ + + char_u *FullPathFromFSSpec_save(FSSpec file) +--- 6151,6157 ---- + } + + /* +! * Convert a FSSpec to a full path + */ + + char_u *FullPathFromFSSpec_save(FSSpec file) +*************** +*** 6215,6222 **** + + #ifdef USE_UNIXFILENAME + /* +! * The function used here are available in Carbon, but +! * do nothing une MacOS 8 and 9 + */ + if (error == fnfErr) + { +--- 6215,6222 ---- + + #ifdef USE_UNIXFILENAME + /* +! * The functions used here are available in Carbon, but do nothing on +! * MacOS 8 and 9. + */ + if (error == fnfErr) + { +*************** +*** 6544,6550 **** + + // when the tabline is hidden, vim doesn't call update_tabline(). When + // the tabline is shown again, show_tabline() is called before update_tabline(), +! // and because of this, the tab labels and vims internal tabs are out of sync + // for a very short time. to prevent inconsistent state, we store the labels + // of the tabs, not pointers to the tabs (which are invalid for a short time). + static CFStringRef *tabLabels = NULL; +--- 6544,6550 ---- + + // when the tabline is hidden, vim doesn't call update_tabline(). When + // the tabline is shown again, show_tabline() is called before update_tabline(), +! // and because of this, the tab labels and vim's internal tabs are out of sync + // for a very short time. to prevent inconsistent state, we store the labels + // of the tabs, not pointers to the tabs (which are invalid for a short time). + static CFStringRef *tabLabels = NULL; +*************** +*** 6578,6584 **** + + // assert(property == kTabsColumn); // why is this violated?? + +! // changeValue is true if we have a modifieable list and data was changed. + // In our case, it's always false. + // (that is: if (changeValue) updateInternalData(); else return + // internalData(); +--- 6578,6584 ---- + + // assert(property == kTabsColumn); // why is this violated?? + +! // changeValue is true if we have a modifiable list and data was changed. + // In our case, it's always false. + // (that is: if (changeValue) updateInternalData(); else return + // internalData(); +*** ../vim-7.3.924/src/gui_motif.c 2011-01-17 20:08:03.000000000 +0100 +--- src/gui_motif.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1344,1350 **** + else + { + /* Without shadows one can't sense whatever the button has been +! * pressed or not! However we wan't to save a bit of space... + * Need the highlightThickness to see the focus. + */ + XtSetArg(args[n], XmNhighlightThickness, 1); n++; +--- 1344,1350 ---- + else + { + /* Without shadows one can't sense whatever the button has been +! * pressed or not! However we want to save a bit of space... + * Need the highlightThickness to see the focus. + */ + XtSetArg(args[n], XmNhighlightThickness, 1); n++; +*************** +*** 3205,3211 **** + # ifdef FEAT_FOOTER + /* + * The next toolbar enter/leave callbacks should really do balloon help. But +! * I have to use footer help for backwards compatability. Hopefully both will + * get implemented and the user will have a choice. + */ + static void +--- 3205,3211 ---- + # ifdef FEAT_FOOTER + /* + * The next toolbar enter/leave callbacks should really do balloon help. But +! * I have to use footer help for backwards compatibility. Hopefully both will + * get implemented and the user will have a choice. + */ + static void +*** ../vim-7.3.924/src/gui_photon.c 2012-11-20 16:53:34.000000000 +0100 +--- src/gui_photon.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 61,67 **** + static PhPoint_t gui_ph_raw_offset; + static PtWidget_t *gui_ph_timer_cursor; /* handle cursor blinking */ + static PtWidget_t *gui_ph_timer_timeout; /* used in gui_mch_wait_for_chars */ +! static short is_timeout; /* Has the timeout occured? */ + + /* + * This is set inside the mouse callback for a right mouse +--- 61,67 ---- + static PhPoint_t gui_ph_raw_offset; + static PtWidget_t *gui_ph_timer_cursor; /* handle cursor blinking */ + static PtWidget_t *gui_ph_timer_timeout; /* used in gui_mch_wait_for_chars */ +! static short is_timeout; /* Has the timeout occurred? */ + + /* + * This is set inside the mouse callback for a right mouse +*************** +*** 1156,1162 **** + PtSetArg(&args[ n++ ], Pt_ARG_POS, &pos, 0); + + #ifdef USE_PANEL_GROUP +! /* Put in a temprary place holder title */ + PtSetArg(&args[ n++ ], Pt_ARG_PG_PANEL_TITLES, &empty_title, 1); + + gui.vimPanelGroup = PtCreateWidget(PtPanelGroup, gui.vimWindow, n, args); +--- 1156,1162 ---- + PtSetArg(&args[ n++ ], Pt_ARG_POS, &pos, 0); + + #ifdef USE_PANEL_GROUP +! /* Put in a temporary place holder title */ + PtSetArg(&args[ n++ ], Pt_ARG_PG_PANEL_TITLES, &empty_title, 1); + + gui.vimPanelGroup = PtCreateWidget(PtPanelGroup, gui.vimWindow, n, args); +*************** +*** 1527,1533 **** + /* There is one less separator than buttons, so bump up the button count */ + button_count = 1; + +! /* Count string length and number of seperators */ + for (str = buttons; *str; str++) + { + len++; +--- 1527,1533 ---- + /* There is one less separator than buttons, so bump up the button count */ + button_count = 1; + +! /* Count string length and number of separators */ + for (str = buttons; *str; str++) + { + len++; +*** ../vim-7.3.924/src/gui_w16.c 2012-11-20 16:53:34.000000000 +0100 +--- src/gui_w16.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 511,517 **** + workarea_rect.right = GetSystemMetrics(SM_CXSCREEN); + workarea_rect.bottom = GetSystemMetrics(SM_CYFULLSCREEN); + +! /* get current posision of our window */ + wndpl.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(s_hwnd, &wndpl); + if (wndpl.showCmd == SW_SHOWNORMAL) +--- 511,517 ---- + workarea_rect.right = GetSystemMetrics(SM_CXSCREEN); + workarea_rect.bottom = GetSystemMetrics(SM_CYFULLSCREEN); + +! /* get current position of our window */ + wndpl.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(s_hwnd, &wndpl); + if (wndpl.showCmd == SW_SHOWNORMAL) +*************** +*** 1161,1167 **** + return -1; + + /* +! * make a copy of 'buttons' to fiddle with it. complier grizzles because + * vim_strsave() doesn't take a const arg (why not?), so cast away the + * const. + */ +--- 1161,1167 ---- + return -1; + + /* +! * make a copy of 'buttons' to fiddle with it. compiler grizzles because + * vim_strsave() doesn't take a const arg (why not?), so cast away the + * const. + */ +*** ../vim-7.3.924/src/gui_w32.c 2013-03-19 14:48:25.000000000 +0100 +--- src/gui_w32.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1258,1264 **** + + #ifdef FEAT_NETBEANS_INTG + { +! /* stolen from gui_x11.x */ + int arg; + + for (arg = 1; arg < *argc; arg++) +--- 1258,1264 ---- + + #ifdef FEAT_NETBEANS_INTG + { +! /* stolen from gui_x11.c */ + int arg; + + for (arg = 1; arg < *argc; arg++) +*************** +*** 1676,1682 **** + * used by the taskbar or appbars. */ + get_work_area(&workarea_rect); + +! /* Get current posision of our window. Note that the .left and .top are + * relative to the work area. */ + wndpl.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(s_hwnd, &wndpl); +--- 1676,1682 ---- + * used by the taskbar or appbars. */ + get_work_area(&workarea_rect); + +! /* Get current position of our window. Note that the .left and .top are + * relative to the work area. */ + wndpl.length = sizeof(WINDOWPLACEMENT); + GetWindowPlacement(s_hwnd, &wndpl); +*************** +*** 3100,3106 **** + return -1; + + /* +! * make a copy of 'buttons' to fiddle with it. complier grizzles because + * vim_strsave() doesn't take a const arg (why not?), so cast away the + * const. + */ +--- 3100,3106 ---- + return -1; + + /* +! * make a copy of 'buttons' to fiddle with it. compiler grizzles because + * vim_strsave() doesn't take a const arg (why not?), so cast away the + * const. + */ +*************** +*** 4391,4397 **** + } + + sign.hImage = NULL; +! ext = signfile + STRLEN(signfile) - 4; /* get extention */ + if (ext > signfile) + { + int do_load = 1; +--- 4391,4397 ---- + } + + sign.hImage = NULL; +! ext = signfile + STRLEN(signfile) - 4; /* get extension */ + if (ext > signfile) + { + int do_load = 1; +*** ../vim-7.3.924/src/gui_w48.c 2013-03-19 14:48:25.000000000 +0100 +--- src/gui_w48.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1222,1228 **** + + /* When side scroll bar is unshown, the size of window will change. + * then, the text area move left or right. thus client rect should be +! * forcely redraw. (Yasuhiro Matsumoto) */ + if (oldx != x || oldy != y) + { + InvalidateRect(s_hwnd, NULL, FALSE); +--- 1222,1228 ---- + + /* When side scroll bar is unshown, the size of window will change. + * then, the text area move left or right. thus client rect should be +! * forcedly redrawn. (Yasuhiro Matsumoto) */ + if (oldx != x || oldy != y) + { + InvalidateRect(s_hwnd, NULL, FALSE); +*** ../vim-7.3.924/src/gui_xmebw.c 2012-06-29 13:19:23.000000000 +0200 +--- src/gui_xmebw.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 345,351 **** + &eb->primitive.top_shadow_color, + &eb->primitive.highlight_color); + +! /* Setup color subsititution table. */ + color[0].pixel = eb->core.background_pixel; + color[1].pixel = eb->core.background_pixel; + color[2].pixel = eb->core.background_pixel; +--- 345,351 ---- + &eb->primitive.top_shadow_color, + &eb->primitive.highlight_color); + +! /* Setup color substitution table. */ + color[0].pixel = eb->core.background_pixel; + color[1].pixel = eb->core.background_pixel; + color[2].pixel = eb->core.background_pixel; +*************** +*** 919,926 **** + } + + /* +! * Plase note that we manipulate the width only in case of push buttons not +! * used in the context of a menu pane. + */ + if (Lab_IsMenupane(newtb)) + { +--- 919,926 ---- + } + + /* +! * Please note that we manipulate the width only in case of push buttons +! * not used in the context of a menu pane. + */ + if (Lab_IsMenupane(newtb)) + { +*************** +*** 1006,1012 **** + XmString str; + set_pixmap(eb); + +! /* FIXME: this is not the perfect way to deal with menues, which do not + * have any string set right now. */ + str = XmStringCreateLocalized(""); + XtVaSetValues((Widget) eb, XmNlabelString, str, NULL); +--- 1006,1012 ---- + XmString str; + set_pixmap(eb); + +! /* FIXME: this is not the perfect way to deal with menus, which do not + * have any string set right now. */ + str = XmStringCreateLocalized(""); + XtVaSetValues((Widget) eb, XmNlabelString, str, NULL); +*** ../vim-7.3.924/src/gui_xmebwp.h 2010-08-15 21:57:27.000000000 +0200 +--- src/gui_xmebwp.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 26,32 **** + + + /* +! * EnahncedButton class structure. + */ + typedef struct _XmEnhancedButtonClassPart + { +--- 26,32 ---- + + + /* +! * EnhancedButton class structure. + */ + typedef struct _XmEnhancedButtonClassPart + { +*************** +*** 49,55 **** + extern XmEnhancedButtonClassRec xmEnhancedButtonClassRec; + + /* +! * EnahncedButton instance record. + */ + typedef struct _XmEnhancedButtonPart + { +--- 49,55 ---- + extern XmEnhancedButtonClassRec xmEnhancedButtonClassRec; + + /* +! * EnhancedButton instance record. + */ + typedef struct _XmEnhancedButtonPart + { +*** ../vim-7.3.924/src/hardcopy.c 2011-04-11 21:35:03.000000000 +0200 +--- src/hardcopy.c 2013-05-06 04:00:47.000000000 +0200 +*************** +*** 2186,2192 **** + if (num_copies > 1) + { + prt_write_string(" numcopies("); +! /* Note: no space wanted so dont use prt_write_int() */ + sprintf((char *)prt_line_buffer, "%d", num_copies); + prt_write_file(prt_line_buffer); + prt_write_string(")"); +--- 2186,2192 ---- + if (num_copies > 1) + { + prt_write_string(" numcopies("); +! /* Note: no space wanted so don't use prt_write_int() */ + sprintf((char *)prt_line_buffer, "%d", num_copies); + prt_write_file(prt_line_buffer); + prt_write_string(")"); +*** ../vim-7.3.924/src/if_cscope.c 2011-06-12 21:24:56.000000000 +0200 +--- src/if_cscope.c 2013-05-06 03:58:29.000000000 +0200 +*************** +*** 1192,1200 **** + 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; +--- 1192,1199 ---- + if (nummatches == NULL) + return FALSE; + +! /* Send query to all open connections, then count the total number +! * of matches so we can alloc all in one swell foop. */ + for (i = 0; i < csinfo_size; i++) + nummatches[i] = 0; + totmatches = 0; +*** ../vim-7.3.924/src/if_mzsch.c 2013-01-31 21:09:10.000000000 +0100 +--- src/if_mzsch.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 3053,3059 **** + status = FAIL; + else + { +! /* add the value in advance to allow handling of self-referencial + * data structures */ + typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T)); + copy_tv(tv, visited_tv); +--- 3053,3059 ---- + status = FAIL; + else + { +! /* add the value in advance to allow handling of self-referential + * data structures */ + typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T)); + copy_tv(tv, visited_tv); +*************** +*** 3088,3094 **** + if (status == FAIL) + break; + } +! /* impoper list not terminated with null + * need to handle the last element */ + if (status == OK && !SCHEME_NULLP(curr)) + { +--- 3088,3094 ---- + if (status == FAIL) + break; + } +! /* improper list not terminated with null + * need to handle the last element */ + if (status == OK && !SCHEME_NULLP(curr)) + { +*************** +*** 3136,3142 **** + { + if (((Scheme_Hash_Table *) obj)->vals[i] != NULL) + { +! /* generate item for `diplay'ed Scheme key */ + dictitem_T *item = dictitem_alloc((char_u *)string_to_line( + ((Scheme_Hash_Table *) obj)->keys[i])); + /* convert Scheme val to Vim and add it to the dict */ +--- 3136,3142 ---- + { + if (((Scheme_Hash_Table *) obj)->vals[i] != NULL) + { +! /* generate item for `display'ed Scheme key */ + dictitem_T *item = dictitem_alloc((char_u *)string_to_line( + ((Scheme_Hash_Table *) obj)->keys[i])); + /* convert Scheme val to Vim and add it to the dict */ +*** ../vim-7.3.924/src/if_ole.cpp 2010-08-15 21:57:32.000000000 +0200 +--- src/if_ole.cpp 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 645,651 **** + CoTaskMemFree(wGUID); + } + +! // Delete a key and all of its descendents + static void RecursiveDeleteKey(HKEY hKeyParent, const char *child) + { + // Open the child +--- 645,651 ---- + CoTaskMemFree(wGUID); + } + +! // Delete a key and all of its descendants + static void RecursiveDeleteKey(HKEY hKeyParent, const char *child) + { + // Open the child +*************** +*** 655,661 **** + if (result != ERROR_SUCCESS) + return; + +! // Enumerate all of the decendents of this child + FILETIME time; + char buffer[1024]; + DWORD size = 1024; +--- 655,661 ---- + if (result != ERROR_SUCCESS) + return; + +! // Enumerate all of the descendants of this child + FILETIME time; + char buffer[1024]; + DWORD size = 1024; +*************** +*** 663,669 **** + while (RegEnumKeyEx(hKeyChild, 0, buffer, &size, NULL, + NULL, NULL, &time) == S_OK) + { +! // Delete the decendents of this child + RecursiveDeleteKey(hKeyChild, buffer); + size = 256; + } +--- 663,669 ---- + while (RegEnumKeyEx(hKeyChild, 0, buffer, &size, NULL, + NULL, NULL, &time) == S_OK) + { +! // Delete the descendants of this child + RecursiveDeleteKey(hKeyChild, buffer); + size = 256; + } +*** ../vim-7.3.924/src/if_perl.xs 2013-03-19 14:25:50.000000000 +0100 +--- src/if_perl.xs 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 657,663 **** + + /* + * perl_win_free +! * Remove all refences to the window to be destroyed + */ + void + perl_win_free(wp) +--- 657,663 ---- + + /* + * perl_win_free +! * Remove all references to the window to be destroyed + */ + void + perl_win_free(wp) +*** ../vim-7.3.924/src/if_py_both.h 2013-05-06 03:52:44.000000000 +0200 +--- src/if_py_both.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 2160,2166 **** + static int + 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: + * 1. NULL, or None - this is a deletion. + * 2. A string - this is a replacement. +--- 2160,2166 ---- + static int + SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change) + { +! /* First of all, we check the type of the supplied Python object. + * There are three cases: + * 1. NULL, or None - this is a deletion. + * 2. A string - this is a replacement. +*************** +*** 2251,2257 **** + static int + 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: + * 1. NULL, or None - this is a deletion. + * 2. A list - this is a replacement. +--- 2251,2257 ---- + static int + SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_change) + { +! /* First of all, we check the type of the supplied Python object. + * There are three cases: + * 1. NULL, or None - this is a deletion. + * 2. A list - this is a replacement. +*************** +*** 2428,2434 **** + } + } + +! /* Insert a number of lines into the specified buffer after the specifed line. + * The line number is in Vim format (1-based). The lines to be inserted are + * given as a Python list of string objects or as a single string. The lines + * to be added are checked for validity and correct format. Errors are +--- 2428,2434 ---- + } + } + +! /* Insert a number of lines into the specified buffer after the specified line. + * The line number is in Vim format (1-based). The lines to be inserted are + * given as a Python list of string objects or as a single string. The lines + * to be added are checked for validity and correct format. Errors are +*************** +*** 2819,2825 **** + return NULL; + } + +! /* Ckeck for keyboard interrupt */ + if (VimErrorCheck()) + return NULL; + +--- 2819,2825 ---- + return NULL; + } + +! /* Check for keyboard interrupt */ + if (VimErrorCheck()) + return NULL; + +*** ../vim-7.3.924/src/if_python.c 2013-05-06 03:52:44.000000000 +0200 +--- src/if_python.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 773,779 **** + + /* Remove the element from sys.path that was added because of our + * argv[0] value in PythonMod_Init(). Previously we used an empty +! * string, but dependinding on the OS we then get an empty entry or + * the current directory in sys.path. */ + PyRun_SimpleString("import sys; sys.path = filter(lambda x: x != '/must>not&exist', sys.path)"); + +--- 773,779 ---- + + /* Remove the element from sys.path that was added because of our + * argv[0] value in PythonMod_Init(). Previously we used an empty +! * string, but depending on the OS we then get an empty entry or + * the current directory in sys.path. */ + PyRun_SimpleString("import sys; sys.path = filter(lambda x: x != '/must>not&exist', sys.path)"); + +*** ../vim-7.3.924/src/if_python3.c 2013-05-06 03:52:44.000000000 +0200 +--- src/if_python3.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 766,772 **** + + /* Remove the element from sys.path that was added because of our + * argv[0] value in Py3Init_vim(). Previously we used an empty +! * string, but dependinding on the OS we then get an empty entry or + * the current directory in sys.path. + * Only after vim has been imported, the element does exist in + * sys.path. +--- 766,772 ---- + + /* Remove the element from sys.path that was added because of our + * argv[0] value in Py3Init_vim(). Previously we used an empty +! * string, but depending on the OS we then get an empty entry or + * the current directory in sys.path. + * Only after vim has been imported, the element does exist in + * sys.path. +*** ../vim-7.3.924/src/if_ruby.c 2013-04-14 16:18:52.000000000 +0200 +--- src/if_ruby.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 113,119 **** + #endif + + /* +! * Backward compatiblity for Ruby 1.8 and earlier. + * Ruby 1.9 does not provide STR2CSTR, instead StringValuePtr is provided. + * Ruby 1.9 does not provide RXXX(s)->len and RXXX(s)->ptr, instead + * RXXX_LEN(s) and RXXX_PTR(s) are provided. +--- 113,119 ---- + #endif + + /* +! * Backward compatibility for Ruby 1.8 and earlier. + * Ruby 1.9 does not provide STR2CSTR, instead StringValuePtr is provided. + * Ruby 1.9 does not provide RXXX(s)->len and RXXX(s)->ptr, instead + * RXXX_LEN(s) and RXXX_PTR(s) are provided. +*************** +*** 1333,1339 **** + rb_global_variable(&objtbl); + + /* The Vim module used to be called "VIM", but "Vim" is better. Make an +! * alias "VIM" for backwards compatiblity. */ + mVIM = rb_define_module("Vim"); + rb_define_const(rb_cObject, "VIM", mVIM); + rb_define_const(mVIM, "VERSION_MAJOR", INT2NUM(VIM_VERSION_MAJOR)); +--- 1333,1339 ---- + rb_global_variable(&objtbl); + + /* The Vim module used to be called "VIM", but "Vim" is better. Make an +! * alias "VIM" for backwards compatibility. */ + mVIM = rb_define_module("Vim"); + rb_define_const(rb_cObject, "VIM", mVIM); + rb_define_const(mVIM, "VERSION_MAJOR", INT2NUM(VIM_VERSION_MAJOR)); +*** ../vim-7.3.924/src/main.aap 2010-08-15 21:57:28.000000000 +0200 +--- src/main.aap 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1213,1221 **** + :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc + + # po/Make_osx.pl says something about generating a Mac message file +! # for Ukrananian. Would somebody using Mac OS X in Ukranian + # *really* be upset that Carbon Vim was not localised in +! # Ukranian? + # + #bundle-language: bundle-dir po/Make_osx.pl + # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) +--- 1213,1221 ---- + :move gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc + + # po/Make_osx.pl says something about generating a Mac message file +! # for Ukrainian. Would somebody using Mac OS X in Ukrainian + # *really* be upset that Carbon Vim was not localised in +! # Ukrainian? + # + #bundle-language: bundle-dir po/Make_osx.pl + # cd po && perl Make_osx.pl --outdir ../$(RESDIR) $(MULTILANG) +*** ../vim-7.3.924/src/mbyte.c 2013-02-26 14:56:24.000000000 +0100 +--- src/mbyte.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 903,909 **** + { + switch (enc_dbcs) + { +! /* please add classfy routine for your language in here */ + + case DBCS_JPNU: /* ? */ + case DBCS_JPN: +--- 903,909 ---- + { + switch (enc_dbcs) + { +! /* please add classify routine for your language in here */ + + case DBCS_JPNU: /* ? */ + case DBCS_JPN: +*************** +*** 1003,1009 **** + * 26 : Box Drawings + * 27 : Unit Symbols + * 28 : Circled/Parenthesized Letter +! * 29 : Hirigana/Katakana + * 30 : Cyrillic Letter + */ + +--- 1003,1009 ---- + * 26 : Box Drawings + * 27 : Unit Symbols + * 28 : Circled/Parenthesized Letter +! * 29 : Hiragana/Katakana + * 30 : Cyrillic Letter + */ + +*************** +*** 1054,1060 **** + return 28; + case 0xAA: + case 0xAB: +! /* Hirigana/Katakana */ + return 29; + case 0xAC: + /* Cyrillic Letter */ +--- 1054,1060 ---- + return 28; + case 0xAA: + case 0xAB: +! /* Hiragana/Katakana */ + return 29; + case 0xAC: + /* Cyrillic Letter */ +*************** +*** 4599,4605 **** + } + + /* The thing which setting "preedit_start_col" to MAXCOL means that +! * "preedit_start_col" will be set forcely when calling + * preedit_changed_cb() next time. + * "preedit_start_col" should not reset with MAXCOL on this part. Vim + * is simulating the preediting by using add_to_input_str(). when +--- 4599,4605 ---- + } + + /* The thing which setting "preedit_start_col" to MAXCOL means that +! * "preedit_start_col" will be set forcedly when calling + * preedit_changed_cb() next time. + * "preedit_start_col" should not reset with MAXCOL on this part. Vim + * is simulating the preediting by using add_to_input_str(). when +*** ../vim-7.3.924/src/memfile.c 2011-05-10 16:41:13.000000000 +0200 +--- src/memfile.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 628,634 **** + * sync from the system itself). + */ + # if defined(__EMX__) +! error "Dont use fsync with EMX! Read emxdoc.doc or emxfix01.doc for info." + # endif + if (STRCMP(p_sws, "fsync") == 0) + { +--- 628,634 ---- + * sync from the system itself). + */ + # if defined(__EMX__) +! error "Don't use fsync with EMX! Read emxdoc.doc or emxfix01.doc for info." + # endif + if (STRCMP(p_sws, "fsync") == 0) + { +*************** +*** 1075,1081 **** + if (nr > mfp->mf_infile_count) /* beyond end of file */ + { + nr = mfp->mf_infile_count; +! hp2 = mf_find_hash(mfp, nr); /* NULL catched below */ + } + else + hp2 = hp; +--- 1075,1081 ---- + if (nr > mfp->mf_infile_count) /* beyond end of file */ + { + nr = mfp->mf_infile_count; +! hp2 = mf_find_hash(mfp, nr); /* NULL caught below */ + } + else + hp2 = hp; +*************** +*** 1184,1190 **** + { + new_bnum = freep->bh_bnum; + /* +! * If the page count of the free block was larger, recude it. + * If the page count matches, remove the block from the free list + */ + if (freep->bh_page_count > page_count) +--- 1184,1190 ---- + { + new_bnum = freep->bh_bnum; + /* +! * If the page count of the free block was larger, reduce it. + * If the page count matches, remove the block from the free list + */ + if (freep->bh_page_count > page_count) +*************** +*** 1309,1315 **** + mf_set_ffname(mfp); + #if defined(MSDOS) || defined(MSWIN) + /* +! * A ":!cd e:xxx" may change the directory without us knowning, use the + * full pathname always. Careful: This frees fname! + */ + mf_fullname(mfp); +--- 1309,1315 ---- + mf_set_ffname(mfp); + #if defined(MSDOS) || defined(MSWIN) + /* +! * A ":!cd e:xxx" may change the directory without us knowing, use the + * full pathname always. Careful: This frees fname! + */ + mf_fullname(mfp); +*** ../vim-7.3.924/src/memline.c 2012-10-03 18:24:55.000000000 +0200 +--- src/memline.c 2013-05-06 04:01:02.000000000 +0200 +*************** +*** 3141,3147 **** + ) + set_keep_msg((char_u *)_(no_lines_msg), 0); + +! /* FEAT_BYTEOFF already handled in there, dont worry 'bout it below */ + i = ml_replace((linenr_T)1, (char_u *)"", TRUE); + buf->b_ml.ml_flags |= ML_EMPTY; + +--- 3141,3147 ---- + ) + set_keep_msg((char_u *)_(no_lines_msg), 0); + +! /* FEAT_BYTEOFF already handled in there, don't worry 'bout it below */ + i = ml_replace((linenr_T)1, (char_u *)"", TRUE); + buf->b_ml.ml_flags |= ML_EMPTY; + +*** ../vim-7.3.924/src/misc1.c 2013-05-04 03:40:22.000000000 +0200 +--- src/misc1.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1654,1660 **** + if (vim_iswhite(string[0])) + { + if (i == 0 || !vim_iswhite(line[i - 1])) +! continue; /* missing shite space */ + while (vim_iswhite(string[0])) + ++string; + } +--- 1654,1660 ---- + if (vim_iswhite(string[0])) + { + if (i == 0 || !vim_iswhite(line[i - 1])) +! continue; /* missing white space */ + while (vim_iswhite(string[0])) + ++string; + } +*** ../vim-7.3.924/src/misc2.c 2013-04-12 14:42:35.000000000 +0200 +--- src/misc2.c 2013-05-06 03:59:29.000000000 +0200 +*************** +*** 2907,2913 **** + int modifiers = *modp; + + #ifdef MACOS +! /* Command-key really special, No fancynest */ + if (!(modifiers & MOD_MASK_CMD)) + #endif + if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key)) +--- 2907,2913 ---- + int modifiers = *modp; + + #ifdef MACOS +! /* Command-key really special, no fancynest */ + if (!(modifiers & MOD_MASK_CMD)) + #endif + if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key)) +*************** +*** 2934,2940 **** + key = K_ZERO; + } + #ifdef MACOS +! /* Command-key really special, No fancynest */ + if (!(modifiers & MOD_MASK_CMD)) + #endif + if ((modifiers & MOD_MASK_ALT) && key < 0x80 +--- 2934,2940 ---- + key = K_ZERO; + } + #ifdef MACOS +! /* Command-key really special, no fancynest */ + if (!(modifiers & MOD_MASK_CMD)) + #endif + if ((modifiers & MOD_MASK_ALT) && key < 0x80 +*** ../vim-7.3.924/src/nbdebug.c 2010-08-15 21:57:29.000000000 +0200 +--- src/nbdebug.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 17,23 **** + * debugging startup problems because gvim will be started automatically from + * netbeans and cannot be run directly from a debugger. The only way to debug + * a gvim started by netbeans is by attaching a debugger to it. Without this +! * tool all starup code will have completed before you can get the pid and + * attach. + * + * The second tool is a log tool. +--- 17,23 ---- + * debugging startup problems because gvim will be started automatically from + * netbeans and cannot be run directly from a debugger. The only way to debug + * a gvim started by netbeans is by attaching a debugger to it. Without this +! * tool all startup code will have completed before you can get the pid and + * attach. + * + * The second tool is a log tool. +*** ../vim-7.3.924/src/normal.c 2013-04-24 18:34:40.000000000 +0200 +--- src/normal.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 2513,2519 **** + + #ifndef FEAT_VISUAL + /* +! * ALT is only used for starging/extending Visual mode. + */ + if ((mod_mask & MOD_MASK_ALT)) + return FALSE; +--- 2513,2519 ---- + + #ifndef FEAT_VISUAL + /* +! * ALT is only used for starting/extending Visual mode. + */ + if ((mod_mask & MOD_MASK_ALT)) + return FALSE; +*************** +*** 5084,5090 **** + } + break; + +! /* "zE": erease all folds */ + case 'E': if (foldmethodIsManual(curwin)) + { + clearFolding(curwin); +--- 5084,5090 ---- + } + break; + +! /* "zE": erase all folds */ + case 'E': if (foldmethodIsManual(curwin)) + { + clearFolding(curwin); +*************** +*** 7465,7471 **** + static char_u trans[] = "YyDdCcxdXdAAIIrr"; + + /* Uppercase means linewise, except in block mode, then "D" deletes till +! * the end of the line, and "C" replaces til EOL */ + if (isupper(cap->cmdchar)) + { + if (VIsual_mode != Ctrl_V) +--- 7465,7471 ---- + static char_u trans[] = "YyDdCcxdXdAAIIrr"; + + /* Uppercase means linewise, except in block mode, then "D" deletes till +! * the end of the line, and "C" replaces till EOL */ + if (isupper(cap->cmdchar)) + { + if (VIsual_mode != Ctrl_V) +*************** +*** 8804,8810 **** + * at first, but it's really more what we mean when we say + * 'cw'. + * Another strangeness: When standing on the end of a word +! * "ce" will change until the end of the next wordt, but "cw" + * will change only one character! This is done by setting + * flag. + */ +--- 8804,8810 ---- + * at first, but it's really more what we mean when we say + * 'cw'. + * Another strangeness: When standing on the end of a word +! * "ce" will change until the end of the next word, but "cw" + * will change only one character! This is done by setting + * flag. + */ +*************** +*** 9150,9156 **** + { + int save_State = State; + +! /* Pretent Insert mode here to allow the cursor on the + * character past the end of the line */ + State = INSERT; + coladvance((colnr_T)MAXCOL); +--- 9150,9156 ---- + { + int save_State = State; + +! /* Pretend Insert mode here to allow the cursor on the + * character past the end of the line */ + State = INSERT; + coladvance((colnr_T)MAXCOL); +*************** +*** 9189,9195 **** + { + int save_State = State; + +! /* Pretent Insert mode here to allow the cursor on the + * character past the end of the line */ + State = INSERT; + coladvance(getviscol()); +--- 9189,9195 ---- + { + int save_State = State; + +! /* Pretend Insert mode here to allow the cursor on the + * character past the end of the line */ + State = INSERT; + coladvance(getviscol()); +*** ../vim-7.3.924/src/ops.c 2013-03-13 17:50:20.000000000 +0100 +--- src/ops.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 398,404 **** + #ifdef FEAT_RIGHTLEFT + int old_p_ri = p_ri; + +! p_ri = 0; /* don't want revins in ident */ + #endif + + State = INSERT; /* don't want REPLACE for State */ +--- 398,404 ---- + #ifdef FEAT_RIGHTLEFT + int old_p_ri = p_ri; + +! p_ri = 0; /* don't want revins in indent */ + #endif + + State = INSERT; /* don't want REPLACE for State */ +*** ../vim-7.3.924/src/os_amiga.c 2012-11-20 16:53:34.000000000 +0100 +--- src/os_amiga.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 118,124 **** + } + + /* +! * mch_inchar(): low level input funcion. + * Get a characters from the keyboard. + * If time == 0 do not wait for characters. + * If time == n wait a short time for characters. +--- 118,124 ---- + } + + /* +! * mch_inchar(): low level input function. + * Get a characters from the keyboard. + * If time == 0 do not wait for characters. + * If time == n wait a short time for characters. +*** ../vim-7.3.924/src/os_mac.h 2010-08-15 21:57:32.000000000 +0200 +--- src/os_mac.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 45,51 **** + /* Get stat.h or something similar. Comment: How come some OS get in in vim.h */ + # include + /* && defined(HAVE_CURSE) */ +! /* The curses.h from MacOS X provides by default some BACKWARD compatibilty + * definition which can cause us problem later on. So we undefine a few of them. */ + # include + # undef reg +--- 45,51 ---- + /* Get stat.h or something similar. Comment: How come some OS get in in vim.h */ + # include + /* && defined(HAVE_CURSE) */ +! /* The curses.h from MacOS X provides by default some BACKWARD compatibility + * definition which can cause us problem later on. So we undefine a few of them. */ + # include + # undef reg +*** ../vim-7.3.924/src/os_msdos.c 2012-11-20 16:53:34.000000000 +0100 +--- src/os_msdos.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 702,708 **** + * If Vim should work over the serial line after a 'ctty com1' we must use + * kbhit() and getch(). (jw) + * Usually kbhit() is not used, because then CTRL-C and CTRL-P +! * will be catched by DOS (mool). + * + * return TRUE if a character is available, FALSE otherwise + */ +--- 702,708 ---- + * If Vim should work over the serial line after a 'ctty com1' we must use + * kbhit() and getch(). (jw) + * Usually kbhit() is not used, because then CTRL-C and CTRL-P +! * will be caught by DOS (mool). + * + * return TRUE if a character is available, FALSE otherwise + */ +*************** +*** 971,977 **** + } + + /* +! * mch_inchar(): low level input funcion. + * Get a characters from the keyboard. + * If time == 0 do not wait for characters. + * If time == n wait a short time for characters. +--- 971,977 ---- + } + + /* +! * mch_inchar(): low level input function. + * Get a characters from the keyboard. + * If time == 0 do not wait for characters. + * If time == n wait a short time for characters. +*************** +*** 993,999 **** + + /* + * if we got a ctrl-C when we were busy, there will be a "^C" somewhere +! * on the sceen, so we need to redisplay it. + */ + if (delayed_redraw) + { +--- 993,999 ---- + + /* + * if we got a ctrl-C when we were busy, there will be a "^C" somewhere +! * on the screen, so we need to redisplay it. + */ + if (delayed_redraw) + { +*************** +*** 1745,1751 **** + mch_setmouse(int on) + { + mouse_active = on; +! mouse_hidden = TRUE; /* dont show it until moved */ + } + #endif + +--- 1745,1751 ---- + mch_setmouse(int on) + { + mouse_active = on; +! mouse_hidden = TRUE; /* don't show it until moved */ + } + #endif + +*************** +*** 2438,2444 **** + long start_time; + int tick_count; + +! /* int 02xf, AX = 0x1701 attempts to open the Windows clipboard. Upon + * return from the interrupt, if AX is non-zero, the clipboard was + * successfully opened. If AX is zero, the clipboard could not be opened + * because it is currently in use by another process. +--- 2438,2444 ---- + long start_time; + int tick_count; + +! /* int 0x2f, AX = 0x1701 attempts to open the Windows clipboard. Upon + * return from the interrupt, if AX is non-zero, the clipboard was + * successfully opened. If AX is zero, the clipboard could not be opened + * because it is currently in use by another process. +*************** +*** 2533,2539 **** + { + __dpmi_regs dpmi_regs; + +! /* int 02xf, AX = 0x1702 attempts to empty the Windows clipboard. Upon + * return from the interrupt, if AX == 0, the clipboard could not be + * emptied (for some reason). + */ +--- 2533,2539 ---- + { + __dpmi_regs dpmi_regs; + +! /* int 0x2f, AX = 0x1702 attempts to empty the Windows clipboard. Upon + * return from the interrupt, if AX == 0, the clipboard could not be + * emptied (for some reason). + */ +*************** +*** 2616,2622 **** + case CF_TEXT: /* Windows text */ + case CF_OEMTEXT: /* DOS (OEM) text */ + +! /* int 02xf, AX = 0x1704 returns the number of bytes of data currently + * on the Windows clipboard, for the specified format. Upon return + * from the interrupt, DX:AX = the number of bytes, rounded up to the + * nearest multiple of 32. +--- 2616,2622 ---- + case CF_TEXT: /* Windows text */ + case CF_OEMTEXT: /* DOS (OEM) text */ + +! /* int 0x2f, AX = 0x1704 returns the number of bytes of data currently + * on the Windows clipboard, for the specified format. Upon return + * from the interrupt, DX:AX = the number of bytes, rounded up to the + * nearest multiple of 32. +*************** +*** 2820,2826 **** + clip_data_size); /* how many bytes to copy */ + + /* Send data from the DOS transfer buffer to the Windows clipboard. +! * int 02xf, AX = 0x1703 sends SI:CX bytes of data from the buffer + * at ES:BX, to the clipboard. + */ + dpmi_regs.x.ax = 0x1703; /* send clipboard data */ +--- 2820,2826 ---- + clip_data_size); /* how many bytes to copy */ + + /* Send data from the DOS transfer buffer to the Windows clipboard. +! * int 0x2f, AX = 0x1703 sends SI:CX bytes of data from the buffer + * at ES:BX, to the clipboard. + */ + dpmi_regs.x.ax = 0x1703; /* send clipboard data */ +*** ../vim-7.3.924/src/os_mswin.c 2013-03-19 14:48:25.000000000 +0100 +--- src/os_mswin.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1794,1800 **** + * + * So we create a hidden window, and arrange to destroy it on exit. + */ +! HWND message_window = 0; /* window that's handling messsages */ + + #define VIM_CLASSNAME "VIM_MESSAGES" + #define VIM_CLASSNAME_LEN (sizeof(VIM_CLASSNAME) - 1) +--- 1794,1800 ---- + * + * So we create a hidden window, and arrange to destroy it on exit. + */ +! HWND message_window = 0; /* window that's handling messages */ + + #define VIM_CLASSNAME "VIM_MESSAGES" + #define VIM_CLASSNAME_LEN (sizeof(VIM_CLASSNAME) - 1) +*************** +*** 1857,1863 **** + + static int save_reply(HWND server, char_u *reply, int expr); + +! /*s + * The window procedure for the hidden message window. + * It handles callback messages and notifications from servers. + * In order to process these messages, it is necessary to run a +--- 1857,1863 ---- + + static int save_reply(HWND server, char_u *reply, int expr); + +! /* + * The window procedure for the hidden message window. + * It handles callback messages and notifications from servers. + * In order to process these messages, it is necessary to run a +*************** +*** 2603,2609 **** + + ReleaseDC(hwnd, hdc); + +! /* If we couldn't find a useable font, return failure */ + if (n == 1) + return FAIL; + +--- 2603,2609 ---- + + ReleaseDC(hwnd, hdc); + +! /* If we couldn't find a usable font, return failure */ + if (n == 1) + return FAIL; + +*** ../vim-7.3.924/src/os_win16.h 2012-11-20 16:53:34.000000000 +0100 +--- src/os_win16.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 50,56 **** + #endif + + /* toupper() is not really broken, but it's very slow. Probably because of +! * using unicde characters on Windows NT */ + #define BROKEN_TOUPPER + + #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */ +--- 50,56 ---- + #endif + + /* toupper() is not really broken, but it's very slow. Probably because of +! * using unicode characters on Windows NT */ + #define BROKEN_TOUPPER + + #define FNAME_ILLEGAL "\"*?><|" /* illegal characters in a file name */ +*** ../vim-7.3.924/src/os_win32.c 2013-03-19 14:48:25.000000000 +0100 +--- src/os_win32.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 161,167 **** + + #ifndef PROTO + +! /* Enable common dialogs input unicode from IME if posible. */ + #ifdef FEAT_MBYTE + LRESULT (WINAPI *pDispatchMessage)(CONST MSG *) = DispatchMessage; + BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage; +--- 161,167 ---- + + #ifndef PROTO + +! /* Enable common dialogs input unicode from IME if possible. */ + #ifdef FEAT_MBYTE + LRESULT (WINAPI *pDispatchMessage)(CONST MSG *) = DispatchMessage; + BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage; +*************** +*** 1032,1038 **** + DWORD dwLR = (pmer->dwButtonState & LEFT_RIGHT); + + /* if either left or right button only is pressed, see if the +! * the next mouse event has both of them pressed */ + if (dwLR == LEFT || dwLR == RIGHT) + { + for (;;) +--- 1032,1038 ---- + DWORD dwLR = (pmer->dwButtonState & LEFT_RIGHT); + + /* if either left or right button only is pressed, see if the +! * next mouse event has both of them pressed */ + if (dwLR == LEFT || dwLR == RIGHT) + { + for (;;) +*** ../vim-7.3.924/src/os_win32.h 2013-03-19 14:48:25.000000000 +0100 +--- src/os_win32.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 201,207 **** + + #ifndef PROTO + +! /* Enable common dialogs input unicode from IME if posible. */ + #ifdef FEAT_MBYTE + /* The variables are defined in os_win32.c. */ + extern LRESULT (WINAPI *pDispatchMessage)(CONST MSG *); +--- 201,207 ---- + + #ifndef PROTO + +! /* Enable common dialogs input unicode from IME if possible. */ + #ifdef FEAT_MBYTE + /* The variables are defined in os_win32.c. */ + extern LRESULT (WINAPI *pDispatchMessage)(CONST MSG *); +*** ../vim-7.3.924/src/quickfix.c 2013-03-07 16:32:49.000000000 +0100 +--- src/quickfix.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 3235,3241 **** + mch_dirname(dirname_start, MAXPATHL); + + #ifdef FEAT_AUTOCMD +! /* Remeber the value of qf_start, so that we can check for autocommands + * changing the current quickfix list. */ + cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start; + #endif +--- 3235,3241 ---- + mch_dirname(dirname_start, MAXPATHL); + + #ifdef FEAT_AUTOCMD +! /* Remember the value of qf_start, so that we can check for autocommands + * changing the current quickfix list. */ + cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start; + #endif +*** ../vim-7.3.924/src/screen.c 2013-02-13 12:15:59.000000000 +0100 +--- src/screen.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 4044,4050 **** + + /* If a double-width char doesn't fit at the left side display + * a '<' in the first column. Don't do this for unprintable +! * charactes. */ + if (n_skip > 0 && mb_l > 1 && n_extra == 0) + { + n_extra = 1; +--- 4044,4050 ---- + + /* If a double-width char doesn't fit at the left side display + * a '<' in the first column. Don't do this for unprintable +! * characters. */ + if (n_skip > 0 && mb_l > 1 && n_extra == 0) + { + n_extra = 1; +*** ../vim-7.3.924/src/search.c 2013-04-03 21:14:25.000000000 +0200 +--- src/search.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 73,79 **** + { + char_u *pat; /* the pattern (in allocated memory) or NULL */ + int magic; /* magicness of the pattern */ +! int no_scs; /* no smarcase for this pattern */ + struct soffset off; + }; + +--- 73,79 ---- + { + char_u *pat; /* the pattern (in allocated memory) or NULL */ + int magic; /* magicness of the pattern */ +! int no_scs; /* no smartcase for this pattern */ + struct soffset off; + }; + +*************** +*** 3546,3552 **** + + /* + * Find block under the cursor, cursor at end. +! * "what" and "other" are two matching parenthesis/paren/etc. + */ + int + current_block(oap, count, include, what, other) +--- 3546,3552 ---- + + /* + * Find block under the cursor, cursor at end. +! * "what" and "other" are two matching parenthesis/brace/etc. + */ + int + current_block(oap, count, include, what, other) +*** ../vim-7.3.924/src/spell.c 2012-06-29 12:57:03.000000000 +0200 +--- src/spell.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 4228,4234 **** + ga_init2(&ga, sizeof(langp_T), 2); + clear_midword(wp); + +! /* Make a copy of 'spellang', the SpellFileMissing autocommands may change + * it under our fingers. */ + spl_copy = vim_strsave(wp->w_s->b_p_spl); + if (spl_copy == NULL) +--- 4228,4234 ---- + ga_init2(&ga, sizeof(langp_T), 2); + clear_midword(wp); + +! /* Make a copy of 'spelllang', the SpellFileMissing autocommands may change + * it under our fingers. */ + spl_copy = vim_strsave(wp->w_s->b_p_spl); + if (spl_copy == NULL) +*************** +*** 7645,7651 **** + + /* Compress both trees. Either they both have many nodes, which makes + * compression useful, or one of them is small, which means +! * compression goes fast. But when filling the souldfold word tree + * there is no keep-case tree. */ + wordtree_compress(spin, spin->si_foldroot); + if (affixID >= 0) +--- 7645,7651 ---- + + /* Compress both trees. Either they both have many nodes, which makes + * compression useful, or one of them is small, which means +! * compression goes fast. But when filling the soundfold word tree + * there is no keep-case tree. */ + wordtree_compress(spin, spin->si_foldroot); + if (affixID >= 0) +*************** +*** 8671,8677 **** + unsigned words_done = 0; + int wordcount[MAXWLEN]; + +! /* We use si_foldroot for the souldfolded trie. */ + spin->si_foldroot = wordtree_alloc(spin); + if (spin->si_foldroot == NULL) + return FAIL; +--- 8671,8677 ---- + unsigned words_done = 0; + int wordcount[MAXWLEN]; + +! /* We use si_foldroot for the soundfolded trie. */ + spin->si_foldroot = wordtree_alloc(spin); + if (spin->si_foldroot == NULL) + return FAIL; +*************** +*** 13019,13025 **** + + /* + * Combine the list of suggestions in su->su_ga and su->su_sga. +! * They are intwined. + */ + static void + score_combine(su) +--- 13019,13025 ---- + + /* + * Combine the list of suggestions in su->su_ga and su->su_sga. +! * They are entwined. + */ + static void + score_combine(su) +*************** +*** 13457,13463 **** + + /* Add a small penalty for changing the first letter from + * lower to upper case. Helps for "tath" -> "Kath", which is +! * less common thatn "tath" -> "path". Don't do it when the + * letter is the same, that has already been counted. */ + gc = PTR2CHAR(p); + if (SPELL_ISUPPER(gc)) +--- 13457,13463 ---- + + /* Add a small penalty for changing the first letter from + * lower to upper case. Helps for "tath" -> "Kath", which is +! * less common than "tath" -> "path". Don't do it when the + * letter is the same, that has already been counted. */ + gc = PTR2CHAR(p); + if (SPELL_ISUPPER(gc)) +*** ../vim-7.3.924/src/structs.h 2013-04-15 12:27:30.000000000 +0200 +--- src/structs.h 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 1215,1221 **** + #ifdef FEAT_SYN_HL + hashtab_T b_keywtab; /* syntax keywords hash table */ + hashtab_T b_keywtab_ic; /* idem, ignore case */ +! int b_syn_error; /* TRUE when error occured in HL */ + int b_syn_ic; /* ignore case for :syn cmds */ + int b_syn_spell; /* SYNSPL_ values */ + garray_T b_syn_patterns; /* table for syntax patterns */ +--- 1215,1221 ---- + #ifdef FEAT_SYN_HL + hashtab_T b_keywtab; /* syntax keywords hash table */ + hashtab_T b_keywtab_ic; /* idem, ignore case */ +! int b_syn_error; /* TRUE when error occurred in HL */ + int b_syn_ic; /* ignore case for :syn cmds */ + int b_syn_spell; /* SYNSPL_ values */ + garray_T b_syn_patterns; /* table for syntax patterns */ +*** ../vim-7.3.924/src/syntax.c 2013-05-04 03:42:30.000000000 +0200 +--- src/syntax.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 6069,6075 **** + static int depth = 0; + int r; + +! /* If spp has a "containedin" list and "cur_si" is in it, return TRUE. */ + if (cur_si != NULL && ssp->cont_in_list != NULL + && !(cur_si->si_flags & HL_MATCH)) + { +--- 6069,6075 ---- + static int depth = 0; + int r; + +! /* If ssp has a "containedin" list and "cur_si" is in it, return TRUE. */ + if (cur_si != NULL && ssp->cont_in_list != NULL + && !(cur_si->si_flags & HL_MATCH)) + { +*** ../vim-7.3.924/src/window.c 2013-04-15 15:55:15.000000000 +0200 +--- src/window.c 2013-05-06 04:06:04.000000000 +0200 +*************** +*** 3687,3693 **** + + /* + * Prepare for leaving the current tab page. +! * When autocomands change "curtab" we don't leave the tab page and return + * FAIL. + * Careful: When OK is returned need to get a new tab page very very soon! + */ +--- 3687,3693 ---- + + /* + * Prepare for leaving the current tab page. +! * When autocommands change "curtab" we don't leave the tab page and return + * FAIL. + * Careful: When OK is returned need to get a new tab page very very soon! + */ +*** ../vim-7.3.924/vimtutor.com 2010-08-15 21:57:32.000000000 +0200 +--- vimtutor.com 2013-05-06 04:04:07.000000000 +0200 +*************** +*** 30,36 **** + $ ! + $ if f$search ("vim:vim.exe") .eqs. "" + $ then +! $ write sys$error "Error - Can't run tutoral. VIM not found." + $ exit + $ endif + $ ! +--- 30,36 ---- + $ ! + $ if f$search ("vim:vim.exe") .eqs. "" + $ then +! $ write sys$error "Error - Can't run tutorial. VIM not found." + $ exit + $ endif + $ ! +*** ../vim-7.3.924/src/version.c 2013-05-06 03:52:44.000000000 +0200 +--- src/version.c 2013-05-06 04:03:10.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 925, + /**/ + +-- + A KNIGHT rides into shot and hacks him to the ground. He rides off. + We stay for a moment on the glade. A MIDDLE-AGED LADY in a C. & A. + twin-set emerges from the trees and looks in horror at the body of her + HUSBAND. +MRS HISTORIAN: FRANK! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.926 b/7.3.926 new file mode 100644 index 0000000..f0d6cc3 --- /dev/null +++ b/7.3.926 @@ -0,0 +1,905 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.926 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.926 +Problem: Autocommands are triggered by setwinvar() et al. Missing BufEnter + on :tabclose. Duplicate WinEnter on :tabclose. Wrong order of + events for :tablose and :tabnew. +Solution: Fix these autocommand events. (Zyx) +Files: runtime/doc/eval.txt, src/buffer.c, src/eval.c, src/ex_cmds2.c, + src/fileio.c, src/proto/window.pro, src/testdir/test62.in, + src/testdir/test62.ok, src/window.c + + +*** ../vim-7.3.925/runtime/doc/eval.txt 2013-02-20 21:11:14.000000000 +0100 +--- runtime/doc/eval.txt 2013-05-06 04:33:13.000000000 +0200 +*************** +*** 5294,5301 **** + |t:var| + Note that the variable name without "t:" must be used. + Tabs are numbered starting with one. +- Vim briefly goes to the tab page {tabnr}, this may trigger +- TabLeave and TabEnter autocommands. + This function is not available in the |sandbox|. + + settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* +--- 5320,5325 ---- +*************** +*** 5308,5315 **** + doesn't work for a global or local buffer variable. + For a local buffer option the global value is unchanged. + Note that the variable name without "w:" must be used. +- Vim briefly goes to the tab page {tabnr}, this may trigger +- TabLeave and TabEnter autocommands. + Examples: > + :call settabwinvar(1, 1, "&list", 0) + :call settabwinvar(3, 2, "myvar", "foobar") +--- 5332,5337 ---- +*** ../vim-7.3.925/src/buffer.c 2013-05-06 04:21:35.000000000 +0200 +--- src/buffer.c 2013-05-06 04:33:13.000000000 +0200 +*************** +*** 4551,4557 **** + * When the ":tab" modifier was used do this for all tab pages. + */ + if (had_tab > 0) +! goto_tabpage_tp(first_tabpage, TRUE); + for (;;) + { + tpnext = curtab->tp_next; +--- 4551,4557 ---- + * When the ":tab" modifier was used do this for all tab pages. + */ + if (had_tab > 0) +! goto_tabpage_tp(first_tabpage, TRUE, TRUE); + for (;;) + { + tpnext = curtab->tp_next; +*************** +*** 4663,4669 **** + if (!valid_tabpage(tpnext)) + tpnext = first_tabpage; /* start all over...*/ + # endif +! goto_tabpage_tp(tpnext, TRUE); + } + + /* +--- 4663,4669 ---- + if (!valid_tabpage(tpnext)) + tpnext = first_tabpage; /* start all over...*/ + # endif +! goto_tabpage_tp(tpnext, TRUE, TRUE); + } + + /* +*************** +*** 4767,4779 **** + if (last_curtab != new_curtab) + { + if (valid_tabpage(last_curtab)) +! goto_tabpage_tp(last_curtab, TRUE); + if (win_valid(last_curwin)) + win_enter(last_curwin, FALSE); + } + /* to window with first arg */ + if (valid_tabpage(new_curtab)) +! goto_tabpage_tp(new_curtab, TRUE); + if (win_valid(new_curwin)) + win_enter(new_curwin, FALSE); + +--- 4767,4779 ---- + if (last_curtab != new_curtab) + { + if (valid_tabpage(last_curtab)) +! goto_tabpage_tp(last_curtab, TRUE, TRUE); + if (win_valid(last_curwin)) + win_enter(last_curwin, FALSE); + } + /* to window with first arg */ + if (valid_tabpage(new_curtab)) +! goto_tabpage_tp(new_curtab, TRUE, TRUE); + if (win_valid(new_curwin)) + win_enter(new_curwin, FALSE); + +*************** +*** 4825,4831 **** + */ + #ifdef FEAT_WINDOWS + if (had_tab > 0) +! goto_tabpage_tp(first_tabpage, TRUE); + for (;;) + { + #endif +--- 4825,4831 ---- + */ + #ifdef FEAT_WINDOWS + if (had_tab > 0) +! goto_tabpage_tp(first_tabpage, TRUE, TRUE); + for (;;) + { + #endif +*************** +*** 4865,4871 **** + /* Without the ":tab" modifier only do the current tab page. */ + if (had_tab == 0 || tpnext == NULL) + break; +! goto_tabpage_tp(tpnext, TRUE); + } + #endif + +--- 4865,4871 ---- + /* Without the ":tab" modifier only do the current tab page. */ + if (had_tab == 0 || tpnext == NULL) + break; +! goto_tabpage_tp(tpnext, TRUE, TRUE); + } + #endif + +*** ../vim-7.3.925/src/eval.c 2013-05-06 04:21:35.000000000 +0200 +--- src/eval.c 2013-05-06 04:33:13.000000000 +0200 +*************** +*** 16604,16610 **** + if (tp != NULL && varname != NULL && varp != NULL) + { + save_curtab = curtab; +! goto_tabpage_tp(tp, TRUE); + + tabvarname = alloc((unsigned)STRLEN(varname) + 3); + if (tabvarname != NULL) +--- 16604,16610 ---- + if (tp != NULL && varname != NULL && varp != NULL) + { + save_curtab = curtab; +! goto_tabpage_tp(tp, FALSE, FALSE); + + tabvarname = alloc((unsigned)STRLEN(varname) + 3); + if (tabvarname != NULL) +*************** +*** 16617,16623 **** + + /* Restore current tabpage */ + if (valid_tabpage(save_curtab)) +! goto_tabpage_tp(save_curtab, TRUE); + } + } + +--- 16617,16623 ---- + + /* Restore current tabpage */ + if (valid_tabpage(save_curtab)) +! goto_tabpage_tp(save_curtab, FALSE, FALSE); + } + } + +*************** +*** 16654,16660 **** + /* set curwin to be our win, temporarily */ + *save_curwin = curwin; + *save_curtab = curtab; +! goto_tabpage_tp(tp, TRUE); + if (!win_valid(win)) + return FAIL; + curwin = win; +--- 16654,16660 ---- + /* set curwin to be our win, temporarily */ + *save_curwin = curwin; + *save_curtab = curtab; +! goto_tabpage_tp(tp, FALSE, FALSE); + if (!win_valid(win)) + return FAIL; + curwin = win; +*************** +*** 16672,16678 **** + /* Restore current tabpage and window, if still valid (autocommands can + * make them invalid). */ + if (valid_tabpage(save_curtab)) +! goto_tabpage_tp(save_curtab, TRUE); + if (win_valid(save_curwin)) + { + curwin = save_curwin; +--- 16672,16678 ---- + /* Restore current tabpage and window, if still valid (autocommands can + * make them invalid). */ + if (valid_tabpage(save_curtab)) +! goto_tabpage_tp(save_curtab, FALSE, FALSE); + if (win_valid(save_curwin)) + { + curwin = save_curwin; +*** ../vim-7.3.925/src/ex_cmds2.c 2013-05-06 04:21:35.000000000 +0200 +--- src/ex_cmds2.c 2013-05-06 04:33:13.000000000 +0200 +*************** +*** 2482,2488 **** + /* go to window "tp" */ + if (!valid_tabpage(tp)) + break; +! goto_tabpage_tp(tp, TRUE); + tp = tp->tp_next; + } + #endif +--- 2482,2488 ---- + /* go to window "tp" */ + if (!valid_tabpage(tp)) + break; +! goto_tabpage_tp(tp, TRUE, TRUE); + tp = tp->tp_next; + } + #endif +*** ../vim-7.3.925/src/fileio.c 2013-05-06 04:21:35.000000000 +0200 +--- src/fileio.c 2013-05-06 04:33:13.000000000 +0200 +*************** +*** 8934,8940 **** + if (wp == aucmd_win) + { + if (tp != curtab) +! goto_tabpage_tp(tp, TRUE); + win_goto(aucmd_win); + goto win_found; + } +--- 8934,8940 ---- + if (wp == aucmd_win) + { + if (tp != curtab) +! goto_tabpage_tp(tp, TRUE, TRUE); + win_goto(aucmd_win); + goto win_found; + } +*** ../vim-7.3.925/src/proto/window.pro 2012-07-19 18:05:40.000000000 +0200 +--- src/proto/window.pro 2013-05-06 04:33:13.000000000 +0200 +*************** +*** 27,33 **** + tabpage_T *find_tabpage __ARGS((int n)); + int tabpage_index __ARGS((tabpage_T *ftp)); + void goto_tabpage __ARGS((int n)); +! void goto_tabpage_tp __ARGS((tabpage_T *tp, int trigger_autocmds)); + void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp)); + void tabpage_move __ARGS((int nr)); + void win_goto __ARGS((win_T *wp)); +--- 27,33 ---- + tabpage_T *find_tabpage __ARGS((int n)); + int tabpage_index __ARGS((tabpage_T *ftp)); + void goto_tabpage __ARGS((int n)); +! void goto_tabpage_tp __ARGS((tabpage_T *tp, int trigger_enter_autocmds, int trigger_leave_autocmds)); + void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp)); + void tabpage_move __ARGS((int nr)); + void win_goto __ARGS((win_T *wp)); +*** ../vim-7.3.925/src/testdir/test62.in 2012-07-06 18:27:34.000000000 +0200 +--- src/testdir/test62.in 2013-05-06 04:35:08.000000000 +0200 +*************** +*** 120,125 **** +--- 120,187 ---- + :endtry + i=a  + :" ++ :" Test autocommands ++ :tabonly! ++ :let g:r=[] ++ :command -nargs=1 -bar C :call add(g:r, '=== ' . . ' ===')| ++ :function Test() ++ let hasau=has('autocmd') ++ if hasau ++ autocmd TabEnter * :call add(g:r, 'TabEnter') ++ autocmd WinEnter * :call add(g:r, 'WinEnter') ++ autocmd BufEnter * :call add(g:r, 'BufEnter') ++ autocmd TabLeave * :call add(g:r, 'TabLeave') ++ autocmd WinLeave * :call add(g:r, 'WinLeave') ++ autocmd BufLeave * :call add(g:r, 'BufLeave') ++ endif ++ let t:a='a' ++ C tab split ++ if !hasau ++ let g:r+=['WinLeave', 'TabLeave', 'WinEnter', 'TabEnter'] ++ endif ++ let t:a='b' ++ C tabnew ++ if !hasau ++ let g:r+=['WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufLeave', 'BufEnter'] ++ endif ++ let t:a='c' ++ call add(g:r, join(map(range(1, tabpagenr('$')), 'gettabvar(v:val, "a")'))) ++ C call map(range(1, tabpagenr('$')), 'settabvar(v:val, "a", v:val*2)') ++ call add(g:r, join(map(range(1, tabpagenr('$')), 'gettabvar(v:val, "a")'))) ++ let w:a='a' ++ C vsplit ++ if !hasau ++ let g:r+=['WinLeave', 'WinEnter'] ++ endif ++ let w:a='a' ++ let tabn=tabpagenr() ++ let winr=range(1, winnr('$')) ++ C tabnext 1 ++ if !hasau ++ let g:r+=['BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', 'BufEnter'] ++ endif ++ call add(g:r, join(map(copy(winr), 'gettabwinvar('.tabn.', v:val, "a")'))) ++ C call map(copy(winr), 'settabwinvar('.tabn.', v:val, "a", v:val*2)') ++ call add(g:r, join(map(copy(winr), 'gettabwinvar('.tabn.', v:val, "a")'))) ++ if hasau ++ augroup TabDestructive ++ autocmd TabEnter * :C tabnext 2 | C tabclose 3 ++ augroup END ++ C tabnext 3 ++ let g:r+=[tabpagenr().'/'.tabpagenr('$')] ++ autocmd! TabDestructive TabEnter ++ C tabnew ++ C tabnext 1 ++ autocmd TabDestructive TabEnter * nested :C tabnext 2 | C tabclose 3 ++ C tabnext 3 ++ let g:r+=[tabpagenr().'/'.tabpagenr('$')] ++ else ++ let g:r+=["=== tabnext 3 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","=== tabnext 2 ===","=== tabclose 3 ===","2/2","=== tabnew ===","WinLeave","TabLeave","WinEnter","TabEnter","BufLeave","BufEnter","=== tabnext 1 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","BufEnter","=== tabnext 3 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","=== tabnext 2 ===","BufLeave","WinLeave","TabLeave","WinEnter","TabEnter","=== tabnext 2 ===","=== tabclose 3 ===","BufEnter","=== tabclose 3 ===","2/2",] ++ endif ++ endfunction ++ :call Test() ++ :$ put =g:r ++ :" + :" + :/^Results/,$w! test.out + :qa! +*** ../vim-7.3.925/src/testdir/test62.ok 2012-07-06 18:27:34.000000000 +0200 +--- src/testdir/test62.ok 2013-05-06 04:35:08.000000000 +0200 +*************** +*** 18,20 **** +--- 18,88 ---- + 4 + 6 + E474 caught. ++ === tab split === ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ === tabnew === ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ BufLeave ++ BufEnter ++ a b c ++ === call map(range(1, tabpagenr('$')), 'settabvar(v:val, === ++ a b c ++ === vsplit === ++ WinLeave ++ WinEnter ++ === tabnext 1 === ++ BufLeave ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ BufEnter ++ a a ++ === call map(copy(winr), 'settabwinvar('.tabn.', v:val, === ++ a a ++ === tabnext 3 === ++ BufLeave ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ === tabnext 2 === ++ === tabclose 3 === ++ 2/2 ++ === tabnew === ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ BufLeave ++ BufEnter ++ === tabnext 1 === ++ BufLeave ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ BufEnter ++ === tabnext 3 === ++ BufLeave ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ === tabnext 2 === ++ BufLeave ++ WinLeave ++ TabLeave ++ WinEnter ++ TabEnter ++ === tabnext 2 === ++ === tabclose 3 === ++ BufEnter ++ === tabclose 3 === ++ 2/2 +*** ../vim-7.3.925/src/window.c 2013-05-06 04:21:35.000000000 +0200 +--- src/window.c 2013-05-06 04:47:06.000000000 +0200 +*************** +*** 44,54 **** + static void new_frame __ARGS((win_T *wp)); + #if defined(FEAT_WINDOWS) || defined(PROTO) + static tabpage_T *alloc_tabpage __ARGS((void)); +! static int leave_tabpage __ARGS((buf_T *new_curbuf)); +! static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf, int trigger_autocmds)); + static void frame_fix_height __ARGS((win_T *wp)); + static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin)); +! static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin)); + static void win_free __ARGS((win_T *wp, tabpage_T *tp)); + static void frame_append __ARGS((frame_T *after, frame_T *frp)); + static void frame_insert __ARGS((frame_T *before, frame_T *frp)); +--- 44,54 ---- + static void new_frame __ARGS((win_T *wp)); + #if defined(FEAT_WINDOWS) || defined(PROTO) + static tabpage_T *alloc_tabpage __ARGS((void)); +! static int leave_tabpage __ARGS((buf_T *new_curbuf, int trigger_leave_autocmds)); +! static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf, int trigger_enter_autocmds, int trigger_leave_autocmds)); + static void frame_fix_height __ARGS((win_T *wp)); + static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin)); +! static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin, int trigger_enter_autocmds, int trigger_leave_autocmds)); + static void win_free __ARGS((win_T *wp, tabpage_T *tp)); + static void frame_append __ARGS((frame_T *after, frame_T *frp)); + static void frame_insert __ARGS((frame_T *before, frame_T *frp)); +*************** +*** 353,363 **** + && valid_tabpage(oldtab)) + { + newtab = curtab; +! goto_tabpage_tp(oldtab, TRUE); + if (curwin == wp) + win_close(curwin, FALSE); + if (valid_tabpage(newtab)) +! goto_tabpage_tp(newtab, TRUE); + } + } + break; +--- 353,363 ---- + && valid_tabpage(oldtab)) + { + newtab = curtab; +! goto_tabpage_tp(oldtab, TRUE, TRUE); + if (curwin == wp) + win_close(curwin, FALSE); + if (valid_tabpage(newtab)) +! goto_tabpage_tp(newtab, TRUE, TRUE); + } + } + break; +*************** +*** 2124,2129 **** +--- 2124,2131 ---- + { + if (firstwin == lastwin) + { ++ buf_T *old_curbuf = curbuf; ++ + /* + * Closing the last window in a tab page. First go to another tab + * page and then close the window and the tab page. This avoids that +*************** +*** 2132,2138 **** + * Don't trigger autocommands yet, they may use wrong values, so do + * that below. + */ +! goto_tabpage_tp(alt_tabpage(), FALSE); + redraw_tabline = TRUE; + + /* Safety check: Autocommands may have closed the window when jumping +--- 2134,2140 ---- + * Don't trigger autocommands yet, they may use wrong values, so do + * that below. + */ +! goto_tabpage_tp(alt_tabpage(), FALSE, TRUE); + redraw_tabline = TRUE; + + /* Safety check: Autocommands may have closed the window when jumping +*************** +*** 2148,2155 **** + /* Since goto_tabpage_tp above did not trigger *Enter autocommands, do + * that now. */ + #ifdef FEAT_AUTOCMD +- apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); + apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); + #endif + return TRUE; + } +--- 2150,2159 ---- + /* Since goto_tabpage_tp above did not trigger *Enter autocommands, do + * that now. */ + #ifdef FEAT_AUTOCMD + apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); ++ apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); ++ if (old_curbuf != curbuf) ++ apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); + #endif + return TRUE; + } +*************** +*** 2341,2347 **** + win_comp_pos(); + if (close_curwin) + { +! win_enter_ext(wp, FALSE, TRUE); + #ifdef FEAT_AUTOCMD + if (other_buffer) + /* careful: after this wp and win may be invalid! */ +--- 2345,2351 ---- + win_comp_pos(); + if (close_curwin) + { +! win_enter_ext(wp, FALSE, TRUE, TRUE, TRUE); + #ifdef FEAT_AUTOCMD + if (other_buffer) + /* careful: after this wp and win may be invalid! */ +*************** +*** 3529,3535 **** + return FAIL; + + /* Remember the current windows in this Tab page. */ +! if (leave_tabpage(curbuf) == FAIL) + { + vim_free(newtp); + return FAIL; +--- 3533,3539 ---- + return FAIL; + + /* Remember the current windows in this Tab page. */ +! if (leave_tabpage(curbuf, TRUE) == FAIL) + { + vim_free(newtp); + return FAIL; +*************** +*** 3574,3587 **** + + redraw_all_later(CLEAR); + #ifdef FEAT_AUTOCMD +- apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); + apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); + #endif + return OK; + } + + /* Failed, get back the previous Tab page */ +! enter_tabpage(curtab, curbuf, TRUE); + return FAIL; + } + +--- 3578,3591 ---- + + redraw_all_later(CLEAR); + #ifdef FEAT_AUTOCMD + apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); ++ apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); + #endif + return OK; + } + + /* Failed, get back the previous Tab page */ +! enter_tabpage(curtab, curbuf, TRUE, TRUE); + return FAIL; + } + +*************** +*** 3692,3700 **** + * Careful: When OK is returned need to get a new tab page very very soon! + */ + static int +! leave_tabpage(new_curbuf) + buf_T *new_curbuf UNUSED; /* what is going to be the new curbuf, + NULL if unknown */ + { + tabpage_T *tp = curtab; + +--- 3696,3705 ---- + * Careful: When OK is returned need to get a new tab page very very soon! + */ + static int +! leave_tabpage(new_curbuf, trigger_leave_autocmds) + buf_T *new_curbuf UNUSED; /* what is going to be the new curbuf, + NULL if unknown */ ++ int trigger_leave_autocmds UNUSED; + { + tabpage_T *tp = curtab; + +*************** +*** 3702,3719 **** + reset_VIsual_and_resel(); /* stop Visual mode */ + #endif + #ifdef FEAT_AUTOCMD +! if (new_curbuf != curbuf) + { +! apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf); + if (curtab != tp) + return FAIL; + } +- apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf); +- if (curtab != tp) +- return FAIL; +- apply_autocmds(EVENT_TABLEAVE, NULL, NULL, FALSE, curbuf); +- if (curtab != tp) +- return FAIL; + #endif + #if defined(FEAT_GUI) + /* Remove the scrollbars. They may be added back later. */ +--- 3707,3727 ---- + reset_VIsual_and_resel(); /* stop Visual mode */ + #endif + #ifdef FEAT_AUTOCMD +! if (trigger_leave_autocmds) + { +! if (new_curbuf != curbuf) +! { +! apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf); +! if (curtab != tp) +! return FAIL; +! } +! apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf); +! if (curtab != tp) +! return FAIL; +! apply_autocmds(EVENT_TABLEAVE, NULL, NULL, FALSE, curbuf); + if (curtab != tp) + return FAIL; + } + #endif + #if defined(FEAT_GUI) + /* Remove the scrollbars. They may be added back later. */ +*************** +*** 3734,3746 **** + /* + * Start using tab page "tp". + * Only to be used after leave_tabpage() or freeing the current tab page. +! * Only trigger *Enter autocommands when trigger_autocmds is TRUE. + */ + static void +! enter_tabpage(tp, old_curbuf, trigger_autocmds) + tabpage_T *tp; + buf_T *old_curbuf UNUSED; +! int trigger_autocmds UNUSED; + { + int old_off = tp->tp_firstwin->w_winrow; + win_T *next_prevwin = tp->tp_prevwin; +--- 3742,3756 ---- + /* + * Start using tab page "tp". + * Only to be used after leave_tabpage() or freeing the current tab page. +! * Only trigger *Enter autocommands when trigger_enter_autocmds is TRUE. +! * Only trigger *Leave autocommands when trigger_leave_autocmds is TRUE. + */ + static void +! enter_tabpage(tp, old_curbuf, trigger_enter_autocmds, trigger_leave_autocmds) + tabpage_T *tp; + buf_T *old_curbuf UNUSED; +! int trigger_enter_autocmds UNUSED; +! int trigger_leave_autocmds UNUSED; + { + int old_off = tp->tp_firstwin->w_winrow; + win_T *next_prevwin = tp->tp_prevwin; +*************** +*** 3753,3759 **** + /* We would like doing the TabEnter event first, but we don't have a + * valid current window yet, which may break some commands. + * This triggers autocommands, thus may make "tp" invalid. */ +! win_enter_ext(tp->tp_curwin, FALSE, TRUE); + prevwin = next_prevwin; + + last_status(FALSE); /* status line may appear or disappear */ +--- 3763,3769 ---- + /* We would like doing the TabEnter event first, but we don't have a + * valid current window yet, which may break some commands. + * This triggers autocommands, thus may make "tp" invalid. */ +! win_enter_ext(tp->tp_curwin, FALSE, TRUE, trigger_enter_autocmds, trigger_leave_autocmds); + prevwin = next_prevwin; + + last_status(FALSE); /* status line may appear or disappear */ +*************** +*** 3788,3794 **** + #ifdef FEAT_AUTOCMD + /* Apply autocommands after updating the display, when 'rows' and + * 'columns' have been set correctly. */ +! if (trigger_autocmds) + { + apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); + if (old_curbuf != curbuf) +--- 3798,3804 ---- + #ifdef FEAT_AUTOCMD + /* Apply autocommands after updating the display, when 'rows' and + * 'columns' have been set correctly. */ +! if (trigger_enter_autocmds) + { + apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); + if (old_curbuf != curbuf) +*************** +*** 3869,3875 **** + } + } + +! goto_tabpage_tp(tp, TRUE); + + #ifdef FEAT_GUI_TABLINE + if (gui_use_tabline()) +--- 3879,3885 ---- + } + } + +! goto_tabpage_tp(tp, TRUE, TRUE); + + #ifdef FEAT_GUI_TABLINE + if (gui_use_tabline()) +*************** +*** 3879,3901 **** + + /* + * Go to tabpage "tp". +! * Only trigger *Enter autocommands when trigger_autocmds is TRUE. + * Note: doesn't update the GUI tab. + */ + void +! goto_tabpage_tp(tp, trigger_autocmds) + tabpage_T *tp; +! int trigger_autocmds; + { + /* Don't repeat a message in another tab page. */ + set_keep_msg(NULL, 0); + +! if (tp != curtab && leave_tabpage(tp->tp_curwin->w_buffer) == OK) + { + if (valid_tabpage(tp)) +! enter_tabpage(tp, curbuf, trigger_autocmds); + else +! enter_tabpage(curtab, curbuf, trigger_autocmds); + } + } + +--- 3889,3916 ---- + + /* + * Go to tabpage "tp". +! * Only trigger *Enter autocommands when trigger_enter_autocmds is TRUE. +! * Only trigger *Leave autocommands when trigger_leave_autocmds is TRUE. + * Note: doesn't update the GUI tab. + */ + void +! goto_tabpage_tp(tp, trigger_enter_autocmds, trigger_leave_autocmds) + tabpage_T *tp; +! int trigger_enter_autocmds; +! int trigger_leave_autocmds; + { + /* Don't repeat a message in another tab page. */ + set_keep_msg(NULL, 0); + +! if (tp != curtab && leave_tabpage(tp->tp_curwin->w_buffer, +! trigger_leave_autocmds) == OK) + { + if (valid_tabpage(tp)) +! enter_tabpage(tp, curbuf, trigger_enter_autocmds, +! trigger_leave_autocmds); + else +! enter_tabpage(curtab, curbuf, trigger_enter_autocmds, +! trigger_leave_autocmds); + } + } + +*************** +*** 3908,3914 **** + tabpage_T *tp; + win_T *wp; + { +! goto_tabpage_tp(tp, TRUE); + if (curtab == tp && win_valid(wp)) + { + win_enter(wp, TRUE); +--- 3923,3929 ---- + tabpage_T *tp; + win_T *wp; + { +! goto_tabpage_tp(tp, TRUE, TRUE); + if (curtab == tp && win_valid(wp)) + { + win_enter(wp, TRUE); +*************** +*** 4168,4174 **** + win_T *wp; + int undo_sync; + { +! win_enter_ext(wp, undo_sync, FALSE); + } + + /* +--- 4183,4189 ---- + win_T *wp; + int undo_sync; + { +! win_enter_ext(wp, undo_sync, FALSE, TRUE, TRUE); + } + + /* +*************** +*** 4177,4186 **** + * been closed and isn't valid. + */ + static void +! win_enter_ext(wp, undo_sync, curwin_invalid) + win_T *wp; + int undo_sync; + int curwin_invalid; + { + #ifdef FEAT_AUTOCMD + int other_buffer = FALSE; +--- 4192,4203 ---- + * been closed and isn't valid. + */ + static void +! win_enter_ext(wp, undo_sync, curwin_invalid, trigger_enter_autocmds, trigger_leave_autocmds) + win_T *wp; + int undo_sync; + int curwin_invalid; ++ int trigger_enter_autocmds UNUSED; ++ int trigger_leave_autocmds UNUSED; + { + #ifdef FEAT_AUTOCMD + int other_buffer = FALSE; +*************** +*** 4190,4196 **** + return; + + #ifdef FEAT_AUTOCMD +! if (!curwin_invalid) + { + /* + * Be careful: If autocommands delete the window, return now. +--- 4207,4213 ---- + return; + + #ifdef FEAT_AUTOCMD +! if (!curwin_invalid && trigger_leave_autocmds) + { + /* + * Be careful: If autocommands delete the window, return now. +*************** +*** 4259,4267 **** + } + + #ifdef FEAT_AUTOCMD +! apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); +! if (other_buffer) +! apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); + #endif + + #ifdef FEAT_TITLE +--- 4276,4287 ---- + } + + #ifdef FEAT_AUTOCMD +! if (trigger_enter_autocmds) +! { +! apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); +! if (other_buffer) +! apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); +! } + #endif + + #ifdef FEAT_TITLE +*** ../vim-7.3.925/src/version.c 2013-05-06 04:21:35.000000000 +0200 +--- src/version.c 2013-05-06 04:40:52.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 926, + /**/ + +-- + Bravely bold Sir Robin, rode forth from Camelot, + He was not afraid to die, Oh Brave Sir Robin, + He was not at all afraid to be killed in nasty ways + Brave, brave, brave, brave Sir Robin. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.927 b/7.3.927 new file mode 100644 index 0000000..4add389 --- /dev/null +++ b/7.3.927 @@ -0,0 +1,99 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.927 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.927 +Problem: Missing combining characters when putting text in a register. +Solution: Include combining characters. (Christian Brabandt) +Files: src/getchar.c, src/testdir/test44.in, src/testdir/test44.ok + + +*** ../vim-7.3.926/src/getchar.c 2013-04-15 15:47:07.000000000 +0200 +--- src/getchar.c 2013-05-06 05:06:13.000000000 +0200 +*************** +*** 4616,4624 **** +--- 4616,4636 ---- + } + else + { ++ #ifdef FEAT_MBYTE ++ int len = mb_char2len(PTR2CHAR(s)); ++ int len2 = mb_ptr2len(s); ++ #endif + /* Add character, possibly multi-byte to destination, escaping + * CSI and K_SPECIAL. */ + d = add_char2buf(PTR2CHAR(s), d); ++ #ifdef FEAT_MBYTE ++ while (len < len2) ++ { ++ /* add following combining char */ ++ d = add_char2buf(PTR2CHAR(s + len), d); ++ len += mb_char2len(PTR2CHAR(s + len)); ++ } ++ #endif + mb_ptr_adv(s); + } + } +*** ../vim-7.3.926/src/testdir/test44.in 2013-01-23 16:43:07.000000000 +0100 +--- src/testdir/test44.in 2013-05-06 05:01:39.000000000 +0200 +*************** +*** 32,38 **** + x:" Test backwards search from a multi-byte char + /x + x?. +! x:?^1?,$w! test.out + :e! test.out + G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב + :put =matchstr(\"אבגד\", \"..\", 0, 2) " בג +--- 32,40 ---- + x:" Test backwards search from a multi-byte char + /x + x?. +! x:let @w=':%s#comb[i]nations#œ̄ṣ́m̥̄ᾱ̆́#g' +! :@w +! :?^1?,$w! test.out + :e! test.out + G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב + :put =matchstr(\"אבגד\", \"..\", 0, 2) " בג +*************** +*** 61,63 **** +--- 63,66 ---- + h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐẔ + i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑẕ + j 0123❤x ++ k combinations +*** ../vim-7.3.926/src/testdir/test44.ok 2013-01-23 16:43:07.000000000 +0100 +--- src/testdir/test44.ok 2013-05-06 05:01:39.000000000 +0200 +*************** +*** 17,22 **** +--- 17,23 ---- + h AÀÁÂÃÄÅĀĂĄǍǞǠẢ BḂḆ CÇĆĈĊČ DĎĐḊḎḐ EÈÉÊËĒĔĖĘĚẺẼ FḞ GĜĞĠĢǤǦǴḠ HĤĦḢḦḨ IÌÍÎÏĨĪĬĮİǏỈ JĴ KĶǨḰḴ LĹĻĽĿŁḺ MḾṀ NÑŃŅŇṄṈ OÒÓÔÕÖØŌŎŐƠǑǪǬỎ PṔṖ Q RŔŖŘṘṞ SŚŜŞŠṠ TŢŤŦṪṮ UÙÚÛÜŨŪŬŮŰŲƯǓỦ VṼ WŴẀẂẄẆ XẊẌ YÝŶŸẎỲỶỸ ZŹŻŽƵẐ + i aàáâãäåāăąǎǟǡả bḃḇ cçćĉċč dďđḋḏḑ eèéêëēĕėęěẻẽ fḟ gĝğġģǥǧǵḡ hĥħḣḧḩẖ iìíîïĩīĭįǐỉ jĵǰ kķǩḱḵ lĺļľŀłḻ mḿṁ nñńņňʼnṅṉ oòóôõöøōŏőơǒǫǭỏ pṕṗ q rŕŗřṙṟ sśŝşšṡ tţťŧṫṯẗ uùúûüũūŭůűųưǔủ vṽ wŵẁẃẅẇẘ xẋẍ yýÿŷẏẙỳỷỹ zźżžƶẑ + j 012❤ ++ k œ̄ṣ́m̥̄ᾱ̆́ + ב + בג + א +*** ../vim-7.3.926/src/version.c 2013-05-06 04:50:26.000000000 +0200 +--- src/version.c 2013-05-06 05:08:11.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 927, + /**/ + +-- +In his lifetime van Gogh painted 486 oil paintings. Oddly enough, 8975 +of them are to be found in the United States. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.928 b/7.3.928 new file mode 100644 index 0000000..764e705 --- /dev/null +++ b/7.3.928 @@ -0,0 +1,86 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.928 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.928 (after 7.3.924) +Problem: Can't build with strict C compiler. +Solution: Move declaration to start of block. (Taro Muraoka) +Files: src/if_py_both.h + + +*** ../vim-7.3.927/src/if_py_both.h 2013-05-06 04:21:35.000000000 +0200 +--- src/if_py_both.h 2013-05-06 06:21:55.000000000 +0200 +*************** +*** 1521,1532 **** + int flags; + long numval; + char_u *stringval; + + if (this->Check(this->from)) + return NULL; + +- DICTKEY_DECL +- + DICTKEY_GET_NOTEMPTY(NULL) + + flags = get_option_value_strict(key, &numval, &stringval, +--- 1521,1531 ---- + int flags; + long numval; + char_u *stringval; ++ DICTKEY_DECL + + if (this->Check(this->from)) + return NULL; + + DICTKEY_GET_NOTEMPTY(NULL) + + flags = get_option_value_strict(key, &numval, &stringval, +*************** +*** 1616,1627 **** + int flags; + int opt_flags; + int r = 0; + + if (this->Check(this->from)) + return -1; + +- DICTKEY_DECL +- + DICTKEY_GET_NOTEMPTY(-1) + + flags = get_option_value_strict(key, NULL, NULL, +--- 1615,1625 ---- + int flags; + int opt_flags; + int r = 0; ++ DICTKEY_DECL + + if (this->Check(this->from)) + return -1; + + DICTKEY_GET_NOTEMPTY(-1) + + flags = get_option_value_strict(key, NULL, NULL, +*** ../vim-7.3.927/src/version.c 2013-05-06 05:50:22.000000000 +0200 +--- src/version.c 2013-05-06 06:22:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 928, + /**/ + +-- +press CTRL-ALT-DEL for more information + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.929 b/7.3.929 new file mode 100644 index 0000000..adf5d6e --- /dev/null +++ b/7.3.929 @@ -0,0 +1,178 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.929 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.929 (after 7.3.924) +Problem: Compiler warning for unused variable. Not freeing unused string. +Solution: Remove the variable. Clear the options. +Files: src/option.c + + +*** ../vim-7.3.928/src/option.c 2013-05-06 03:52:44.000000000 +0200 +--- src/option.c 2013-05-06 06:42:03.000000000 +0200 +*************** +*** 9705,9713 **** + { + struct vimoption *p; + int opt_idx; +! +! buf_T *buf = (buf_T *) from; +! win_T *win = (win_T *) from; + + opt_idx = findoption(name); + p = &(options[opt_idx]); +--- 9705,9711 ---- + { + struct vimoption *p; + int opt_idx; +! buf_T *buf = (buf_T *)from; + + opt_idx = findoption(name); + p = &(options[opt_idx]); +*************** +*** 9716,9775 **** + { + /* global option with local value: use local value if it's been set */ + case PV_EP: +! *buf->b_p_ep = NUL; + break; + case PV_KP: +! *buf->b_p_kp = NUL; + break; + case PV_PATH: +! *buf->b_p_path = NUL; + break; + case PV_AR: + buf->b_p_ar = -1; + break; + case PV_TAGS: +! *buf->b_p_tags = NUL; + break; + #ifdef FEAT_FIND_ID + case PV_DEF: +! *buf->b_p_def = NUL; + break; + case PV_INC: +! *buf->b_p_inc = NUL; + break; + #endif + #ifdef FEAT_INS_EXPAND + case PV_DICT: +! *buf->b_p_dict = NUL; + break; + case PV_TSR: +! *buf->b_p_tsr = NUL; + break; + #endif + #ifdef FEAT_QUICKFIX + case PV_EFM: +! *buf->b_p_efm = NUL; + break; + case PV_GP: +! *buf->b_p_gp = NUL; + break; + case PV_MP: +! *buf->b_p_mp = NUL; + break; + #endif + #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) + case PV_BEXPR: +! *buf->b_p_bexpr = NUL; + break; + #endif + #if defined(FEAT_CRYPT) + case PV_CM: +! *buf->b_p_cm = NUL; + break; + #endif + #ifdef FEAT_STL_OPT + case PV_STL: +! *win->w_p_stl = NUL; + break; + #endif + } +--- 9714,9773 ---- + { + /* global option with local value: use local value if it's been set */ + case PV_EP: +! clear_string_option(&buf->b_p_ep); + break; + case PV_KP: +! clear_string_option(&buf->b_p_kp); + break; + case PV_PATH: +! clear_string_option(&buf->b_p_path); + break; + case PV_AR: + buf->b_p_ar = -1; + break; + case PV_TAGS: +! clear_string_option(&buf->b_p_tags); + break; + #ifdef FEAT_FIND_ID + case PV_DEF: +! clear_string_option(&buf->b_p_def); + break; + case PV_INC: +! clear_string_option(&buf->b_p_inc); + break; + #endif + #ifdef FEAT_INS_EXPAND + case PV_DICT: +! clear_string_option(&buf->b_p_dict); + break; + case PV_TSR: +! clear_string_option(&buf->b_p_tsr); + break; + #endif + #ifdef FEAT_QUICKFIX + case PV_EFM: +! clear_string_option(&buf->b_p_efm); + break; + case PV_GP: +! clear_string_option(&buf->b_p_gp); + break; + case PV_MP: +! clear_string_option(&buf->b_p_mp); + break; + #endif + #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) + case PV_BEXPR: +! clear_string_option(&buf->b_p_bexpr); + break; + #endif + #if defined(FEAT_CRYPT) + case PV_CM: +! clear_string_option(&buf->b_p_cm); + break; + #endif + #ifdef FEAT_STL_OPT + case PV_STL: +! clear_string_option(&((win_T *)from)->w_p_stl); + break; + #endif + } +*** ../vim-7.3.928/src/version.c 2013-05-06 06:26:10.000000000 +0200 +--- src/version.c 2013-05-06 06:35:06.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 929, + /**/ + +-- +Microsoft: "Windows NT 4.0 now has the same user-interface as Windows 95" + Windows 95: "Press CTRL-ALT-DEL to reboot" +Windows NT 4.0: "Press CTRL-ALT-DEL to login" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.930 b/7.3.930 new file mode 100644 index 0000000..b2ba17c --- /dev/null +++ b/7.3.930 @@ -0,0 +1,46 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.930 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.930 +Problem: MSVC 2012 update is not recognized. +Solution: Update the version in the makefile. (Raymond Ko) +Files: src/Make_mvc.mak + + +*** ../vim-7.3.929/src/Make_mvc.mak 2013-05-06 04:21:35.000000000 +0200 +--- src/Make_mvc.mak 2013-05-07 05:08:08.000000000 +0200 +*************** +*** 416,421 **** +--- 416,424 ---- + !if "$(_NMAKE_VER)" == "11.00.51106.1" + MSVCVER = 11.0 + !endif ++ !if "$(_NMAKE_VER)" == "11.00.60315.1" ++ MSVCVER = 11.0 ++ !endif + !endif + + # Abort building VIM if version of VC is unrecognised. +*** ../vim-7.3.929/src/version.c 2013-05-06 06:45:42.000000000 +0200 +--- src/version.c 2013-05-07 05:09:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 930, + /**/ + +-- +Life would be so much easier if we could just look at the source code. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.931 b/7.3.931 new file mode 100644 index 0000000..bc96b7a --- /dev/null +++ b/7.3.931 @@ -0,0 +1,58 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.931 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.931 +Problem: No completion for :xmap and :smap. (Yukihiro Nakadaira) +Solution: Add the case statements. (Christian Brabandt) +Files: src/ex_docmd.c + + +*** ../vim-7.3.930/src/ex_docmd.c 2013-05-06 04:21:35.000000000 +0200 +--- src/ex_docmd.c 2013-05-07 05:15:26.000000000 +0200 +*************** +*** 3889,3894 **** +--- 3889,3896 ---- + case CMD_imap: case CMD_inoremap: + case CMD_cmap: case CMD_cnoremap: + case CMD_lmap: case CMD_lnoremap: ++ case CMD_smap: case CMD_snoremap: ++ case CMD_xmap: case CMD_xnoremap: + return set_context_in_map_cmd(xp, cmd, arg, forceit, + FALSE, FALSE, ea.cmdidx); + case CMD_unmap: +*************** +*** 3898,3903 **** +--- 3900,3907 ---- + case CMD_iunmap: + case CMD_cunmap: + case CMD_lunmap: ++ case CMD_sunmap: ++ case CMD_xunmap: + return set_context_in_map_cmd(xp, cmd, arg, forceit, + FALSE, TRUE, ea.cmdidx); + case CMD_abbreviate: case CMD_noreabbrev: +*** ../vim-7.3.930/src/version.c 2013-05-07 05:11:12.000000000 +0200 +--- src/version.c 2013-05-07 05:16:45.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 931, + /**/ + +-- +FIRST HEAD: All right! All right! We'll kill him first and then have tea and + biscuits. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.932 b/7.3.932 new file mode 100644 index 0000000..81ae1aa --- /dev/null +++ b/7.3.932 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.932 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.932 +Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) +Solution: Initialize the variable. +Files: src/option.c + + +*** ../vim-7.3.931/src/option.c 2013-05-06 06:45:42.000000000 +0200 +--- src/option.c 2013-05-08 01:32:25.000000000 +0200 +*************** +*** 8847,8853 **** + void *from; + { + int opt_idx; +! char_u *varp; + struct vimoption *p; + int r = 0; + +--- 8847,8853 ---- + void *from; + { + int opt_idx; +! char_u *varp = NULL; + struct vimoption *p; + int r = 0; + +*** ../vim-7.3.931/src/version.c 2013-05-07 05:18:15.000000000 +0200 +--- src/version.c 2013-05-11 13:44:04.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 932, + /**/ + +-- +Proverb: A nightingale that forgets the lyrics is a hummingbird. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.933 b/7.3.933 new file mode 100644 index 0000000..d76314b --- /dev/null +++ b/7.3.933 @@ -0,0 +1,163 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.933 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.933 +Problem: Ruby on Mac crashes due to GC failure. +Solution: Init the stack from main(). (Hiroshi Shirosaki) +Files: src/main.c, src/if_ruby.c, src/proto/if_ruby.pro + + +*** ../vim-7.3.932/src/main.c 2013-03-19 13:33:18.000000000 +0100 +--- src/main.c 2013-05-11 13:37:23.000000000 +0200 +*************** +*** 192,197 **** +--- 192,204 ---- + params.window_count = -1; + #endif + ++ #ifdef FEAT_RUBY ++ { ++ int ruby_stack_start; ++ vim_ruby_init((void *)&ruby_stack_start); ++ } ++ #endif ++ + #ifdef FEAT_TCL + vim_tcl_init(params.argv[0]); + #endif +*** ../vim-7.3.932/src/if_ruby.c 2013-05-06 04:21:35.000000000 +0200 +--- src/if_ruby.c 2013-05-11 13:37:23.000000000 +0200 +*************** +*** 144,149 **** +--- 144,150 ---- + #endif + + static int ruby_initialized = 0; ++ static void *ruby_stack_start; + static VALUE objtbl; + + static VALUE mVIM; +*************** +*** 226,231 **** +--- 227,233 ---- + # define rb_float_new dll_rb_float_new + # define rb_ary_new dll_rb_ary_new + # define rb_ary_push dll_rb_ary_push ++ # define ruby_init_stack dll_ruby_init_stack + #else + # define rb_str2cstr dll_rb_str2cstr + #endif +*************** +*** 250,256 **** + # define rb_enc_str_new dll_rb_enc_str_new + # define rb_sprintf dll_rb_sprintf + # define rb_require dll_rb_require +- # define ruby_init_stack dll_ruby_init_stack + # define ruby_process_options dll_ruby_process_options + #endif + +--- 252,257 ---- +*************** +*** 335,340 **** +--- 336,342 ---- + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); ++ static void (*ruby_init_stack)(VALUE*); + #endif + #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); +*************** +*** 347,353 **** + static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*); + static VALUE (*dll_rb_sprintf) (const char*, ...); + static VALUE (*dll_rb_require) (const char*); +- static void (*ruby_init_stack)(VALUE*); + static void* (*ruby_process_options)(int, char**); + #endif + +--- 349,354 ---- +*************** +*** 475,480 **** +--- 476,482 ---- + #endif + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, ++ {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, + # if DYNAMIC_RUBY_VER <= 19 + {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, + # else +*************** +*** 491,497 **** + {"rb_enc_str_new", (RUBY_PROC*)&dll_rb_enc_str_new}, + {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, + {"rb_require", (RUBY_PROC*)&dll_rb_require}, +- {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, + {"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options}, + #endif + {"", NULL}, +--- 493,498 ---- +*************** +*** 716,723 **** + NtInitialize(&argc, &argv); + #endif + { +! #ifdef RUBY19_OR_LATER +! RUBY_INIT_STACK; + #endif + ruby_init(); + } +--- 717,724 ---- + NtInitialize(&argc, &argv); + #endif + { +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +! ruby_init_stack(ruby_stack_start); + #endif + ruby_init(); + } +*************** +*** 1389,1391 **** +--- 1390,1398 ---- + rb_define_virtual_variable("$curbuf", buffer_s_current, 0); + rb_define_virtual_variable("$curwin", window_s_current, 0); + } ++ ++ void vim_ruby_init(void *stack_start) ++ { ++ /* should get machine stack start address early in main function */ ++ ruby_stack_start = stack_start; ++ } +*** ../vim-7.3.932/src/proto/if_ruby.pro 2010-08-15 21:57:28.000000000 +0200 +--- src/proto/if_ruby.pro 2013-05-11 13:37:28.000000000 +0200 +*************** +*** 6,9 **** +--- 6,10 ---- + void ex_rubyfile __ARGS((exarg_T *eap)); + void ruby_buffer_free __ARGS((buf_T *buf)); + void ruby_window_free __ARGS((win_T *win)); ++ void vim_ruby_init __ARGS((void *stack_start)); + /* vim: set ft=c : */ +*** ../vim-7.3.932/src/version.c 2013-05-11 13:45:00.000000000 +0200 +--- src/version.c 2013-05-11 13:52:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 933, + /**/ + +-- +Veni, Vidi, Video -- I came, I saw, I taped what I saw. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.934 b/7.3.934 new file mode 100644 index 0000000..d820f3c --- /dev/null +++ b/7.3.934 @@ -0,0 +1,81 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.934 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.934 +Problem: E381 and E380 make the user think nothing happened. +Solution: Display the message indicating what error list is now active. + (Christian Brabandt) +Files: src/quickfix.c + + +*** ../vim-7.3.933/src/quickfix.c 2013-05-06 04:21:35.000000000 +0200 +--- src/quickfix.c 2013-05-11 13:50:56.000000000 +0200 +*************** +*** 2085,2091 **** + if (qi->qf_curlist == 0) + { + EMSG(_("E380: At bottom of quickfix stack")); +! return; + } + --qi->qf_curlist; + } +--- 2085,2091 ---- + if (qi->qf_curlist == 0) + { + EMSG(_("E380: At bottom of quickfix stack")); +! break; + } + --qi->qf_curlist; + } +*************** +*** 2094,2106 **** + if (qi->qf_curlist >= qi->qf_listcount - 1) + { + EMSG(_("E381: At top of quickfix stack")); +! return; + } + ++qi->qf_curlist; + } + } + qf_msg(qi); +- + } + + static void +--- 2094,2105 ---- + if (qi->qf_curlist >= qi->qf_listcount - 1) + { + EMSG(_("E381: At top of quickfix stack")); +! break; + } + ++qi->qf_curlist; + } + } + qf_msg(qi); + } + + static void +*** ../vim-7.3.933/src/version.c 2013-05-11 13:56:12.000000000 +0200 +--- src/version.c 2013-05-11 15:46:36.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 934, + /**/ + +-- +"A mouse can be just as dangerous as a bullet or a bomb." + (US Representative Lamar Smith, R-Texas) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.935 b/7.3.935 new file mode 100644 index 0000000..fb14b74 --- /dev/null +++ b/7.3.935 @@ -0,0 +1,114 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.935 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.935 (after 7.3.933) +Problem: Init stack works differently on 64 bit systems. +Solution: Handle 64 bit systems and also static library. (Yukihiro + Nakadaira) +Files: src/if_ruby.c + + +*** ../vim-7.3.934/src/if_ruby.c 2013-05-11 13:56:12.000000000 +0200 +--- src/if_ruby.c 2013-05-11 17:31:55.000000000 +0200 +*************** +*** 227,233 **** + # define rb_float_new dll_rb_float_new + # define rb_ary_new dll_rb_ary_new + # define rb_ary_push dll_rb_ary_push +! # define ruby_init_stack dll_ruby_init_stack + #else + # define rb_str2cstr dll_rb_str2cstr + #endif +--- 227,239 ---- + # define rb_float_new dll_rb_float_new + # define rb_ary_new dll_rb_ary_new + # define rb_ary_push dll_rb_ary_push +! # ifdef __ia64 +! # define rb_ia64_bsp dll_rb_ia64_bsp +! # undef ruby_init_stack +! # define ruby_init_stack(addr) dll_ruby_init_stack((addr), rb_ia64_bsp()) +! # else +! # define ruby_init_stack dll_ruby_init_stack +! # endif + #else + # define rb_str2cstr dll_rb_str2cstr + #endif +*************** +*** 336,342 **** + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); +! static void (*ruby_init_stack)(VALUE*); + #endif + #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); +--- 342,353 ---- + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); +! # ifdef __ia64 +! static void * (*dll_rb_ia64_bsp) (void); +! static void (*dll_ruby_init_stack)(VALUE*, void*); +! # else +! static void (*dll_ruby_init_stack)(VALUE*); +! # endif + #endif + #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); +*************** +*** 476,481 **** +--- 487,495 ---- + #endif + #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, ++ # ifdef __ia64 ++ {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, ++ # endif + {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, + # if DYNAMIC_RUBY_VER <= 19 + {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, +*************** +*** 717,723 **** + NtInitialize(&argc, &argv); + #endif + { +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + ruby_init_stack(ruby_stack_start); + #endif + ruby_init(); +--- 731,737 ---- + NtInitialize(&argc, &argv); + #endif + { +! #if defined(RUBY_VERSION) && RUBY_VERSION >= 18 + ruby_init_stack(ruby_stack_start); + #endif + ruby_init(); +*** ../vim-7.3.934/src/version.c 2013-05-11 15:50:02.000000000 +0200 +--- src/version.c 2013-05-11 17:39:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 935, + /**/ + +-- +ARTHUR: Well, it doesn't matter. Will you go and tell your master that + Arthur from the Court of Camelot is here. +GUARD #1: Listen, in order to maintain air-speed velocity, a swallow + needs to beat its wings 43 times every second, right? +ARTHUR: Please! + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.936 b/7.3.936 new file mode 100644 index 0000000..964dae7 --- /dev/null +++ b/7.3.936 @@ -0,0 +1,661 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.936 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.936 (after 7.3.935) +Problem: Ruby 1.8: Missing piece for static linking on 64 bit systems. +Solution: Define ruby_init_stack() (Hiroshi Shirosaki) + Also fix preprocessor indents. +Files: src/if_ruby.c + + +*** ../vim-7.3.935/src/if_ruby.c 2013-05-11 17:45:45.000000000 +0200 +--- src/if_ruby.c 2013-05-12 00:09:18.000000000 +0200 +*************** +*** 158,265 **** + static void ruby_io_init(void); + static void ruby_vim_init(void); + +! #if defined(DYNAMIC_RUBY) || defined(PROTO) +! #ifdef PROTO +! # define HINSTANCE int /* for generating prototypes */ + #endif + + /* + * Wrapper defines + */ +! #define rb_assoc_new dll_rb_assoc_new +! #define rb_cObject (*dll_rb_cObject) +! #define rb_check_type dll_rb_check_type +! #define rb_class_path dll_rb_class_path +! #define rb_data_object_alloc dll_rb_data_object_alloc +! #define rb_define_class_under dll_rb_define_class_under +! #define rb_define_const dll_rb_define_const +! #define rb_define_global_function dll_rb_define_global_function +! #define rb_define_method dll_rb_define_method +! #define rb_define_module dll_rb_define_module +! #define rb_define_module_function dll_rb_define_module_function +! #define rb_define_singleton_method dll_rb_define_singleton_method +! #define rb_define_virtual_variable dll_rb_define_virtual_variable +! #define rb_stdout (*dll_rb_stdout) +! #define rb_eArgError (*dll_rb_eArgError) +! #define rb_eIndexError (*dll_rb_eIndexError) +! #define rb_eRuntimeError (*dll_rb_eRuntimeError) +! #define rb_eStandardError (*dll_rb_eStandardError) +! #define rb_eval_string_protect dll_rb_eval_string_protect +! #define rb_global_variable dll_rb_global_variable +! #define rb_hash_aset dll_rb_hash_aset +! #define rb_hash_new dll_rb_hash_new +! #define rb_inspect dll_rb_inspect +! #define rb_int2inum dll_rb_int2inum +! #if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */ +! #define rb_fix2int dll_rb_fix2int +! #define rb_num2int dll_rb_num2int +! #define rb_num2uint dll_rb_num2uint +! #endif +! #define rb_lastline_get dll_rb_lastline_get +! #define rb_lastline_set dll_rb_lastline_set +! #define rb_load_protect dll_rb_load_protect +! #ifndef RUBY19_OR_LATER +! #define rb_num2long dll_rb_num2long +! #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19 +! #define rb_num2ulong dll_rb_num2ulong +! #endif +! #define rb_obj_alloc dll_rb_obj_alloc +! #define rb_obj_as_string dll_rb_obj_as_string +! #define rb_obj_id dll_rb_obj_id +! #define rb_raise dll_rb_raise +! #define rb_str_cat dll_rb_str_cat +! #define rb_str_concat dll_rb_str_concat +! #define rb_str_new dll_rb_str_new +! #ifdef rb_str_new2 + /* Ruby may #define rb_str_new2 to use rb_str_new_cstr. */ +! # define need_rb_str_new_cstr 1 + /* Ruby's headers #define rb_str_new_cstr to make use of GCC's + * __builtin_constant_p extension. */ +! # undef rb_str_new_cstr +! # define rb_str_new_cstr dll_rb_str_new_cstr +! #else +! # define rb_str_new2 dll_rb_str_new2 +! #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +! # define rb_string_value dll_rb_string_value +! # define rb_string_value_ptr dll_rb_string_value_ptr +! # define rb_float_new dll_rb_float_new +! # define rb_ary_new dll_rb_ary_new +! # define rb_ary_push dll_rb_ary_push +! # ifdef __ia64 +! # define rb_ia64_bsp dll_rb_ia64_bsp +! # undef ruby_init_stack +! # define ruby_init_stack(addr) dll_ruby_init_stack((addr), rb_ia64_bsp()) + # else +! # define ruby_init_stack dll_ruby_init_stack + # endif +- #else +- # define rb_str2cstr dll_rb_str2cstr +- #endif +- #ifdef RUBY19_OR_LATER +- # define rb_errinfo dll_rb_errinfo +- #else +- # define ruby_errinfo (*dll_ruby_errinfo) +- #endif +- #define ruby_init dll_ruby_init +- #define ruby_init_loadpath dll_ruby_init_loadpath +- #ifdef WIN3264 +- # define NtInitialize dll_NtInitialize + # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +! # define rb_w32_snprintf dll_rb_w32_snprintf + # endif +- #endif + +! #ifdef RUBY19_OR_LATER +! # define ruby_script dll_ruby_script +! # define rb_enc_find_index dll_rb_enc_find_index +! # define rb_enc_find dll_rb_enc_find +! # define rb_enc_str_new dll_rb_enc_str_new +! # define rb_sprintf dll_rb_sprintf +! # define rb_require dll_rb_require +! # define ruby_process_options dll_ruby_process_options +! #endif + + /* + * Pointers for dynamic link +--- 158,269 ---- + static void ruby_io_init(void); + static void ruby_vim_init(void); + +! #if defined(__ia64) && !defined(ruby_init_stack) +! # define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp()) + #endif + ++ #if defined(DYNAMIC_RUBY) || defined(PROTO) ++ # ifdef PROTO ++ # define HINSTANCE int /* for generating prototypes */ ++ # endif ++ + /* + * Wrapper defines + */ +! # define rb_assoc_new dll_rb_assoc_new +! # define rb_cObject (*dll_rb_cObject) +! # define rb_check_type dll_rb_check_type +! # define rb_class_path dll_rb_class_path +! # define rb_data_object_alloc dll_rb_data_object_alloc +! # define rb_define_class_under dll_rb_define_class_under +! # define rb_define_const dll_rb_define_const +! # define rb_define_global_function dll_rb_define_global_function +! # define rb_define_method dll_rb_define_method +! # define rb_define_module dll_rb_define_module +! # define rb_define_module_function dll_rb_define_module_function +! # define rb_define_singleton_method dll_rb_define_singleton_method +! # define rb_define_virtual_variable dll_rb_define_virtual_variable +! # define rb_stdout (*dll_rb_stdout) +! # define rb_eArgError (*dll_rb_eArgError) +! # define rb_eIndexError (*dll_rb_eIndexError) +! # define rb_eRuntimeError (*dll_rb_eRuntimeError) +! # define rb_eStandardError (*dll_rb_eStandardError) +! # define rb_eval_string_protect dll_rb_eval_string_protect +! # define rb_global_variable dll_rb_global_variable +! # define rb_hash_aset dll_rb_hash_aset +! # define rb_hash_new dll_rb_hash_new +! # define rb_inspect dll_rb_inspect +! # define rb_int2inum dll_rb_int2inum +! # if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */ +! # define rb_fix2int dll_rb_fix2int +! # define rb_num2int dll_rb_num2int +! # define rb_num2uint dll_rb_num2uint +! # endif +! # define rb_lastline_get dll_rb_lastline_get +! # define rb_lastline_set dll_rb_lastline_set +! # define rb_load_protect dll_rb_load_protect +! # ifndef RUBY19_OR_LATER +! # define rb_num2long dll_rb_num2long +! # endif +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER <= 19 +! # define rb_num2ulong dll_rb_num2ulong +! # endif +! # define rb_obj_alloc dll_rb_obj_alloc +! # define rb_obj_as_string dll_rb_obj_as_string +! # define rb_obj_id dll_rb_obj_id +! # define rb_raise dll_rb_raise +! # define rb_str_cat dll_rb_str_cat +! # define rb_str_concat dll_rb_str_concat +! # define rb_str_new dll_rb_str_new +! # ifdef rb_str_new2 + /* Ruby may #define rb_str_new2 to use rb_str_new_cstr. */ +! # define need_rb_str_new_cstr 1 + /* Ruby's headers #define rb_str_new_cstr to make use of GCC's + * __builtin_constant_p extension. */ +! # undef rb_str_new_cstr +! # define rb_str_new_cstr dll_rb_str_new_cstr + # else +! # define rb_str_new2 dll_rb_str_new2 + # endif + # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +! # define rb_string_value dll_rb_string_value +! # define rb_string_value_ptr dll_rb_string_value_ptr +! # define rb_float_new dll_rb_float_new +! # define rb_ary_new dll_rb_ary_new +! # define rb_ary_push dll_rb_ary_push +! # ifdef __ia64 +! # define rb_ia64_bsp dll_rb_ia64_bsp +! # undef ruby_init_stack +! # define ruby_init_stack(addr) dll_ruby_init_stack((addr), rb_ia64_bsp()) +! # else +! # define ruby_init_stack dll_ruby_init_stack +! # endif +! # else +! # define rb_str2cstr dll_rb_str2cstr +! # endif +! # ifdef RUBY19_OR_LATER +! # define rb_errinfo dll_rb_errinfo +! # else +! # define ruby_errinfo (*dll_ruby_errinfo) +! # endif +! # define ruby_init dll_ruby_init +! # define ruby_init_loadpath dll_ruby_init_loadpath +! # ifdef WIN3264 +! # define NtInitialize dll_NtInitialize +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 +! # define rb_w32_snprintf dll_rb_w32_snprintf +! # endif + # endif + +! # ifdef RUBY19_OR_LATER +! # define ruby_script dll_ruby_script +! # define rb_enc_find_index dll_rb_enc_find_index +! # define rb_enc_find dll_rb_enc_find +! # define rb_enc_str_new dll_rb_enc_str_new +! # define rb_sprintf dll_rb_sprintf +! # define rb_require dll_rb_require +! # define ruby_process_options dll_ruby_process_options +! # endif + + /* + * Pointers for dynamic link +*************** +*** 267,275 **** + static VALUE (*dll_rb_assoc_new) (VALUE, VALUE); + VALUE *dll_rb_cFalseClass; + VALUE *dll_rb_cFixnum; +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 + VALUE *dll_rb_cFloat; +! #endif + VALUE *dll_rb_cNilClass; + static VALUE *dll_rb_cObject; + VALUE *dll_rb_cSymbol; +--- 271,279 ---- + static VALUE (*dll_rb_assoc_new) (VALUE, VALUE); + VALUE *dll_rb_cFalseClass; + VALUE *dll_rb_cFixnum; +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 + VALUE *dll_rb_cFloat; +! # endif + VALUE *dll_rb_cNilClass; + static VALUE *dll_rb_cObject; + VALUE *dll_rb_cSymbol; +*************** +*** 296,306 **** + static VALUE (*dll_rb_hash_new) (void); + static VALUE (*dll_rb_inspect) (VALUE); + static VALUE (*dll_rb_int2inum) (long); +! #if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */ + static long (*dll_rb_fix2int) (VALUE); + static long (*dll_rb_num2int) (VALUE); + static unsigned long (*dll_rb_num2uint) (VALUE); +! #endif + static VALUE (*dll_rb_lastline_get) (void); + static void (*dll_rb_lastline_set) (VALUE); + static void (*dll_rb_load_protect) (VALUE, int, int*); +--- 300,310 ---- + static VALUE (*dll_rb_hash_new) (void); + static VALUE (*dll_rb_inspect) (VALUE); + static VALUE (*dll_rb_int2inum) (long); +! # if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */ + static long (*dll_rb_fix2int) (VALUE); + static long (*dll_rb_num2int) (VALUE); + static unsigned long (*dll_rb_num2uint) (VALUE); +! # endif + static VALUE (*dll_rb_lastline_get) (void); + static void (*dll_rb_lastline_set) (VALUE); + static void (*dll_rb_load_protect) (VALUE, int, int*); +*************** +*** 310,359 **** + static VALUE (*dll_rb_obj_as_string) (VALUE); + static VALUE (*dll_rb_obj_id) (VALUE); + static void (*dll_rb_raise) (VALUE, const char*, ...); +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static VALUE (*dll_rb_string_value) (volatile VALUE*); +! #else + static char *(*dll_rb_str2cstr) (VALUE,int*); +! #endif + static VALUE (*dll_rb_str_cat) (VALUE, const char*, long); + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); +! #ifdef need_rb_str_new_cstr + /* Ruby may #define rb_str_new2 to use rb_str_new_cstr. */ + static VALUE (*dll_rb_str_new_cstr) (const char*); +! #else + static VALUE (*dll_rb_str_new2) (const char*); +! #endif +! #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_errinfo) (void); +! #else + static VALUE *dll_ruby_errinfo; +! #endif + static void (*dll_ruby_init) (void); + static void (*dll_ruby_init_loadpath) (void); +! #ifdef WIN3264 + static void (*dll_NtInitialize) (int*, char***); +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); + # endif +! #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static char * (*dll_rb_string_value_ptr) (volatile VALUE*); + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); +! # ifdef __ia64 + static void * (*dll_rb_ia64_bsp) (void); + static void (*dll_ruby_init_stack)(VALUE*, void*); +! # else + static void (*dll_ruby_init_stack)(VALUE*); + # endif +! #endif +! #ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); +! #endif + +! #ifdef RUBY19_OR_LATER + static void (*dll_ruby_script) (const char*); + static int (*dll_rb_enc_find_index) (const char*); + static rb_encoding* (*dll_rb_enc_find) (const char*); +--- 314,363 ---- + static VALUE (*dll_rb_obj_as_string) (VALUE); + static VALUE (*dll_rb_obj_id) (VALUE); + static void (*dll_rb_raise) (VALUE, const char*, ...); +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static VALUE (*dll_rb_string_value) (volatile VALUE*); +! # else + static char *(*dll_rb_str2cstr) (VALUE,int*); +! # endif + static VALUE (*dll_rb_str_cat) (VALUE, const char*, long); + static VALUE (*dll_rb_str_concat) (VALUE, VALUE); + static VALUE (*dll_rb_str_new) (const char*, long); +! # ifdef need_rb_str_new_cstr + /* Ruby may #define rb_str_new2 to use rb_str_new_cstr. */ + static VALUE (*dll_rb_str_new_cstr) (const char*); +! # else + static VALUE (*dll_rb_str_new2) (const char*); +! # endif +! # ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_errinfo) (void); +! # else + static VALUE *dll_ruby_errinfo; +! # endif + static void (*dll_ruby_init) (void); + static void (*dll_ruby_init_loadpath) (void); +! # ifdef WIN3264 + static void (*dll_NtInitialize) (int*, char***); +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...); ++ # endif + # endif +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + static char * (*dll_rb_string_value_ptr) (volatile VALUE*); + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); +! # ifdef __ia64 + static void * (*dll_rb_ia64_bsp) (void); + static void (*dll_ruby_init_stack)(VALUE*, void*); +! # else + static void (*dll_ruby_init_stack)(VALUE*); ++ # endif + # endif +! # ifdef RUBY19_OR_LATER + static VALUE (*dll_rb_int2big)(SIGNED_VALUE); +! # endif + +! # ifdef RUBY19_OR_LATER + static void (*dll_ruby_script) (const char*); + static int (*dll_rb_enc_find_index) (const char*); + static rb_encoding* (*dll_rb_enc_find) (const char*); +*************** +*** 361,369 **** + static VALUE (*dll_rb_sprintf) (const char*, ...); + static VALUE (*dll_rb_require) (const char*); + static void* (*ruby_process_options)(int, char**); +! #endif + +! #if defined(RUBY19_OR_LATER) && !defined(PROTO) + SIGNED_VALUE rb_num2long_stub(VALUE x) + { + return dll_rb_num2long(x); +--- 365,373 ---- + static VALUE (*dll_rb_sprintf) (const char*, ...); + static VALUE (*dll_rb_require) (const char*); + static void* (*ruby_process_options)(int, char**); +! # endif + +! # if defined(RUBY19_OR_LATER) && !defined(PROTO) + SIGNED_VALUE rb_num2long_stub(VALUE x) + { + return dll_rb_num2long(x); +*************** +*** 372,378 **** + { + return dll_rb_int2big(x); + } +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 \ + && SIZEOF_INT < SIZEOF_LONG + long rb_fix2int_stub(VALUE x) + { +--- 376,382 ---- + { + return dll_rb_int2big(x); + } +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 \ + && SIZEOF_INT < SIZEOF_LONG + long rb_fix2int_stub(VALUE x) + { +*************** +*** 382,389 **** + { + return dll_rb_num2int(x); + } +! #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 + VALUE + rb_float_new_in_heap(double d) + { +--- 386,393 ---- + { + return dll_rb_num2int(x); + } +! # endif +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 + VALUE + rb_float_new_in_heap(double d) + { +*************** +*** 393,400 **** + { + return (long)RSHIFT((SIGNED_VALUE)(x),1); + } +! #endif +! #endif + + static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */ + +--- 397,404 ---- + { + return (long)RSHIFT((SIGNED_VALUE)(x),1); + } +! # endif +! # endif + + static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */ + +*************** +*** 410,418 **** + {"rb_assoc_new", (RUBY_PROC*)&dll_rb_assoc_new}, + {"rb_cFalseClass", (RUBY_PROC*)&dll_rb_cFalseClass}, + {"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum}, +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 + {"rb_cFloat", (RUBY_PROC*)&dll_rb_cFloat}, +! #endif + {"rb_cNilClass", (RUBY_PROC*)&dll_rb_cNilClass}, + {"rb_cObject", (RUBY_PROC*)&dll_rb_cObject}, + {"rb_cSymbol", (RUBY_PROC*)&dll_rb_cSymbol}, +--- 414,422 ---- + {"rb_assoc_new", (RUBY_PROC*)&dll_rb_assoc_new}, + {"rb_cFalseClass", (RUBY_PROC*)&dll_rb_cFalseClass}, + {"rb_cFixnum", (RUBY_PROC*)&dll_rb_cFixnum}, +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 20 + {"rb_cFloat", (RUBY_PROC*)&dll_rb_cFloat}, +! # endif + {"rb_cNilClass", (RUBY_PROC*)&dll_rb_cNilClass}, + {"rb_cObject", (RUBY_PROC*)&dll_rb_cObject}, + {"rb_cSymbol", (RUBY_PROC*)&dll_rb_cSymbol}, +*************** +*** 439,449 **** + {"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new}, + {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect}, + {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum}, +! #if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */ + {"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int}, + {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int}, + {"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint}, +! #endif + {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get}, + {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set}, + {"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect}, +--- 443,453 ---- + {"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new}, + {"rb_inspect", (RUBY_PROC*)&dll_rb_inspect}, + {"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum}, +! # if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */ + {"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int}, + {"rb_num2int", (RUBY_PROC*)&dll_rb_num2int}, + {"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint}, +! # endif + {"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get}, + {"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set}, + {"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect}, +*************** +*** 453,505 **** + {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, + {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, + {"rb_raise", (RUBY_PROC*)&dll_rb_raise}, +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value", (RUBY_PROC*)&dll_rb_string_value}, +! #else + {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr}, +! #endif + {"rb_str_cat", (RUBY_PROC*)&dll_rb_str_cat}, + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, +! #ifdef need_rb_str_new_cstr + {"rb_str_new_cstr", (RUBY_PROC*)&dll_rb_str_new_cstr}, +! #else + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, +! #endif +! #ifdef RUBY19_OR_LATER + {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, +! #else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, +! #endif + {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, + {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, +! #ifdef WIN3264 + { +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 + "NtInitialize", +! # else + "ruby_sysinit", +! # endif + (RUBY_PROC*)&dll_NtInitialize}, +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, + # endif +! #endif +! #if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, +! # ifdef __ia64 + {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, +! # endif + {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, +! # if DYNAMIC_RUBY_VER <= 19 + {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, +! # else + {"rb_float_new_in_heap", (RUBY_PROC*)&dll_rb_float_new}, +! # endif + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, +! #endif +! #ifdef RUBY19_OR_LATER + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, + {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, +--- 457,509 ---- + {"rb_obj_as_string", (RUBY_PROC*)&dll_rb_obj_as_string}, + {"rb_obj_id", (RUBY_PROC*)&dll_rb_obj_id}, + {"rb_raise", (RUBY_PROC*)&dll_rb_raise}, +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value", (RUBY_PROC*)&dll_rb_string_value}, +! # else + {"rb_str2cstr", (RUBY_PROC*)&dll_rb_str2cstr}, +! # endif + {"rb_str_cat", (RUBY_PROC*)&dll_rb_str_cat}, + {"rb_str_concat", (RUBY_PROC*)&dll_rb_str_concat}, + {"rb_str_new", (RUBY_PROC*)&dll_rb_str_new}, +! # ifdef need_rb_str_new_cstr + {"rb_str_new_cstr", (RUBY_PROC*)&dll_rb_str_new_cstr}, +! # else + {"rb_str_new2", (RUBY_PROC*)&dll_rb_str_new2}, +! # endif +! # ifdef RUBY19_OR_LATER + {"rb_errinfo", (RUBY_PROC*)&dll_rb_errinfo}, +! # else + {"ruby_errinfo", (RUBY_PROC*)&dll_ruby_errinfo}, +! # endif + {"ruby_init", (RUBY_PROC*)&dll_ruby_init}, + {"ruby_init_loadpath", (RUBY_PROC*)&dll_ruby_init_loadpath}, +! # ifdef WIN3264 + { +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 19 + "NtInitialize", +! # else + "ruby_sysinit", +! # endif + (RUBY_PROC*)&dll_NtInitialize}, +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_w32_snprintf", (RUBY_PROC*)&dll_rb_w32_snprintf}, ++ # endif + # endif +! # if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 18 + {"rb_string_value_ptr", (RUBY_PROC*)&dll_rb_string_value_ptr}, +! # ifdef __ia64 + {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp}, +! # endif + {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack}, +! # if DYNAMIC_RUBY_VER <= 19 + {"rb_float_new", (RUBY_PROC*)&dll_rb_float_new}, +! # else + {"rb_float_new_in_heap", (RUBY_PROC*)&dll_rb_float_new}, +! # endif + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, +! # endif +! # ifdef RUBY19_OR_LATER + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, + {"rb_enc_find_index", (RUBY_PROC*)&dll_rb_enc_find_index}, +*************** +*** 508,514 **** + {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, + {"rb_require", (RUBY_PROC*)&dll_rb_require}, + {"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options}, +! #endif + {"", NULL}, + }; + +--- 512,518 ---- + {"rb_sprintf", (RUBY_PROC*)&dll_rb_sprintf}, + {"rb_require", (RUBY_PROC*)&dll_rb_require}, + {"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options}, +! # endif + {"", NULL}, + }; + +*** ../vim-7.3.935/src/version.c 2013-05-11 17:45:45.000000000 +0200 +--- src/version.c 2013-05-12 14:09:22.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 936, + /**/ + +-- +DEAD PERSON: I don't want to go in the cart! +CUSTOMER: Oh, don't be such a baby. +MORTICIAN: I can't take him... +DEAD PERSON: I feel fine! +CUSTOMER: Oh, do us a favor... +MORTICIAN: I can't. + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.937 b/7.3.937 new file mode 100644 index 0000000..a9bd210 --- /dev/null +++ b/7.3.937 @@ -0,0 +1,616 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.937 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.937 +Problem: More can be shared between Python 2 and 3. +Solution: Move code to if_py_both.h. (ZyX) +Files: src/if_python.c, src/if_python3.c, src/if_py_both.h + + +*** ../vim-7.3.936/src/if_python.c 2013-05-06 04:21:35.000000000 +0200 +--- src/if_python.c 2013-05-12 18:31:20.000000000 +0200 +*************** +*** 619,624 **** +--- 619,627 ---- + + #define DESTRUCTOR_FINISH(self) Py_DECREF(self); + ++ #define WIN_PYTHON_REF(win) win->w_python_ref ++ #define BUF_PYTHON_REF(buf) buf->b_python_ref ++ + static PyObject *OutputGetattr(PyObject *, char *); + static PyObject *BufferGetattr(PyObject *, char *); + static PyObject *WindowGetattr(PyObject *, char *); +*************** +*** 1054,1095 **** + */ + + static PyObject * +- BufferNew(buf_T *buf) +- { +- /* We need to handle deletion of buffers underneath us. +- * If we add a "b_python_ref" field to the buf_T structure, +- * then we can get at it in buf_freeall() in vim. We then +- * need to create only ONE Python object per buffer - if +- * we try to create a second, just INCREF the existing one +- * and return it. The (single) Python object referring to +- * the buffer is stored in "b_python_ref". +- * Question: what to do on a buf_freeall(). We'll probably +- * have to either delete the Python object (DECREF it to +- * zero - a bad idea, as it leaves dangling refs!) or +- * set the buf_T * value to an invalid value (-1?), which +- * means we need checks in all access functions... Bah. +- */ +- +- BufferObject *self; +- +- if (buf->b_python_ref != NULL) +- { +- self = buf->b_python_ref; +- Py_INCREF(self); +- } +- else +- { +- self = PyObject_NEW(BufferObject, &BufferType); +- if (self == NULL) +- return NULL; +- self->buf = buf; +- buf->b_python_ref = self; +- } +- +- return (PyObject *)(self); +- } +- +- static PyObject * + BufferGetattr(PyObject *self, char *name) + { + PyObject *r; +--- 1057,1062 ---- +*************** +*** 1107,1136 **** + /******************/ + + static PyInt +- BufferLength(PyObject *self) +- { +- /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */ +- if (CheckBuffer((BufferObject *)(self))) +- return -1; /* ??? */ +- +- return (((BufferObject *)(self))->buf->b_ml.ml_line_count); +- } +- +- static PyObject * +- BufferItem(PyObject *self, PyInt n) +- { +- return RBItem((BufferObject *)(self), n, 1, +- (int)((BufferObject *)(self))->buf->b_ml.ml_line_count); +- } +- +- static PyObject * +- BufferSlice(PyObject *self, PyInt lo, PyInt hi) +- { +- return RBSlice((BufferObject *)(self), lo, hi, 1, +- (int)((BufferObject *)(self))->buf->b_ml.ml_line_count); +- } +- +- static PyInt + BufferAssItem(PyObject *self, PyInt n, PyObject *val) + { + return RBAsItem((BufferObject *)(self), n, val, 1, +--- 1074,1079 ---- +*************** +*** 1217,1256 **** + */ + + static PyObject * +- WindowNew(win_T *win) +- { +- /* We need to handle deletion of windows underneath us. +- * If we add a "w_python_ref" field to the win_T structure, +- * then we can get at it in win_free() in vim. We then +- * need to create only ONE Python object per window - if +- * we try to create a second, just INCREF the existing one +- * and return it. The (single) Python object referring to +- * the window is stored in "w_python_ref". +- * On a win_free() we set the Python object's win_T* field +- * to an invalid value. We trap all uses of a window +- * object, and reject them if the win_T* field is invalid. +- */ +- +- WindowObject *self; +- +- if (win->w_python_ref) +- { +- self = win->w_python_ref; +- Py_INCREF(self); +- } +- else +- { +- self = PyObject_NEW(WindowObject, &WindowType); +- if (self == NULL) +- return NULL; +- self->win = win; +- win->w_python_ref = self; +- } +- +- return (PyObject *)(self); +- } +- +- static PyObject * + WindowGetattr(PyObject *self, char *name) + { + PyObject *r; +--- 1160,1165 ---- +*************** +*** 1289,1299 **** + void + python_buffer_free(buf_T *buf) + { +! if (buf->b_python_ref != NULL) + { +! BufferObject *bp = buf->b_python_ref; + bp->buf = INVALID_BUFFER_VALUE; +! buf->b_python_ref = NULL; + } + } + +--- 1198,1208 ---- + void + python_buffer_free(buf_T *buf) + { +! if (BUF_PYTHON_REF(buf) != NULL) + { +! BufferObject *bp = BUF_PYTHON_REF(buf); + bp->buf = INVALID_BUFFER_VALUE; +! BUF_PYTHON_REF(buf) = NULL; + } + } + +*************** +*** 1301,1311 **** + void + python_window_free(win_T *win) + { +! if (win->w_python_ref != NULL) + { +! WindowObject *wp = win->w_python_ref; + wp->win = INVALID_WINDOW_VALUE; +! win->w_python_ref = NULL; + } + } + #endif +--- 1210,1220 ---- + void + python_window_free(win_T *win) + { +! if (WIN_PYTHON_REF(win) != NULL) + { +! WindowObject *wp = WIN_PYTHON_REF(win); + wp->win = INVALID_WINDOW_VALUE; +! WIN_PYTHON_REF(win) = NULL; + } + } + #endif +*** ../vim-7.3.936/src/if_python3.c 2013-05-06 04:21:35.000000000 +0200 +--- src/if_python3.c 2013-05-12 18:31:20.000000000 +0200 +*************** +*** 621,626 **** +--- 621,629 ---- + + #define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self); + ++ #define WIN_PYTHON_REF(win) win->w_python3_ref ++ #define BUF_PYTHON_REF(buf) buf->b_python3_ref ++ + static void + call_PyObject_Free(void *p) + { +*************** +*** 1067,1112 **** + }; + + +! /* Buffer object - Definitions + */ + + static PyObject * +- BufferNew(buf_T *buf) +- { +- /* We need to handle deletion of buffers underneath us. +- * If we add a "b_python3_ref" field to the buf_T structure, +- * then we can get at it in buf_freeall() in vim. We then +- * need to create only ONE Python object per buffer - if +- * we try to create a second, just INCREF the existing one +- * and return it. The (single) Python object referring to +- * the buffer is stored in "b_python3_ref". +- * Question: what to do on a buf_freeall(). We'll probably +- * have to either delete the Python object (DECREF it to +- * zero - a bad idea, as it leaves dangling refs!) or +- * set the buf_T * value to an invalid value (-1?), which +- * means we need checks in all access functions... Bah. +- */ +- +- BufferObject *self; +- +- if (buf->b_python3_ref != NULL) +- { +- self = buf->b_python3_ref; +- Py_INCREF(self); +- } +- else +- { +- self = PyObject_NEW(BufferObject, &BufferType); +- buf->b_python3_ref = self; +- if (self == NULL) +- return NULL; +- self->buf = buf; +- } +- +- return (PyObject *)(self); +- } +- +- static PyObject * + BufferGetattro(PyObject *self, PyObject*nameobj) + { + PyObject *r; +--- 1070,1079 ---- + }; + + +! /* Buffer object + */ + + static PyObject * + BufferGetattro(PyObject *self, PyObject*nameobj) + { + PyObject *r; +*************** +*** 1132,1160 **** + + /******************/ + +- static Py_ssize_t +- BufferLength(PyObject *self) +- { +- if (CheckBuffer((BufferObject *)(self))) +- return -1; +- +- return (Py_ssize_t)(((BufferObject *)(self))->buf->b_ml.ml_line_count); +- } +- +- static PyObject * +- BufferItem(PyObject *self, Py_ssize_t n) +- { +- return RBItem((BufferObject *)(self), n, 1, +- (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count); +- } +- +- static PyObject * +- BufferSlice(PyObject *self, Py_ssize_t lo, Py_ssize_t hi) +- { +- return RBSlice((BufferObject *)(self), lo, hi, 1, +- (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count); +- } +- + static PyObject * + BufferSubscript(PyObject *self, PyObject* idx) + { +--- 1099,1104 ---- +*************** +*** 1342,1381 **** + */ + + static PyObject * +- WindowNew(win_T *win) +- { +- /* We need to handle deletion of windows underneath us. +- * If we add a "w_python3_ref" field to the win_T structure, +- * then we can get at it in win_free() in vim. We then +- * need to create only ONE Python object per window - if +- * we try to create a second, just INCREF the existing one +- * and return it. The (single) Python object referring to +- * the window is stored in "w_python3_ref". +- * On a win_free() we set the Python object's win_T* field +- * to an invalid value. We trap all uses of a window +- * object, and reject them if the win_T* field is invalid. +- */ +- +- WindowObject *self; +- +- if (win->w_python3_ref) +- { +- self = win->w_python3_ref; +- Py_INCREF(self); +- } +- else +- { +- self = PyObject_NEW(WindowObject, &WindowType); +- if (self == NULL) +- return NULL; +- self->win = win; +- win->w_python3_ref = self; +- } +- +- return (PyObject *)(self); +- } +- +- static PyObject * + WindowGetattro(PyObject *self, PyObject *nameobj) + { + PyObject *r; +--- 1286,1291 ---- +*************** +*** 1575,1585 **** + void + python3_buffer_free(buf_T *buf) + { +! if (buf->b_python3_ref != NULL) + { +! BufferObject *bp = buf->b_python3_ref; + bp->buf = INVALID_BUFFER_VALUE; +! buf->b_python3_ref = NULL; + } + } + +--- 1485,1495 ---- + void + python3_buffer_free(buf_T *buf) + { +! if (BUF_PYTHON_REF(buf) != NULL) + { +! BufferObject *bp = BUF_PYTHON_REF(buf); + bp->buf = INVALID_BUFFER_VALUE; +! BUF_PYTHON_REF(buf) = NULL; + } + } + +*************** +*** 1587,1597 **** + void + python3_window_free(win_T *win) + { +! if (win->w_python3_ref != NULL) + { +! WindowObject *wp = win->w_python3_ref; + wp->win = INVALID_WINDOW_VALUE; +! win->w_python3_ref = NULL; + } + } + #endif +--- 1497,1507 ---- + void + python3_window_free(win_T *win) + { +! if (WIN_PYTHON_REF(win) != NULL) + { +! WindowObject *wp = WIN_PYTHON_REF(win); + wp->win = INVALID_WINDOW_VALUE; +! WIN_PYTHON_REF(win) = NULL; + } + } + #endif +*** ../vim-7.3.936/src/if_py_both.h 2013-05-06 06:26:10.000000000 +0200 +--- src/if_py_both.h 2013-05-12 18:31:20.000000000 +0200 +*************** +*** 1782,1792 **** +--- 1782,1832 ---- + return 0; + } + ++ /* Window object ++ */ ++ + static int WindowSetattr(PyObject *, char *, PyObject *); + static PyObject *WindowRepr(PyObject *); + static PyTypeObject WindowType; + + static PyObject * ++ WindowNew(win_T *win) ++ { ++ /* We need to handle deletion of windows underneath us. ++ * If we add a "w_python*_ref" field to the win_T structure, ++ * then we can get at it in win_free() in vim. We then ++ * need to create only ONE Python object per window - if ++ * we try to create a second, just INCREF the existing one ++ * and return it. The (single) Python object referring to ++ * the window is stored in "w_python*_ref". ++ * On a win_free() we set the Python object's win_T* field ++ * to an invalid value. We trap all uses of a window ++ * object, and reject them if the win_T* field is invalid. ++ * ++ * Python2 and Python3 get different fields and different objects: ++ * w_python_ref and w_python3_ref fields respectively. ++ */ ++ ++ WindowObject *self; ++ ++ if (WIN_PYTHON_REF(win)) ++ { ++ self = WIN_PYTHON_REF(win); ++ Py_INCREF(self); ++ } ++ else ++ { ++ self = PyObject_NEW(WindowObject, &WindowType); ++ if (self == NULL) ++ return NULL; ++ self->win = win; ++ WIN_PYTHON_REF(win) = self; ++ } ++ ++ return (PyObject *)(self); ++ } ++ ++ static PyObject * + WindowAttr(WindowObject *this, char *name) + { + if (strcmp(name, "buffer") == 0) +*************** +*** 1809,1815 **** + return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, + (PyObject *) this); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sssss]", "buffer", "cursor", "height", "vars", + "options"); + else + return NULL; +--- 1849,1855 ---- + return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, + (PyObject *) this); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars", + "options"); + else + return NULL; +*************** +*** 1821,1831 **** + WindowObject *this = (WindowObject *)(self); + + if (this->win && this->win != INVALID_WINDOW_VALUE) +! #if PY_MAJOR_VERSION >= 3 +! this->win->w_python3_ref = NULL; +! #else +! this->win->w_python_ref = NULL; +! #endif + + DESTRUCTOR_FINISH(self); + } +--- 1861,1867 ---- + WindowObject *this = (WindowObject *)(self); + + if (this->win && this->win != INVALID_WINDOW_VALUE) +! WIN_PYTHON_REF(this->win) = NULL; + + DESTRUCTOR_FINISH(self); + } +*************** +*** 2756,2771 **** + BufferObject *this = (BufferObject *)(self); + + if (this->buf && this->buf != INVALID_BUFFER_VALUE) +! #if PY_MAJOR_VERSION >= 3 +! this->buf->b_python3_ref = NULL; +! #else +! this->buf->b_python_ref = NULL; +! #endif + + DESTRUCTOR_FINISH(self); + } + + static PyObject * + BufferAttr(BufferObject *this, char *name) + { + if (strcmp(name, "name") == 0) +--- 2792,2842 ---- + BufferObject *this = (BufferObject *)(self); + + if (this->buf && this->buf != INVALID_BUFFER_VALUE) +! BUF_PYTHON_REF(this->buf) = NULL; + + DESTRUCTOR_FINISH(self); + } + + static PyObject * ++ BufferNew(buf_T *buf) ++ { ++ /* We need to handle deletion of buffers underneath us. ++ * If we add a "b_python*_ref" field to the buf_T structure, ++ * then we can get at it in buf_freeall() in vim. We then ++ * need to create only ONE Python object per buffer - if ++ * we try to create a second, just INCREF the existing one ++ * and return it. The (single) Python object referring to ++ * the buffer is stored in "b_python*_ref". ++ * Question: what to do on a buf_freeall(). We'll probably ++ * have to either delete the Python object (DECREF it to ++ * zero - a bad idea, as it leaves dangling refs!) or ++ * set the buf_T * value to an invalid value (-1?), which ++ * means we need checks in all access functions... Bah. ++ * ++ * Python2 and Python3 get different fields and different objects: ++ * b_python_ref and b_python3_ref fields respectively. ++ */ ++ ++ BufferObject *self; ++ ++ if (BUF_PYTHON_REF(buf) != NULL) ++ { ++ self = BUF_PYTHON_REF(buf); ++ Py_INCREF(self); ++ } ++ else ++ { ++ self = PyObject_NEW(BufferObject, &BufferType); ++ if (self == NULL) ++ return NULL; ++ self->buf = buf; ++ BUF_PYTHON_REF(buf) = self; ++ } ++ ++ return (PyObject *)(self); ++ } ++ ++ static PyObject * + BufferAttr(BufferObject *this, char *name) + { + if (strcmp(name, "name") == 0) +*************** +*** 2783,2788 **** +--- 2854,2883 ---- + return NULL; + } + ++ static PyInt ++ BufferLength(PyObject *self) ++ { ++ /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */ ++ if (CheckBuffer((BufferObject *)(self))) ++ return -1; /* ??? */ ++ ++ return (PyInt)(((BufferObject *)(self))->buf->b_ml.ml_line_count); ++ } ++ ++ static PyObject * ++ BufferItem(PyObject *self, PyInt n) ++ { ++ return RBItem((BufferObject *)(self), n, 1, ++ (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count); ++ } ++ ++ static PyObject * ++ BufferSlice(PyObject *self, PyInt lo, PyInt hi) ++ { ++ return RBSlice((BufferObject *)(self), lo, hi, 1, ++ (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count); ++ } ++ + static PyObject * + BufferAppend(PyObject *self, PyObject *args) + { +*** ../vim-7.3.936/src/version.c 2013-05-12 14:10:41.000000000 +0200 +--- src/version.c 2013-05-12 18:44:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 937, + /**/ + +-- +ARTHUR: Well, I can't just call you `Man'. +DENNIS: Well, you could say `Dennis'. +ARTHUR: Well, I didn't know you were called `Dennis.' +DENNIS: Well, you didn't bother to find out, did you? + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.938 b/7.3.938 new file mode 100644 index 0000000..df8d37a --- /dev/null +++ b/7.3.938 @@ -0,0 +1,145 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.938 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.938 +Problem: Python: not easy to get to window number. +Solution: Add vim.window.number. (ZyX) +Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/proto/window.pro, + src/window.c + + +*** ../vim-7.3.937/runtime/doc/if_pyth.txt 2013-05-06 03:52:44.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-05-12 18:55:41.000000000 +0200 +*************** +*** 396,401 **** +--- 396,405 ---- + |python-options|. If option is |global-local| + and local value is missing getting it will + return None. ++ number (read-only) Window number. The first window has number 1. ++ This is zero in case it cannot be determined ++ (e.g. when the window object belongs to other ++ tab page). + The height attribute is writable only if the screen is split horizontally. + The width attribute is writable only if the screen is split vertically. + +*** ../vim-7.3.937/src/if_py_both.h 2013-05-12 18:44:44.000000000 +0200 +--- src/if_py_both.h 2013-05-12 18:48:07.000000000 +0200 +*************** +*** 1848,1856 **** + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, + (PyObject *) this); + else if (strcmp(name,"__members__") == 0) + return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars", +! "options"); + else + return NULL; + } +--- 1848,1858 ---- + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow, + (PyObject *) this); ++ else if (strcmp(name, "number") == 0) ++ return PyLong_FromLong((long) get_win_number(this->win)); + else if (strcmp(name,"__members__") == 0) + return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars", +! "options", "number"); + else + return NULL; + } +*************** +*** 1974,1990 **** + } + else + { +! int i = 0; +! win_T *w; + +! for (w = firstwin; w != NULL && w != this->win; w = W_NEXT(w)) +! ++i; +! +! if (w == NULL) + vim_snprintf(repr, 100, _(""), + (self)); + else +! vim_snprintf(repr, 100, _(""), i); + + return PyString_FromString(repr); + } +--- 1976,1988 ---- + } + else + { +! int w = get_win_number(this->win); + +! if (w == 0) + vim_snprintf(repr, 100, _(""), + (self)); + else +! vim_snprintf(repr, 100, _(""), w - 1); + + return PyString_FromString(repr); + } +*** ../vim-7.3.937/src/proto/window.pro 2013-05-06 04:50:26.000000000 +0200 +--- src/proto/window.pro 2013-05-12 18:48:07.000000000 +0200 +*************** +*** 74,77 **** +--- 74,78 ---- + int match_delete __ARGS((win_T *wp, int id, int perr)); + void clear_matches __ARGS((win_T *wp)); + matchitem_T *get_match __ARGS((win_T *wp, int id)); ++ int get_win_number __ARGS((win_T *wp)); + /* vim: set ft=c : */ +*** ../vim-7.3.937/src/window.c 2013-05-06 04:50:26.000000000 +0200 +--- src/window.c 2013-05-12 18:48:07.000000000 +0200 +*************** +*** 6731,6733 **** +--- 6731,6750 ---- + return cur; + } + #endif ++ ++ #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO) ++ int ++ get_win_number(win_T *wp) ++ { ++ int i = 1; ++ win_T *w; ++ ++ for (w = firstwin; w != NULL && w != wp; w = W_NEXT(w)) ++ ++i; ++ ++ if (w == NULL) ++ return 0; ++ else ++ return i; ++ } ++ #endif +*** ../vim-7.3.937/src/version.c 2013-05-12 18:44:44.000000000 +0200 +--- src/version.c 2013-05-12 18:52:29.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 938, + /**/ + +-- +ARTHUR: I did say sorry about the `old woman,' but from the behind you + looked-- +DENNIS: What I object to is you automatically treat me like an inferior! +ARTHUR: Well, I AM king... + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.939 b/7.3.939 new file mode 100644 index 0000000..3b8b716 --- /dev/null +++ b/7.3.939 @@ -0,0 +1,60 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.939 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.939 +Problem: Using Py_BuildValue is inefficient sometimes. +Solution: Use PyLong_FromLong(). (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.938/src/if_py_both.h 2013-05-12 19:00:36.000000000 +0200 +--- src/if_py_both.h 2013-05-12 19:08:24.000000000 +0200 +*************** +*** 1838,1847 **** + return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); + } + else if (strcmp(name, "height") == 0) +! return Py_BuildValue("l", (long)(this->win->w_height)); + #ifdef FEAT_VERTSPLIT + else if (strcmp(name, "width") == 0) +! return Py_BuildValue("l", (long)(W_WIDTH(this->win))); + #endif + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->win->w_vars); +--- 1838,1847 ---- + return Py_BuildValue("(ll)", (long)(pos->lnum), (long)(pos->col)); + } + else if (strcmp(name, "height") == 0) +! return PyLong_FromLong((long)(this->win->w_height)); + #ifdef FEAT_VERTSPLIT + else if (strcmp(name, "width") == 0) +! return PyLong_FromLong((long)(W_WIDTH(this->win))); + #endif + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->win->w_vars); +*** ../vim-7.3.938/src/version.c 2013-05-12 19:00:36.000000000 +0200 +--- src/version.c 2013-05-12 19:09:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 939, + /**/ + +-- +A mathematician is a device for turning coffee into theorems. + Paul Erdos +A computer programmer is a device for turning coffee into bugs. + Bram Moolenaar + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.940 b/7.3.940 new file mode 100644 index 0000000..07209b0 --- /dev/null +++ b/7.3.940 @@ -0,0 +1,87 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.940 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.940 +Problem: Python: Can't get position of window. +Solution: Add window.row and window.col. (ZyX) +Files: runtime/doc/if_pyth.txt, src/if_py_both.h + + +*** ../vim-7.3.939/runtime/doc/if_pyth.txt 2013-05-12 19:00:36.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-05-12 19:24:40.000000000 +0200 +*************** +*** 400,405 **** +--- 400,408 ---- + This is zero in case it cannot be determined + (e.g. when the window object belongs to other + tab page). ++ row, col (read-only) On-screen window position in display cells. ++ First position is zero. ++ + The height attribute is writable only if the screen is split horizontally. + The width attribute is writable only if the screen is split vertically. + +*** ../vim-7.3.939/src/if_py_both.h 2013-05-12 19:09:46.000000000 +0200 +--- src/if_py_both.h 2013-05-12 19:22:16.000000000 +0200 +*************** +*** 1839,1847 **** +--- 1839,1853 ---- + } + else if (strcmp(name, "height") == 0) + return PyLong_FromLong((long)(this->win->w_height)); ++ #ifdef FEAT_WINDOWS ++ else if (strcmp(name, "row") == 0) ++ return PyLong_FromLong((long)(this->win->w_winrow)); ++ #endif + #ifdef FEAT_VERTSPLIT + else if (strcmp(name, "width") == 0) + return PyLong_FromLong((long)(W_WIDTH(this->win))); ++ else if (strcmp(name, "col") == 0) ++ return PyLong_FromLong((long)(W_WINCOL(this->win))); + #endif + else if (strcmp(name, "vars") == 0) + return DictionaryNew(this->win->w_vars); +*************** +*** 1851,1858 **** + else if (strcmp(name, "number") == 0) + return PyLong_FromLong((long) get_win_number(this->win)); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssssss]", "buffer", "cursor", "height", "vars", +! "options", "number"); + else + return NULL; + } +--- 1857,1864 ---- + else if (strcmp(name, "number") == 0) + return PyLong_FromLong((long) get_win_number(this->win)); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssssssss]", "buffer", "cursor", "height", "vars", +! "options", "number", "row", "col"); + else + return NULL; + } +*** ../vim-7.3.939/src/version.c 2013-05-12 19:09:46.000000000 +0200 +--- src/version.c 2013-05-12 19:23:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 940, + /**/ + +-- +A computer programmer is a device for turning requirements into +undocumented features. It runs on cola, pizza and Dilbert cartoons. + Bram Moolenaar + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.941 b/7.3.941 new file mode 100644 index 0000000..c7792aa --- /dev/null +++ b/7.3.941 @@ -0,0 +1,1456 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.941 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.941 +Problem: Stuff in if_py_both.h is ordered badly. +Solution: Reorder by type. (ZyX) +Files: src/if_py_both.h, src/if_python.c + + +*** ../vim-7.3.940/src/if_py_both.h 2013-05-12 19:30:27.000000000 +0200 +--- src/if_py_both.h 2013-05-12 19:36:38.000000000 +0200 +*************** +*** 7,13 **** + * See README.txt for an overview of the Vim source code. + */ + /* +! * Python extensions by Paul Moore, David Leonard, Roland Puntaier. + * + * Common code for if_python.c and if_python3.c. + */ +--- 7,14 ---- + * See README.txt for an overview of the Vim source code. + */ + /* +! * Python extensions by Paul Moore, David Leonard, Roland Puntaier, Nikolay +! * Pavlov. + * + * Common code for if_python.c and if_python3.c. + */ +*************** +*** 22,27 **** +--- 23,39 ---- + # define ENC_OPT "latin1" + #endif + ++ #define PyErr_SetVim(str) PyErr_SetString(VimError, str) ++ ++ #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) ++ #define INVALID_WINDOW_VALUE ((win_T *)(-1)) ++ ++ static int ConvertFromPyObject(PyObject *, typval_T *); ++ static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); ++ ++ static PyInt RangeStart; ++ static PyInt RangeEnd; ++ + /* + * obtain a lock on the Vim data structures + */ +*************** +*** 38,53 **** + { + } + +! /* Output object definition + */ + +- static PyObject *OutputWrite(PyObject *, PyObject *); +- static PyObject *OutputWritelines(PyObject *, PyObject *); +- static PyObject *OutputFlush(PyObject *, PyObject *); +- + /* Function to write a line, points to either msg() or emsg(). */ + typedef void (*writefn)(char_u *); +! static void writer(writefn fn, char_u *str, PyInt n); + + typedef struct + { +--- 50,62 ---- + { + } + +! /* Output buffer management + */ + + /* Function to write a line, points to either msg() or emsg(). */ + typedef void (*writefn)(char_u *); +! +! static PyTypeObject OutputType; + + typedef struct + { +*************** +*** 56,76 **** + long error; + } OutputObject; + +- static struct PyMethodDef OutputMethods[] = { +- /* name, function, calling, documentation */ +- {"write", OutputWrite, 1, ""}, +- {"writelines", OutputWritelines, 1, ""}, +- {"flush", OutputFlush, 1, ""}, +- { NULL, NULL, 0, NULL} +- }; +- +- #define PyErr_SetVim(str) PyErr_SetString(VimError, str) +- +- /*************/ +- +- /* Output buffer management +- */ +- + static int + OutputSetattr(PyObject *self, char *name, PyObject *val) + { +--- 65,70 ---- +*************** +*** 96,101 **** +--- 90,145 ---- + return -1; + } + ++ /* Buffer IO, we write one whole line at a time. */ ++ static garray_T io_ga = {0, 0, 1, 80, NULL}; ++ static writefn old_fn = NULL; ++ ++ static void ++ PythonIO_Flush(void) ++ { ++ if (old_fn != NULL && io_ga.ga_len > 0) ++ { ++ ((char_u *)io_ga.ga_data)[io_ga.ga_len] = NUL; ++ old_fn((char_u *)io_ga.ga_data); ++ } ++ io_ga.ga_len = 0; ++ } ++ ++ static void ++ writer(writefn fn, char_u *str, PyInt n) ++ { ++ char_u *ptr; ++ ++ /* Flush when switching output function. */ ++ if (fn != old_fn) ++ PythonIO_Flush(); ++ old_fn = fn; ++ ++ /* Write each NL separated line. Text after the last NL is kept for ++ * writing later. */ ++ while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL) ++ { ++ PyInt len = ptr - str; ++ ++ if (ga_grow(&io_ga, (int)(len + 1)) == FAIL) ++ break; ++ ++ mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)len); ++ ((char *)io_ga.ga_data)[io_ga.ga_len + len] = NUL; ++ fn((char_u *)io_ga.ga_data); ++ str = ptr + 1; ++ n -= len + 1; ++ io_ga.ga_len = 0; ++ } ++ ++ /* Put the remaining text into io_ga for later printing. */ ++ if (n > 0 && ga_grow(&io_ga, (int)(n + 1)) == OK) ++ { ++ mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)n); ++ io_ga.ga_len += (int)n; ++ } ++ } ++ + static PyObject * + OutputWrite(PyObject *self, PyObject *args) + { +*************** +*** 172,231 **** + return Py_None; + } + +- +- /* Buffer IO, we write one whole line at a time. */ +- static garray_T io_ga = {0, 0, 1, 80, NULL}; +- static writefn old_fn = NULL; +- +- static void +- PythonIO_Flush(void) +- { +- if (old_fn != NULL && io_ga.ga_len > 0) +- { +- ((char_u *)io_ga.ga_data)[io_ga.ga_len] = NUL; +- old_fn((char_u *)io_ga.ga_data); +- } +- io_ga.ga_len = 0; +- } +- +- static void +- writer(writefn fn, char_u *str, PyInt n) +- { +- char_u *ptr; +- +- /* Flush when switching output function. */ +- if (fn != old_fn) +- PythonIO_Flush(); +- old_fn = fn; +- +- /* Write each NL separated line. Text after the last NL is kept for +- * writing later. */ +- while (n > 0 && (ptr = memchr(str, '\n', n)) != NULL) +- { +- PyInt len = ptr - str; +- +- if (ga_grow(&io_ga, (int)(len + 1)) == FAIL) +- break; +- +- mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)len); +- ((char *)io_ga.ga_data)[io_ga.ga_len + len] = NUL; +- fn((char_u *)io_ga.ga_data); +- str = ptr + 1; +- n -= len + 1; +- io_ga.ga_len = 0; +- } +- +- /* Put the remaining text into io_ga for later printing. */ +- if (n > 0 && ga_grow(&io_ga, (int)(n + 1)) == OK) +- { +- mch_memmove(((char *)io_ga.ga_data) + io_ga.ga_len, str, (size_t)n); +- io_ga.ga_len += (int)n; +- } +- } +- + /***************/ + +! static PyTypeObject OutputType; + + static OutputObject Output = + { +--- 216,230 ---- + return Py_None; + } + + /***************/ + +! static struct PyMethodDef OutputMethods[] = { +! /* name, function, calling, documentation */ +! {"write", OutputWrite, 1, ""}, +! {"writelines", OutputWritelines, 1, ""}, +! {"flush", OutputFlush, 1, ""}, +! { NULL, NULL, 0, NULL} +! }; + + static OutputObject Output = + { +*************** +*** 281,286 **** +--- 280,286 ---- + + /* Vim module - Implementation + */ ++ + static PyObject * + VimCommand(PyObject *self UNUSED, PyObject *args) + { +*************** +*** 530,555 **** + { NULL, NULL, 0, NULL } + }; + +- typedef struct +- { +- PyObject_HEAD +- buf_T *buf; +- } BufferObject; +- +- #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) +- + /* + * Buffer list object - Implementation + */ + + typedef struct + { + PyObject_HEAD + } BufListObject; + +- static PyTypeObject BufListType; +- static PySequenceMethods WinListAsSeq; +- + static PyInt + BufListLength(PyObject *self UNUSED) + { +--- 530,547 ---- + { NULL, NULL, 0, NULL } + }; + + /* + * Buffer list object - Implementation + */ + ++ static PyTypeObject BufListType; ++ static PySequenceMethods BufListAsSeq; ++ + typedef struct + { + PyObject_HEAD + } BufListObject; + + static PyInt + BufListLength(PyObject *self UNUSED) + { +*************** +*** 580,599 **** + return NULL; + } + +- typedef struct +- { +- PyObject_HEAD +- win_T *win; +- } WindowObject; +- +- static struct PyMethodDef WindowMethods[] = { +- /* name, function, calling, documentation */ +- { NULL, NULL, 0, NULL } +- }; +- +- static int ConvertFromPyObject(PyObject *, typval_T *); +- static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); +- + typedef struct pylinkedlist_S { + struct pylinkedlist_S *pll_next; + struct pylinkedlist_S *pll_prev; +--- 572,577 ---- +*************** +*** 655,670 **** + pylinkedlist_T ref; + } DictionaryObject; + +- static PyInt DictionaryAssItem(PyObject *, PyObject *, PyObject *); +- static PyInt DictionaryLength(PyObject *); +- static PyObject *DictionaryItem(PyObject *, PyObject *); +- +- static PyMappingMethods DictionaryAsMapping = { +- (lenfunc) DictionaryLength, +- (binaryfunc) DictionaryItem, +- (objobjargproc) DictionaryAssItem, +- }; +- + static PyObject * + DictionaryNew(dict_T *dict) + { +--- 633,638 ---- +*************** +*** 693,895 **** + } + + static int +! pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { +! dict_T *d; +! char_u *key; +! dictitem_T *di; +! PyObject *keyObject; +! PyObject *valObject; +! Py_ssize_t iter = 0; + +! d = dict_alloc(); +! if (d == NULL) + { +! PyErr_NoMemory(); + return -1; + } + +! tv->v_type = VAR_DICT; +! tv->vval.v_dict = d; +! +! while (PyDict_Next(obj, &iter, &keyObject, &valObject)) + { +! DICTKEY_DECL +! +! if (keyObject == NULL) +! return -1; +! if (valObject == NULL) +! return -1; +! +! DICTKEY_GET_NOTEMPTY(-1) +! +! di = dictitem_alloc(key); +! +! DICTKEY_UNREF +! +! if (di == NULL) +! { +! PyErr_NoMemory(); +! return -1; +! } +! di->di_tv.v_lock = 0; +! +! if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) + { +! vim_free(di); + return -1; + } +! if (dict_add(d, di) == FAIL) + { +! vim_free(di); +! PyErr_SetVim(_("failed to add key to dictionary")); +! return -1; + } + } +- return 0; + } + +! static int +! pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { +- dict_T *d; + char_u *key; + dictitem_T *di; +! PyObject *list; +! PyObject *litem; +! PyObject *keyObject; +! PyObject *valObject; +! Py_ssize_t lsize; +! +! d = dict_alloc(); +! if (d == NULL) +! { +! PyErr_NoMemory(); +! return -1; +! } +! +! tv->v_type = VAR_DICT; +! tv->vval.v_dict = d; +! +! list = PyMapping_Items(obj); +! if (list == NULL) +! return -1; +! lsize = PyList_Size(list); +! while (lsize--) +! { +! DICTKEY_DECL +! +! litem = PyList_GetItem(list, lsize); +! if (litem == NULL) +! { +! Py_DECREF(list); +! return -1; +! } +! +! keyObject = PyTuple_GetItem(litem, 0); +! if (keyObject == NULL) +! { +! Py_DECREF(list); +! Py_DECREF(litem); +! return -1; +! } +! +! DICTKEY_GET_NOTEMPTY(-1) +! +! valObject = PyTuple_GetItem(litem, 1); +! if (valObject == NULL) +! { +! Py_DECREF(list); +! Py_DECREF(litem); +! return -1; +! } +! +! di = dictitem_alloc(key); +! +! DICTKEY_UNREF +! +! if (di == NULL) +! { +! Py_DECREF(list); +! Py_DECREF(litem); +! PyErr_NoMemory(); +! return -1; +! } +! di->di_tv.v_lock = 0; +! +! if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) +! { +! vim_free(di); +! Py_DECREF(list); +! Py_DECREF(litem); +! return -1; +! } +! if (dict_add(d, di) == FAIL) +! { +! vim_free(di); +! Py_DECREF(list); +! Py_DECREF(litem); +! PyErr_SetVim(_("failed to add key to dictionary")); +! return -1; +! } +! Py_DECREF(litem); +! } +! Py_DECREF(list); +! return 0; +! } +! +! static int +! DictionarySetattr(PyObject *self, char *name, PyObject *val) +! { +! DictionaryObject *this = (DictionaryObject *)(self); +! +! if (val == NULL) +! { +! PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); +! return -1; +! } +! +! if (strcmp(name, "locked") == 0) +! { +! if (this->dict->dv_lock == VAR_FIXED) +! { +! PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary")); +! return -1; +! } +! else +! { +! if (!PyBool_Check(val)) +! { +! PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed")); +! return -1; +! } +! +! if (val == Py_True) +! this->dict->dv_lock = VAR_LOCKED; +! else +! this->dict->dv_lock = 0; +! } +! return 0; +! } +! else +! { +! PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute")); +! return -1; +! } +! } +! +! static PyInt +! DictionaryLength(PyObject *self) +! { +! return ((PyInt) ((((DictionaryObject *)(self))->dict->dv_hashtab.ht_used))); +! } +! +! static PyObject * +! DictionaryItem(PyObject *self, PyObject *keyObject) +! { +! char_u *key; +! dictitem_T *di; +! DICTKEY_DECL + + DICTKEY_GET_NOTEMPTY(NULL) + +--- 661,717 ---- + } + + static int +! DictionarySetattr(PyObject *self, char *name, PyObject *val) + { +! DictionaryObject *this = (DictionaryObject *)(self); + +! if (val == NULL) + { +! PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); + return -1; + } + +! if (strcmp(name, "locked") == 0) + { +! if (this->dict->dv_lock == VAR_FIXED) + { +! PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary")); + return -1; + } +! else + { +! if (!PyBool_Check(val)) +! { +! PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed")); +! return -1; +! } +! +! if (val == Py_True) +! this->dict->dv_lock = VAR_LOCKED; +! else +! this->dict->dv_lock = 0; + } ++ return 0; ++ } ++ else ++ { ++ PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute")); ++ return -1; + } + } + +! static PyInt +! DictionaryLength(PyObject *self) +! { +! return ((PyInt) ((((DictionaryObject *)(self))->dict->dv_hashtab.ht_used))); +! } +! +! static PyObject * +! DictionaryItem(PyObject *self, PyObject *keyObject) + { + char_u *key; + dictitem_T *di; +! DICTKEY_DECL + + DICTKEY_GET_NOTEMPTY(NULL) + +*************** +*** 993,998 **** +--- 815,826 ---- + return r; + } + ++ static PyMappingMethods DictionaryAsMapping = { ++ (lenfunc) DictionaryLength, ++ (binaryfunc) DictionaryItem, ++ (objobjargproc) DictionaryAssItem, ++ }; ++ + static struct PyMethodDef DictionaryMethods[] = { + {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL } +*************** +*** 1065,1136 **** + return 0; + } + +- static int +- pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) +- { +- list_T *l; +- +- l = list_alloc(); +- if (l == NULL) +- { +- PyErr_NoMemory(); +- return -1; +- } +- +- tv->v_type = VAR_LIST; +- tv->vval.v_list = l; +- +- if (list_py_concat(l, obj, lookupDict) == -1) +- return -1; +- +- return 0; +- } +- +- static int +- pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) +- { +- PyObject *iterator = PyObject_GetIter(obj); +- PyObject *item; +- list_T *l; +- listitem_T *li; +- +- l = list_alloc(); +- +- if (l == NULL) +- { +- PyErr_NoMemory(); +- return -1; +- } +- +- tv->vval.v_list = l; +- tv->v_type = VAR_LIST; +- +- +- if (iterator == NULL) +- return -1; +- +- while ((item = PyIter_Next(obj))) +- { +- li = listitem_alloc(); +- if (li == NULL) +- { +- PyErr_NoMemory(); +- return -1; +- } +- li->li_tv.v_lock = 0; +- +- if (_ConvertFromPyObject(item, &li->li_tv, lookupDict) == -1) +- return -1; +- +- list_append(l, li); +- +- Py_DECREF(item); +- } +- +- Py_DECREF(iterator); +- return 0; +- } +- + static PyInt + ListLength(PyObject *self) + { +--- 893,898 ---- +*************** +*** 1768,1774 **** + (objobjargproc) OptionsAssItem, + }; + +! #define INVALID_WINDOW_VALUE ((win_T *)(-1)) + + static int + CheckWindow(WindowObject *this) +--- 1530,1547 ---- + (objobjargproc) OptionsAssItem, + }; + +! /* Window object +! */ +! +! typedef struct +! { +! PyObject_HEAD +! win_T *win; +! } WindowObject; +! +! static int WindowSetattr(PyObject *, char *, PyObject *); +! static PyObject *WindowRepr(PyObject *); +! static PyTypeObject WindowType; + + static int + CheckWindow(WindowObject *this) +*************** +*** 1782,1794 **** + return 0; + } + +- /* Window object +- */ +- +- static int WindowSetattr(PyObject *, char *, PyObject *); +- static PyObject *WindowRepr(PyObject *); +- static PyTypeObject WindowType; +- + static PyObject * + WindowNew(win_T *win) + { +--- 1555,1560 ---- +*************** +*** 1803,1809 **** + * to an invalid value. We trap all uses of a window + * object, and reject them if the win_T* field is invalid. + * +! * Python2 and Python3 get different fields and different objects: + * w_python_ref and w_python3_ref fields respectively. + */ + +--- 1569,1575 ---- + * to an invalid value. We trap all uses of a window + * object, and reject them if the win_T* field is invalid. + * +! * Python2 and Python3 get different fields and different objects: + * w_python_ref and w_python3_ref fields respectively. + */ + +*************** +*** 1826,1831 **** +--- 1592,1608 ---- + return (PyObject *)(self); + } + ++ static void ++ WindowDestructor(PyObject *self) ++ { ++ WindowObject *this = (WindowObject *)(self); ++ ++ if (this->win && this->win != INVALID_WINDOW_VALUE) ++ WIN_PYTHON_REF(this->win) = NULL; ++ ++ DESTRUCTOR_FINISH(self); ++ } ++ + static PyObject * + WindowAttr(WindowObject *this, char *name) + { +*************** +*** 1863,1879 **** + return NULL; + } + +- static void +- WindowDestructor(PyObject *self) +- { +- WindowObject *this = (WindowObject *)(self); +- +- if (this->win && this->win != INVALID_WINDOW_VALUE) +- WIN_PYTHON_REF(this->win) = NULL; +- +- DESTRUCTOR_FINISH(self); +- } +- + static int + WindowSetattr(PyObject *self, char *name, PyObject *val) + { +--- 1640,1645 ---- +*************** +*** 1994,2011 **** + } + } + + /* +! * Window list object - Implementation + */ + + typedef struct + { + PyObject_HEAD + } WinListObject; + +- static PyTypeObject WinListType; +- static PySequenceMethods BufListAsSeq; +- + static PyInt + WinListLength(PyObject *self UNUSED) + { +--- 1760,1782 ---- + } + } + ++ static struct PyMethodDef WindowMethods[] = { ++ /* name, function, calling, documentation */ ++ { NULL, NULL, 0, NULL } ++ }; ++ + /* +! * Window list object + */ + ++ static PyTypeObject WinListType; ++ static PySequenceMethods WinListAsSeq; ++ + typedef struct + { + PyObject_HEAD + } WinListObject; + + static PyInt + WinListLength(PyObject *self UNUSED) + { +*************** +*** 2596,2602 **** + * ------------------------------------------- + */ + +! static int + CheckBuffer(BufferObject *this) + { + if (this->buf == INVALID_BUFFER_VALUE) +--- 2367,2379 ---- + * ------------------------------------------- + */ + +! typedef struct +! { +! PyObject_HEAD +! buf_T *buf; +! } BufferObject; +! +! static int + CheckBuffer(BufferObject *this) + { + if (this->buf == INVALID_BUFFER_VALUE) +*************** +*** 2737,2746 **** + return Py_None; + } + +! /* Range object - Definitions + */ + + static PyTypeObject RangeType; + + typedef struct + { +--- 2514,2525 ---- + return Py_None; + } + +! /* Range object + */ + + static PyTypeObject RangeType; ++ static PySequenceMethods RangeAsSeq; ++ static PyMappingMethods RangeAsMapping; + + typedef struct + { +*************** +*** 2750,2759 **** + PyInt end; + } RangeObject; + +- static void RangeDestructor(PyObject *); +- static PySequenceMethods RangeAsSeq; +- static PyMappingMethods RangeAsMapping; +- + static PyObject * + RangeNew(buf_T *buf, PyInt start, PyInt end) + { +--- 2529,2534 ---- +*************** +*** 2785,2806 **** + DESTRUCTOR_FINISH(self); + } + +! static PyTypeObject BufferType; +! static PyObject *BufferRepr(PyObject *); +! static PySequenceMethods BufferAsSeq; +! static PyMappingMethods BufferAsMapping; + +! static void +! BufferDestructor(PyObject *self) + { +! BufferObject *this = (BufferObject *)(self); + +! if (this->buf && this->buf != INVALID_BUFFER_VALUE) +! BUF_PYTHON_REF(this->buf) = NULL; + +! DESTRUCTOR_FINISH(self); + } + + static PyObject * + BufferNew(buf_T *buf) + { +--- 2560,2642 ---- + DESTRUCTOR_FINISH(self); + } + +! static PyInt +! RangeLength(PyObject *self) +! { +! /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */ +! if (CheckBuffer(((RangeObject *)(self))->buf)) +! return -1; /* ??? */ + +! return (((RangeObject *)(self))->end - ((RangeObject *)(self))->start + 1); +! } +! +! static PyObject * +! RangeItem(PyObject *self, PyInt n) + { +! return RBItem(((RangeObject *)(self))->buf, n, +! ((RangeObject *)(self))->start, +! ((RangeObject *)(self))->end); +! } + +! static PyObject * +! RangeSlice(PyObject *self, PyInt lo, PyInt hi) +! { +! return RBSlice(((RangeObject *)(self))->buf, lo, hi, +! ((RangeObject *)(self))->start, +! ((RangeObject *)(self))->end); +! } + +! static PyObject * +! RangeAppend(PyObject *self, PyObject *args) +! { +! return RBAppend(((RangeObject *)(self))->buf, args, +! ((RangeObject *)(self))->start, +! ((RangeObject *)(self))->end, +! &((RangeObject *)(self))->end); +! } +! +! static PyObject * +! RangeRepr(PyObject *self) +! { +! static char repr[100]; +! RangeObject *this = (RangeObject *)(self); +! +! if (this->buf->buf == INVALID_BUFFER_VALUE) +! { +! vim_snprintf(repr, 100, "", +! (self)); +! return PyString_FromString(repr); +! } +! else +! { +! char *name = (char *)this->buf->buf->b_fname; +! int len; +! +! if (name == NULL) +! name = ""; +! len = (int)strlen(name); +! +! if (len > 45) +! name = name + (45 - len); +! +! vim_snprintf(repr, 100, "", +! len > 45 ? "..." : "", name, +! this->start, this->end); +! +! return PyString_FromString(repr); +! } + } + ++ static struct PyMethodDef RangeMethods[] = { ++ /* name, function, calling, documentation */ ++ {"append", RangeAppend, 1, "Append data to the Vim range" }, ++ { NULL, NULL, 0, NULL } ++ }; ++ ++ static PyTypeObject BufferType; ++ static PySequenceMethods BufferAsSeq; ++ static PyMappingMethods BufferAsMapping; ++ + static PyObject * + BufferNew(buf_T *buf) + { +*************** +*** 2817,2823 **** + * set the buf_T * value to an invalid value (-1?), which + * means we need checks in all access functions... Bah. + * +! * Python2 and Python3 get different fields and different objects: + * b_python_ref and b_python3_ref fields respectively. + */ + +--- 2653,2659 ---- + * set the buf_T * value to an invalid value (-1?), which + * means we need checks in all access functions... Bah. + * +! * Python2 and Python3 get different fields and different objects: + * b_python_ref and b_python3_ref fields respectively. + */ + +*************** +*** 2840,2861 **** + return (PyObject *)(self); + } + +! static PyObject * +! BufferAttr(BufferObject *this, char *name) + { +! if (strcmp(name, "name") == 0) +! return Py_BuildValue("s", this->buf->b_ffname); +! else if (strcmp(name, "number") == 0) +! return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); +! else if (strcmp(name, "vars") == 0) +! return DictionaryNew(this->buf->b_vars); +! else if (strcmp(name, "options") == 0) +! return OptionsNew(SREQ_BUF, this->buf, (checkfun) CheckBuffer, +! (PyObject *) this); +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssss]", "name", "number", "vars", "options"); +! else +! return NULL; + } + + static PyInt +--- 2676,2690 ---- + return (PyObject *)(self); + } + +! static void +! BufferDestructor(PyObject *self) + { +! BufferObject *this = (BufferObject *)(self); +! +! if (this->buf && this->buf != INVALID_BUFFER_VALUE) +! BUF_PYTHON_REF(this->buf) = NULL; +! +! DESTRUCTOR_FINISH(self); + } + + static PyInt +*************** +*** 2883,2888 **** +--- 2712,2735 ---- + } + + static PyObject * ++ BufferAttr(BufferObject *this, char *name) ++ { ++ if (strcmp(name, "name") == 0) ++ return Py_BuildValue("s", this->buf->b_ffname); ++ else if (strcmp(name, "number") == 0) ++ return Py_BuildValue(Py_ssize_t_fmt, this->buf->b_fnum); ++ else if (strcmp(name, "vars") == 0) ++ return DictionaryNew(this->buf->b_vars); ++ else if (strcmp(name, "options") == 0) ++ return OptionsNew(SREQ_BUF, this->buf, (checkfun) CheckBuffer, ++ (PyObject *) this); ++ else if (strcmp(name,"__members__") == 0) ++ return Py_BuildValue("[ssss]", "name", "number", "vars", "options"); ++ else ++ return NULL; ++ } ++ ++ static PyObject * + BufferAppend(PyObject *self, PyObject *args) + { + return RBAppend((BufferObject *)(self), args, 1, +*************** +*** 2985,3073 **** + { NULL, NULL, 0, NULL } + }; + +! static PyObject * +! RangeAppend(PyObject *self, PyObject *args) +! { +! return RBAppend(((RangeObject *)(self))->buf, args, +! ((RangeObject *)(self))->start, +! ((RangeObject *)(self))->end, +! &((RangeObject *)(self))->end); +! } +! +! static PyInt +! RangeLength(PyObject *self) +! { +! /* HOW DO WE SIGNAL AN ERROR FROM THIS FUNCTION? */ +! if (CheckBuffer(((RangeObject *)(self))->buf)) +! return -1; /* ??? */ +! +! return (((RangeObject *)(self))->end - ((RangeObject *)(self))->start + 1); +! } +! +! static PyObject * +! RangeItem(PyObject *self, PyInt n) +! { +! return RBItem(((RangeObject *)(self))->buf, n, +! ((RangeObject *)(self))->start, +! ((RangeObject *)(self))->end); +! } +! +! static PyObject * +! RangeRepr(PyObject *self) +! { +! static char repr[100]; +! RangeObject *this = (RangeObject *)(self); +! +! if (this->buf->buf == INVALID_BUFFER_VALUE) +! { +! vim_snprintf(repr, 100, "", +! (self)); +! return PyString_FromString(repr); +! } +! else +! { +! char *name = (char *)this->buf->buf->b_fname; +! int len; +! +! if (name == NULL) +! name = ""; +! len = (int)strlen(name); +! +! if (len > 45) +! name = name + (45 - len); +! +! vim_snprintf(repr, 100, "", +! len > 45 ? "..." : "", name, +! this->start, this->end); +! +! return PyString_FromString(repr); +! } +! } +! +! static PyObject * +! RangeSlice(PyObject *self, PyInt lo, PyInt hi) +! { +! return RBSlice(((RangeObject *)(self))->buf, lo, hi, +! ((RangeObject *)(self))->start, +! ((RangeObject *)(self))->end); +! } +! +! /* +! * Line range object - Definitions +! */ +! +! static struct PyMethodDef RangeMethods[] = { +! /* name, function, calling, documentation */ +! {"append", RangeAppend, 1, "Append data to the Vim range" }, +! { NULL, NULL, 0, NULL } +! }; +! +! /* Current items object - Implementation + */ + +- static PyInt RangeStart; +- static PyInt RangeEnd; +- + static PyObject * + CurrentGetattr(PyObject *self UNUSED, char *name) + { +--- 2832,2840 ---- + { NULL, NULL, 0, NULL } + }; + +! /* Current items object + */ + + static PyObject * + CurrentGetattr(PyObject *self UNUSED, char *name) + { +*************** +*** 3147,3152 **** +--- 2914,3131 ---- + return 0; + } + ++ static int ++ pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) ++ { ++ dict_T *d; ++ char_u *key; ++ dictitem_T *di; ++ PyObject *keyObject; ++ PyObject *valObject; ++ Py_ssize_t iter = 0; ++ ++ d = dict_alloc(); ++ if (d == NULL) ++ { ++ PyErr_NoMemory(); ++ return -1; ++ } ++ ++ tv->v_type = VAR_DICT; ++ tv->vval.v_dict = d; ++ ++ while (PyDict_Next(obj, &iter, &keyObject, &valObject)) ++ { ++ DICTKEY_DECL ++ ++ if (keyObject == NULL) ++ return -1; ++ if (valObject == NULL) ++ return -1; ++ ++ DICTKEY_GET_NOTEMPTY(-1) ++ ++ di = dictitem_alloc(key); ++ ++ DICTKEY_UNREF ++ ++ if (di == NULL) ++ { ++ PyErr_NoMemory(); ++ return -1; ++ } ++ di->di_tv.v_lock = 0; ++ ++ if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) ++ { ++ vim_free(di); ++ return -1; ++ } ++ if (dict_add(d, di) == FAIL) ++ { ++ vim_free(di); ++ PyErr_SetVim(_("failed to add key to dictionary")); ++ return -1; ++ } ++ } ++ return 0; ++ } ++ ++ static int ++ pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) ++ { ++ dict_T *d; ++ char_u *key; ++ dictitem_T *di; ++ PyObject *list; ++ PyObject *litem; ++ PyObject *keyObject; ++ PyObject *valObject; ++ Py_ssize_t lsize; ++ ++ d = dict_alloc(); ++ if (d == NULL) ++ { ++ PyErr_NoMemory(); ++ return -1; ++ } ++ ++ tv->v_type = VAR_DICT; ++ tv->vval.v_dict = d; ++ ++ list = PyMapping_Items(obj); ++ if (list == NULL) ++ return -1; ++ lsize = PyList_Size(list); ++ while (lsize--) ++ { ++ DICTKEY_DECL ++ ++ litem = PyList_GetItem(list, lsize); ++ if (litem == NULL) ++ { ++ Py_DECREF(list); ++ return -1; ++ } ++ ++ keyObject = PyTuple_GetItem(litem, 0); ++ if (keyObject == NULL) ++ { ++ Py_DECREF(list); ++ Py_DECREF(litem); ++ return -1; ++ } ++ ++ DICTKEY_GET_NOTEMPTY(-1) ++ ++ valObject = PyTuple_GetItem(litem, 1); ++ if (valObject == NULL) ++ { ++ Py_DECREF(list); ++ Py_DECREF(litem); ++ return -1; ++ } ++ ++ di = dictitem_alloc(key); ++ ++ DICTKEY_UNREF ++ ++ if (di == NULL) ++ { ++ Py_DECREF(list); ++ Py_DECREF(litem); ++ PyErr_NoMemory(); ++ return -1; ++ } ++ di->di_tv.v_lock = 0; ++ ++ if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) ++ { ++ vim_free(di); ++ Py_DECREF(list); ++ Py_DECREF(litem); ++ return -1; ++ } ++ if (dict_add(d, di) == FAIL) ++ { ++ vim_free(di); ++ Py_DECREF(list); ++ Py_DECREF(litem); ++ PyErr_SetVim(_("failed to add key to dictionary")); ++ return -1; ++ } ++ Py_DECREF(litem); ++ } ++ Py_DECREF(list); ++ return 0; ++ } ++ ++ static int ++ pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) ++ { ++ list_T *l; ++ ++ l = list_alloc(); ++ if (l == NULL) ++ { ++ PyErr_NoMemory(); ++ return -1; ++ } ++ ++ tv->v_type = VAR_LIST; ++ tv->vval.v_list = l; ++ ++ if (list_py_concat(l, obj, lookupDict) == -1) ++ return -1; ++ ++ return 0; ++ } ++ ++ static int ++ pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) ++ { ++ PyObject *iterator = PyObject_GetIter(obj); ++ PyObject *item; ++ list_T *l; ++ listitem_T *li; ++ ++ l = list_alloc(); ++ ++ if (l == NULL) ++ { ++ PyErr_NoMemory(); ++ return -1; ++ } ++ ++ tv->vval.v_list = l; ++ tv->v_type = VAR_LIST; ++ ++ ++ if (iterator == NULL) ++ return -1; ++ ++ while ((item = PyIter_Next(obj))) ++ { ++ li = listitem_alloc(); ++ if (li == NULL) ++ { ++ PyErr_NoMemory(); ++ return -1; ++ } ++ li->li_tv.v_lock = 0; ++ ++ if (_ConvertFromPyObject(item, &li->li_tv, lookupDict) == -1) ++ return -1; ++ ++ list_append(l, li); ++ ++ Py_DECREF(item); ++ } ++ ++ Py_DECREF(iterator); ++ return 0; ++ } ++ + typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *); + + static int +*** ../vim-7.3.940/src/if_python.c 2013-05-12 18:44:44.000000000 +0200 +--- src/if_python.c 2013-05-12 19:34:35.000000000 +0200 +*************** +*** 1019,1027 **** + + #define BufferType_Check(obj) ((obj)->ob_type == &BufferType) + +- static PyInt BufferLength(PyObject *); +- static PyObject *BufferItem(PyObject *, PyInt); +- static PyObject *BufferSlice(PyObject *, PyInt, PyInt); + static PyInt BufferAssItem(PyObject *, PyInt, PyObject *); + static PyInt BufferAssSlice(PyObject *, PyInt, PyInt, PyObject *); + +--- 1019,1024 ---- +*** ../vim-7.3.940/src/version.c 2013-05-12 19:30:27.000000000 +0200 +--- src/version.c 2013-05-12 19:37:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 941, + /**/ + +-- +ARTHUR: Well, I AM king... +DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By exploitin' + the workers -- by 'angin' on to outdated imperialist dogma which + perpetuates the economic an' social differences in our society! If + there's ever going to be any progress-- + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.942 b/7.3.942 new file mode 100644 index 0000000..2ce3d16 --- /dev/null +++ b/7.3.942 @@ -0,0 +1,205 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.942 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.942 +Problem: Python: SEGV in Buffer functions. +Solution: Call CheckBuffer() at the right time. (ZyX) +Files: src/if_py_both.h, src/if_python.c, src/if_python3.c + + +*** ../vim-7.3.941/src/if_py_both.h 2013-05-12 19:45:30.000000000 +0200 +--- src/if_py_both.h 2013-05-12 20:19:08.000000000 +0200 +*************** +*** 2391,2396 **** +--- 2391,2399 ---- + if (CheckBuffer(self)) + return NULL; + ++ if (end == -1) ++ end = self->buf->b_ml.ml_line_count; ++ + if (n < 0 || n > end - start) + { + PyErr_SetString(PyExc_IndexError, _("line number out of range")); +*************** +*** 2408,2413 **** +--- 2411,2419 ---- + if (CheckBuffer(self)) + return NULL; + ++ if (end == -1) ++ end = self->buf->b_ml.ml_line_count; ++ + size = end - start + 1; + + if (lo < 0) +*************** +*** 2432,2437 **** +--- 2438,2446 ---- + if (CheckBuffer(self)) + return -1; + ++ if (end == -1) ++ end = self->buf->b_ml.ml_line_count; ++ + if (n < 0 || n > end - start) + { + PyErr_SetString(PyExc_IndexError, _("line number out of range")); +*************** +*** 2457,2462 **** +--- 2466,2474 ---- + if (CheckBuffer(self)) + return -1; + ++ if (end == -1) ++ end = self->buf->b_ml.ml_line_count; ++ + /* Sort out the slice range */ + size = end - start + 1; + +*************** +*** 2493,2498 **** +--- 2505,2513 ---- + if (CheckBuffer(self)) + return NULL; + ++ if (end == -1) ++ end = self->buf->b_ml.ml_line_count; ++ + max = n = end - start + 1; + + if (!PyArg_ParseTuple(args, "O|n", &lines, &n)) +*************** +*** 2700,2714 **** + static PyObject * + BufferItem(PyObject *self, PyInt n) + { +! return RBItem((BufferObject *)(self), n, 1, +! (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count); + } + + static PyObject * + BufferSlice(PyObject *self, PyInt lo, PyInt hi) + { +! return RBSlice((BufferObject *)(self), lo, hi, 1, +! (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count); + } + + static PyObject * +--- 2715,2727 ---- + static PyObject * + BufferItem(PyObject *self, PyInt n) + { +! return RBItem((BufferObject *)(self), n, 1, -1); + } + + static PyObject * + BufferSlice(PyObject *self, PyInt lo, PyInt hi) + { +! return RBSlice((BufferObject *)(self), lo, hi, 1, -1); + } + + static PyObject * +*************** +*** 2732,2740 **** + static PyObject * + BufferAppend(PyObject *self, PyObject *args) + { +! return RBAppend((BufferObject *)(self), args, 1, +! (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, +! NULL); + } + + static PyObject * +--- 2745,2751 ---- + static PyObject * + BufferAppend(PyObject *self, PyObject *args) + { +! return RBAppend((BufferObject *)(self), args, 1, -1, NULL); + } + + static PyObject * +*** ../vim-7.3.941/src/if_python.c 2013-05-12 19:45:30.000000000 +0200 +--- src/if_python.c 2013-05-12 20:19:08.000000000 +0200 +*************** +*** 1073,1089 **** + static PyInt + BufferAssItem(PyObject *self, PyInt n, PyObject *val) + { +! return RBAsItem((BufferObject *)(self), n, val, 1, +! (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, +! NULL); + } + + static PyInt + BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) + { +! return RBAsSlice((BufferObject *)(self), lo, hi, val, 1, +! (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, +! NULL); + } + + static PySequenceMethods RangeAsSeq = { +--- 1073,1085 ---- + static PyInt + BufferAssItem(PyObject *self, PyInt n, PyObject *val) + { +! return RBAsItem((BufferObject *)(self), n, val, 1, -1, NULL); + } + + static PyInt + BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) + { +! return RBAsSlice((BufferObject *)(self), lo, hi, val, 1, -1, NULL); + } + + static PySequenceMethods RangeAsSeq = { +*** ../vim-7.3.941/src/if_python3.c 2013-05-12 18:44:44.000000000 +0200 +--- src/if_python3.c 2013-05-12 20:19:08.000000000 +0200 +*************** +*** 1110,1115 **** +--- 1110,1118 ---- + { + Py_ssize_t start, stop, step, slicelen; + ++ if (CheckBuffer((BufferObject *) self)) ++ return NULL; ++ + if (PySlice_GetIndicesEx((PyObject *)idx, + (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1, + &start, &stop, +*************** +*** 1139,1144 **** +--- 1142,1150 ---- + { + Py_ssize_t start, stop, step, slicelen; + ++ if (CheckBuffer((BufferObject *) self)) ++ return -1; ++ + if (PySlice_GetIndicesEx((PyObject *)idx, + (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1, + &start, &stop, +*** ../vim-7.3.941/src/version.c 2013-05-12 19:45:30.000000000 +0200 +--- src/version.c 2013-05-12 19:49:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 942, + /**/ + +-- +Vim is like Emacs without all the typing. (John "Johann" Spetz) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.3.943 b/7.3.943 new file mode 100644 index 0000000..5d1de0c --- /dev/null +++ b/7.3.943 @@ -0,0 +1,267 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.943 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.943 +Problem: Python: Negative indices were failing. +Solution: Fix negative indices. Add tests. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/testdir/test86.in, + src/testdir/test86.ok, src/testdir/test87.in, + src/testdir/test87.ok + + +*** ../vim-7.3.942/src/if_py_both.h 2013-05-12 20:36:09.000000000 +0200 +--- src/if_py_both.h 2013-05-12 21:10:03.000000000 +0200 +*************** +*** 2394,2399 **** +--- 2394,2402 ---- + if (end == -1) + end = self->buf->b_ml.ml_line_count; + ++ if (n < 0) ++ n += end - start + 1; ++ + if (n < 0 || n > end - start) + { + PyErr_SetString(PyExc_IndexError, _("line number out of range")); +*************** +*** 2441,2446 **** +--- 2444,2452 ---- + if (end == -1) + end = self->buf->b_ml.ml_line_count; + ++ if (n < 0) ++ n += end - start + 1; ++ + if (n < 0 || n > end - start) + { + PyErr_SetString(PyExc_IndexError, _("line number out of range")); +*** ../vim-7.3.942/src/if_python3.c 2013-05-12 20:36:09.000000000 +0200 +--- src/if_python3.c 2013-05-12 21:10:03.000000000 +0200 +*************** +*** 1114,1120 **** + return NULL; + + if (PySlice_GetIndicesEx((PyObject *)idx, +! (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1, + &start, &stop, + &step, &slicelen) < 0) + { +--- 1114,1120 ---- + return NULL; + + if (PySlice_GetIndicesEx((PyObject *)idx, +! (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count, + &start, &stop, + &step, &slicelen) < 0) + { +*************** +*** 1146,1152 **** + return -1; + + if (PySlice_GetIndicesEx((PyObject *)idx, +! (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1, + &start, &stop, + &step, &slicelen) < 0) + { +--- 1146,1152 ---- + return -1; + + if (PySlice_GetIndicesEx((PyObject *)idx, +! (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count, + &start, &stop, + &step, &slicelen) < 0) + { +*** ../vim-7.3.942/src/testdir/test86.in 2013-05-06 03:52:44.000000000 +0200 +--- src/testdir/test86.in 2013-05-12 21:11:43.000000000 +0200 +*************** +*** 475,483 **** + : endtry + : endfor + : call RecVars(oname) +- endtry + :endfor + :only + :endfun + :" + :call Test() +--- 475,524 ---- + : endtry + : endfor + : call RecVars(oname) + :endfor + :only ++ :" ++ :" Test buffer object ++ :vnew ++ :put ='First line' ++ :put ='Second line' ++ :put ='Third line' ++ :1 delete _ ++ :py b=vim.current.buffer ++ :wincmd w ++ :mark a ++ py << EOF ++ cb = vim.current.buffer ++ # Tests BufferAppend and BufferItem ++ cb.append(b[0]) ++ # Tests BufferSlice and BufferAssSlice ++ cb.append('abc') # Will be overwritten ++ cb[-1:] = b[:-2] ++ # Test BufferLength and BufferAssSlice ++ cb.append('def') # Will not be overwritten ++ cb[len(cb):] = b[:] ++ # Test BufferAssItem and BufferMark ++ cb.append('ghi') # Will be overwritten ++ cb[-1] = repr((len(cb) - cb.mark('a')[0], cb.mark('a')[1])) ++ # Test BufferRepr ++ cb.append(repr(cb) + repr(b)) ++ # Modify foreign buffer ++ b.append('foo') ++ b[0]='bar' ++ b[0:0]=['baz'] ++ vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) ++ # Test CheckBuffer ++ vim.command('bwipeout! ' + str(b.number)) ++ for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): ++ try: ++ exec(expr) ++ except vim.error: ++ pass ++ else: ++ # Usually a SEGV here ++ # Should not happen in any case ++ cb.append('No exception for ' + expr) ++ EOF + :endfun + :" + :call Test() +*** ../vim-7.3.942/src/testdir/test86.ok 2013-05-06 03:52:44.000000000 +0200 +--- src/testdir/test86.ok 2013-05-12 21:11:43.000000000 +0200 +*************** +*** 306,308 **** +--- 306,321 ---- + G: '.,,' + W: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' + B: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' ++ First line ++ First line ++ def ++ First line ++ Second line ++ Third line ++ (7, 2) ++ ++ baz ++ bar ++ Second line ++ Third line ++ foo +*** ../vim-7.3.942/src/testdir/test87.in 2013-05-06 03:52:44.000000000 +0200 +--- src/testdir/test87.in 2013-05-12 21:11:43.000000000 +0200 +*************** +*** 444,452 **** + : endtry + : endfor + : call RecVars(oname) +- endtry + :endfor + :only + :endfun + :" + :call Test() +--- 444,493 ---- + : endtry + : endfor + : call RecVars(oname) + :endfor + :only ++ :" ++ :" Test buffer object ++ :vnew ++ :put ='First line' ++ :put ='Second line' ++ :put ='Third line' ++ :1 delete _ ++ :py3 b=vim.current.buffer ++ :wincmd w ++ :mark a ++ py3 << EOF ++ cb = vim.current.buffer ++ # Tests BufferAppend and BufferItem ++ cb.append(b[0]) ++ # Tests BufferSlice and BufferAssSlice ++ cb.append('abc') # Will be overwritten ++ cb[-1:] = b[:-2] ++ # Test BufferLength and BufferAssSlice ++ cb.append('def') # Will not be overwritten ++ cb[len(cb):] = b[:] ++ # Test BufferAssItem and BufferMark ++ cb.append('ghi') # Will be overwritten ++ cb[-1] = repr((len(cb) - cb.mark('a')[0], cb.mark('a')[1])) ++ # Test BufferRepr ++ cb.append(repr(cb) + repr(b)) ++ # Modify foreign buffer ++ b.append('foo') ++ b[0]='bar' ++ b[0:0]=['baz'] ++ vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) ++ # Test CheckBuffer ++ vim.command('bwipeout! ' + str(b.number)) ++ for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): ++ try: ++ exec(expr) ++ except vim.error: ++ pass ++ else: ++ # Usually a SEGV here ++ # Should not happen in any case ++ cb.append('No exception for ' + expr) ++ EOF + :endfun + :" + :call Test() +*** ../vim-7.3.942/src/testdir/test87.ok 2013-05-06 03:52:44.000000000 +0200 +--- src/testdir/test87.ok 2013-05-12 21:11:43.000000000 +0200 +*************** +*** 295,297 **** +--- 295,310 ---- + G: '.,,' + W: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' + B: 1:',,' 2:'.,,' 3:'.,,' 4:'.,,' ++ First line ++ First line ++ def ++ First line ++ Second line ++ Third line ++ (7, 2) ++ ++ baz ++ bar ++ Second line ++ Third line ++ foo +*** ../vim-7.3.942/src/version.c 2013-05-12 20:36:09.000000000 +0200 +--- src/version.c 2013-05-12 21:11:53.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 943, + /**/ + +-- +Q: Is selling software the same as selling hardware? +A: No, good hardware is sold new, good software has already been used by many. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/README.patches b/README.patches index a82d9d6..e7e5ab7 100644 --- a/README.patches +++ b/README.patches @@ -869,7 +869,7 @@ Individual patches for Vim 7.3: 1755 7.3.835 "xxd -i" fails on an empty file 59985 7.3.836 clipboard does not work on Win32 when compiled with Cygwin 2221 7.3.837 empty lines in :version output when 'columns' is 320 - 11082 7.3.838 (after 7.3.830) insufficient testing for mksession + 11057 7.3.838 (after 7.3.830) insufficient testing for mksession 2012 7.3.839 some files missing in the list of distributed files 1652 7.3.840 "\@ 7.3.943-1 +- patchlevel 943 + +* Wed May 08 2013 Karsten Hopp 7.3.931-1 +- patchlevel 931 + +* Wed May 08 2013 Karsten Hopp 7.3.903-1 +- fix ruby version check + * Fri Apr 19 2013 Karsten Hopp 7.3.903-1 - drop crv patch - update 7.3.838 patch, it was broken upstream