Merge remote branch 'fedora/f19' into rhel-7.0
This commit is contained in:
commit
1ed07d0119
648
7.3.945
Normal file
648
7.3.945
Normal file
@ -0,0 +1,648 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.945
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.945
|
||||
Problem: Python: List of buffers is not very useful.
|
||||
Solution: Make vim.buffers a map. No iterator yet. (ZyX)
|
||||
Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c,
|
||||
src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.944/runtime/doc/if_pyth.txt 2013-05-12 19:30:27.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-15 13:34:06.000000000 +0200
|
||||
***************
|
||||
*** 209,220 ****
|
||||
to which the variables referred.
|
||||
|
||||
vim.buffers *python-buffers*
|
||||
! A sequence object providing access to the list of vim buffers. The
|
||||
object supports the following operations: >
|
||||
:py b = vim.buffers[i] # Indexing (read-only)
|
||||
:py b in vim.buffers # Membership test
|
||||
:py n = len(vim.buffers) # Number of elements
|
||||
- :py for b in vim.buffers: # Sequential access
|
||||
<
|
||||
vim.windows *python-windows*
|
||||
A sequence object providing access to the list of vim windows. The
|
||||
--- 209,219 ----
|
||||
to which the variables referred.
|
||||
|
||||
vim.buffers *python-buffers*
|
||||
! A mapping object providing access to the list of vim buffers. The
|
||||
object supports the following operations: >
|
||||
:py b = vim.buffers[i] # Indexing (read-only)
|
||||
:py b in vim.buffers # Membership test
|
||||
:py n = len(vim.buffers) # Number of elements
|
||||
<
|
||||
vim.windows *python-windows*
|
||||
A sequence object providing access to the list of vim windows. The
|
||||
*** ../vim-7.3.944/src/if_py_both.h 2013-05-12 21:16:17.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 13:34:06.000000000 +0200
|
||||
***************
|
||||
*** 534,549 ****
|
||||
* Buffer list object - Implementation
|
||||
*/
|
||||
|
||||
! static PyTypeObject BufListType;
|
||||
! static PySequenceMethods BufListAsSeq;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PyObject_HEAD
|
||||
! } BufListObject;
|
||||
|
||||
static PyInt
|
||||
! BufListLength(PyObject *self UNUSED)
|
||||
{
|
||||
buf_T *b = firstbuf;
|
||||
PyInt n = 0;
|
||||
--- 534,548 ----
|
||||
* Buffer list object - Implementation
|
||||
*/
|
||||
|
||||
! static PyTypeObject BufMapType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PyObject_HEAD
|
||||
! } BufMapObject;
|
||||
|
||||
static PyInt
|
||||
! BufMapLength(PyObject *self UNUSED)
|
||||
{
|
||||
buf_T *b = firstbuf;
|
||||
PyInt n = 0;
|
||||
***************
|
||||
*** 558,577 ****
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
! BufListItem(PyObject *self UNUSED, PyInt n)
|
||||
{
|
||||
! buf_T *b;
|
||||
|
||||
! for (b = firstbuf; b; b = b->b_next, --n)
|
||||
{
|
||||
! if (n == 0)
|
||||
! return BufferNew(b);
|
||||
}
|
||||
|
||||
! PyErr_SetString(PyExc_IndexError, _("no such buffer"));
|
||||
! return NULL;
|
||||
}
|
||||
|
||||
typedef struct pylinkedlist_S {
|
||||
struct pylinkedlist_S *pll_next;
|
||||
struct pylinkedlist_S *pll_prev;
|
||||
--- 557,597 ----
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
! BufMapItem(PyObject *self UNUSED, PyObject *keyObject)
|
||||
{
|
||||
! buf_T *b;
|
||||
! int bnr;
|
||||
|
||||
! #if PY_MAJOR_VERSION < 3
|
||||
! if (PyInt_Check(keyObject))
|
||||
! bnr = PyInt_AsLong(keyObject);
|
||||
! else
|
||||
! #endif
|
||||
! if (PyLong_Check(keyObject))
|
||||
! bnr = PyLong_AsLong(keyObject);
|
||||
! else
|
||||
{
|
||||
! PyErr_SetString(PyExc_ValueError, _("key must be integer"));
|
||||
! return NULL;
|
||||
}
|
||||
|
||||
! b = buflist_findnr(bnr);
|
||||
!
|
||||
! if (b)
|
||||
! return BufferNew(b);
|
||||
! else
|
||||
! {
|
||||
! PyErr_SetString(PyExc_KeyError, _("no such buffer"));
|
||||
! return NULL;
|
||||
! }
|
||||
}
|
||||
|
||||
+ static PyMappingMethods BufMapAsMapping = {
|
||||
+ (lenfunc) BufMapLength,
|
||||
+ (binaryfunc) BufMapItem,
|
||||
+ (objobjargproc) 0,
|
||||
+ };
|
||||
+
|
||||
typedef struct pylinkedlist_S {
|
||||
struct pylinkedlist_S *pll_next;
|
||||
struct pylinkedlist_S *pll_prev;
|
||||
***************
|
||||
*** 3401,3411 ****
|
||||
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));
|
||||
--- 3421,3431 ----
|
||||
WindowType.tp_setattr = WindowSetattr;
|
||||
#endif
|
||||
|
||||
! vim_memset(&BufMapType, 0, sizeof(BufMapType));
|
||||
! BufMapType.tp_name = "vim.bufferlist";
|
||||
! BufMapType.tp_basicsize = sizeof(BufMapObject);
|
||||
! BufMapType.tp_as_mapping = &BufMapAsMapping;
|
||||
! BufMapType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
BufferType.tp_doc = "vim buffer list";
|
||||
|
||||
vim_memset(&WinListType, 0, sizeof(WinListType));
|
||||
*** ../vim-7.3.944/src/if_python3.c 2013-05-12 21:16:17.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 13:34:06.000000000 +0200
|
||||
***************
|
||||
*** 1272,1293 ****
|
||||
}
|
||||
}
|
||||
|
||||
- /* Buffer list object - Definitions
|
||||
- */
|
||||
-
|
||||
- static PySequenceMethods BufListAsSeq = {
|
||||
- (lenfunc) BufListLength, /* sq_length, len(x) */
|
||||
- (binaryfunc) 0, /* sq_concat, x+y */
|
||||
- (ssizeargfunc) 0, /* sq_repeat, x*n */
|
||||
- (ssizeargfunc) BufListItem, /* sq_item, x[i] */
|
||||
- 0, /* was_sq_slice, x[i:j] */
|
||||
- (ssizeobjargproc) 0, /* sq_as_item, x[i]=v */
|
||||
- 0, /* sq_ass_slice, x[i:j]=v */
|
||||
- 0, /* sq_contains */
|
||||
- 0, /* sq_inplace_concat */
|
||||
- 0, /* sq_inplace_repeat */
|
||||
- };
|
||||
-
|
||||
/* Window object - Implementation
|
||||
*/
|
||||
|
||||
--- 1272,1277 ----
|
||||
***************
|
||||
*** 1512,1520 ****
|
||||
}
|
||||
#endif
|
||||
|
||||
! static BufListObject TheBufferList =
|
||||
{
|
||||
! PyObject_HEAD_INIT(&BufListType)
|
||||
};
|
||||
|
||||
static WinListObject TheWindowList =
|
||||
--- 1496,1504 ----
|
||||
}
|
||||
#endif
|
||||
|
||||
! static BufMapObject TheBufferMap =
|
||||
{
|
||||
! PyObject_HEAD_INIT(&BufMapType)
|
||||
};
|
||||
|
||||
static WinListObject TheWindowList =
|
||||
***************
|
||||
*** 1538,1544 ****
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
! PyType_Ready(&BufListType);
|
||||
PyType_Ready(&WinListType);
|
||||
PyType_Ready(&CurrentType);
|
||||
PyType_Ready(&DictionaryType);
|
||||
--- 1522,1528 ----
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
! PyType_Ready(&BufMapType);
|
||||
PyType_Ready(&WinListType);
|
||||
PyType_Ready(&CurrentType);
|
||||
PyType_Ready(&DictionaryType);
|
||||
***************
|
||||
*** 1557,1564 ****
|
||||
Py_INCREF(VimError);
|
||||
|
||||
PyModule_AddObject(mod, "error", VimError);
|
||||
! Py_INCREF((PyObject *)(void *)&TheBufferList);
|
||||
! PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferList);
|
||||
Py_INCREF((PyObject *)(void *)&TheCurrent);
|
||||
PyModule_AddObject(mod, "current", (PyObject *)(void *)&TheCurrent);
|
||||
Py_INCREF((PyObject *)(void *)&TheWindowList);
|
||||
--- 1541,1548 ----
|
||||
Py_INCREF(VimError);
|
||||
|
||||
PyModule_AddObject(mod, "error", VimError);
|
||||
! Py_INCREF((PyObject *)(void *)&TheBufferMap);
|
||||
! PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
Py_INCREF((PyObject *)(void *)&TheCurrent);
|
||||
PyModule_AddObject(mod, "current", (PyObject *)(void *)&TheCurrent);
|
||||
Py_INCREF((PyObject *)(void *)&TheWindowList);
|
||||
*** ../vim-7.3.944/src/if_python.c 2013-05-12 20:36:09.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 13:34:06.000000000 +0200
|
||||
***************
|
||||
*** 1131,1154 ****
|
||||
&((RangeObject *)(self))->end);
|
||||
}
|
||||
|
||||
- /* Buffer list object - Definitions
|
||||
- */
|
||||
-
|
||||
- static PySequenceMethods BufListAsSeq = {
|
||||
- (PyInquiry) BufListLength, /* sq_length, len(x) */
|
||||
- (binaryfunc) 0, /* sq_concat, x+y */
|
||||
- (PyIntArgFunc) 0, /* sq_repeat, x*n */
|
||||
- (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
|
||||
*/
|
||||
|
||||
--- 1131,1136 ----
|
||||
***************
|
||||
*** 1212,1220 ****
|
||||
}
|
||||
#endif
|
||||
|
||||
! static BufListObject TheBufferList =
|
||||
{
|
||||
! PyObject_HEAD_INIT(&BufListType)
|
||||
};
|
||||
|
||||
static WinListObject TheWindowList =
|
||||
--- 1194,1202 ----
|
||||
}
|
||||
#endif
|
||||
|
||||
! static BufMapObject TheBufferMap =
|
||||
{
|
||||
! PyObject_HEAD_INIT(&BufMapType)
|
||||
};
|
||||
|
||||
static WinListObject TheWindowList =
|
||||
***************
|
||||
*** 1240,1246 ****
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
! PyType_Ready(&BufListType);
|
||||
PyType_Ready(&WinListType);
|
||||
PyType_Ready(&CurrentType);
|
||||
PyType_Ready(&OptionsType);
|
||||
--- 1222,1228 ----
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
! PyType_Ready(&BufMapType);
|
||||
PyType_Ready(&WinListType);
|
||||
PyType_Ready(&CurrentType);
|
||||
PyType_Ready(&OptionsType);
|
||||
***************
|
||||
*** 1254,1260 ****
|
||||
VimError = Py_BuildValue("s", "vim.error");
|
||||
|
||||
PyDict_SetItemString(dict, "error", VimError);
|
||||
! PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferList);
|
||||
PyDict_SetItemString(dict, "current", (PyObject *)(void *)&TheCurrent);
|
||||
PyDict_SetItemString(dict, "windows", (PyObject *)(void *)&TheWindowList);
|
||||
tmp = DictionaryNew(&globvardict);
|
||||
--- 1236,1242 ----
|
||||
VimError = Py_BuildValue("s", "vim.error");
|
||||
|
||||
PyDict_SetItemString(dict, "error", VimError);
|
||||
! PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
PyDict_SetItemString(dict, "current", (PyObject *)(void *)&TheCurrent);
|
||||
PyDict_SetItemString(dict, "windows", (PyObject *)(void *)&TheWindowList);
|
||||
tmp = DictionaryNew(&globvardict);
|
||||
*** ../vim-7.3.944/src/testdir/test86.ok 2013-05-12 21:16:17.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-15 13:34:06.000000000 +0200
|
||||
***************
|
||||
*** 226,238 ****
|
||||
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
|
||||
--- 226,238 ----
|
||||
p/bopts1: False
|
||||
inv: 2! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
>>> iminsert
|
||||
p/gopts1! KeyError
|
||||
inv: 3! KeyError
|
||||
***************
|
||||
*** 244,256 ****
|
||||
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
|
||||
--- 244,256 ----
|
||||
wopts3! KeyError
|
||||
p/bopts1: 2
|
||||
G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
>>> omnifunc
|
||||
p/gopts1! KeyError
|
||||
inv: 1! KeyError
|
||||
***************
|
||||
*** 263,275 ****
|
||||
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
|
||||
--- 263,275 ----
|
||||
p/bopts1: ''
|
||||
inv: 1! ValueError
|
||||
G: ''
|
||||
! W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
! B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: ''
|
||||
! W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
! B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
>>> preserveindent
|
||||
p/gopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
***************
|
||||
*** 282,294 ****
|
||||
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
|
||||
--- 282,294 ----
|
||||
p/bopts1: False
|
||||
inv: 2! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
>>> path
|
||||
p/gopts1: '.,/usr/include,,'
|
||||
inv: 0! ValueError
|
||||
***************
|
||||
*** 300,311 ****
|
||||
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:'.,,'
|
||||
First line
|
||||
First line
|
||||
def
|
||||
--- 300,311 ----
|
||||
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:'.,,'
|
||||
First line
|
||||
First line
|
||||
def
|
||||
*** ../vim-7.3.944/src/testdir/test87.ok 2013-05-12 21:16:17.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-15 13:34:06.000000000 +0200
|
||||
***************
|
||||
*** 215,227 ****
|
||||
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
|
||||
--- 215,227 ----
|
||||
p/bopts1: False
|
||||
inv: 2! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
>>> iminsert
|
||||
p/gopts1! KeyError
|
||||
inv: 3! KeyError
|
||||
***************
|
||||
*** 233,245 ****
|
||||
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
|
||||
--- 233,245 ----
|
||||
wopts3! KeyError
|
||||
p/bopts1: 2
|
||||
G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
>>> omnifunc
|
||||
p/gopts1! KeyError
|
||||
inv: 1! KeyError
|
||||
***************
|
||||
*** 252,264 ****
|
||||
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
|
||||
--- 252,264 ----
|
||||
p/bopts1: b''
|
||||
inv: 1! ValueError
|
||||
G: ''
|
||||
! W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
! B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: ''
|
||||
! W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
! B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
>>> preserveindent
|
||||
p/gopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
***************
|
||||
*** 271,283 ****
|
||||
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
|
||||
--- 271,283 ----
|
||||
p/bopts1: False
|
||||
inv: 2! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
G: 0
|
||||
! W: 1:0 2:1 3:0 4:1
|
||||
! B: 1:0 2:1 3:0 4:1
|
||||
>>> path
|
||||
p/gopts1: b'.,/usr/include,,'
|
||||
inv: 0! ValueError
|
||||
***************
|
||||
*** 289,300 ****
|
||||
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:'.,,'
|
||||
First line
|
||||
First line
|
||||
def
|
||||
--- 289,300 ----
|
||||
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:'.,,'
|
||||
First line
|
||||
First line
|
||||
def
|
||||
*** ../vim-7.3.944/src/version.c 2013-05-13 20:26:47.000000000 +0200
|
||||
--- src/version.c 2013-05-15 13:37:08.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 945,
|
||||
/**/
|
||||
|
||||
--
|
||||
ARTHUR: A scratch? Your arm's off!
|
||||
BLACK KNIGHT: No, it isn't.
|
||||
ARTHUR: Well, what's that then?
|
||||
BLACK KNIGHT: I've had worse.
|
||||
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 ///
|
98
7.3.946
Normal file
98
7.3.946
Normal file
@ -0,0 +1,98 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.946
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.946
|
||||
Problem: Sometimes get stuck in waiting for cursor position report,
|
||||
resulting in keys starting with <Esc>[ not working.
|
||||
Solution: Only wait for more characters after <Esc>[ if followed by '?', '>'
|
||||
or a digit.
|
||||
Files: src/term.c
|
||||
|
||||
|
||||
*** ../vim-7.3.945/src/term.c 2013-05-13 20:26:47.000000000 +0200
|
||||
--- src/term.c 2013-05-15 14:12:43.000000000 +0200
|
||||
***************
|
||||
*** 4126,4134 ****
|
||||
* The final byte is 'R'. now it is only used for checking for
|
||||
* ambiguous-width character state.
|
||||
*/
|
||||
if ((*T_CRV != NUL || *T_U7 != NUL)
|
||||
&& ((tp[0] == ESC && tp[1] == '[' && len >= 3)
|
||||
! || (tp[0] == CSI && len >= 2)))
|
||||
{
|
||||
j = 0;
|
||||
extra = 0;
|
||||
--- 4126,4136 ----
|
||||
* The final byte is 'R'. now it is only used for checking for
|
||||
* ambiguous-width character state.
|
||||
*/
|
||||
+ p = tp[0] == CSI ? tp + 1 : tp + 2;
|
||||
if ((*T_CRV != NUL || *T_U7 != NUL)
|
||||
&& ((tp[0] == ESC && tp[1] == '[' && len >= 3)
|
||||
! || (tp[0] == CSI && len >= 2))
|
||||
! && (VIM_ISDIGIT(*p) || *p == '>' || *p == '?'))
|
||||
{
|
||||
j = 0;
|
||||
extra = 0;
|
||||
***************
|
||||
*** 4136,4142 ****
|
||||
&& !(tp[i] >= '{' && tp[i] <= '~')
|
||||
&& !ASCII_ISALPHA(tp[i]); ++i)
|
||||
if (tp[i] == ';' && ++j == 1)
|
||||
! extra = atoi((char *)tp + i + 1);
|
||||
if (i == len)
|
||||
return -1; /* not enough characters */
|
||||
|
||||
--- 4138,4144 ----
|
||||
&& !(tp[i] >= '{' && tp[i] <= '~')
|
||||
&& !ASCII_ISALPHA(tp[i]); ++i)
|
||||
if (tp[i] == ';' && ++j == 1)
|
||||
! extra = i + 1;
|
||||
if (i == len)
|
||||
return -1; /* not enough characters */
|
||||
|
||||
***************
|
||||
*** 4150,4155 ****
|
||||
--- 4152,4159 ----
|
||||
# ifdef FEAT_AUTOCMD
|
||||
did_cursorhold = TRUE;
|
||||
# endif
|
||||
+ if (extra > 0)
|
||||
+ extra = atoi((char *)tp + extra);
|
||||
if (extra == 2)
|
||||
aw = "single";
|
||||
else if (extra == 3)
|
||||
***************
|
||||
*** 4178,4183 ****
|
||||
--- 4182,4189 ----
|
||||
/* rxvt sends its version number: "20703" is 2.7.3.
|
||||
* Ignore it for when the user has set 'term' to xterm,
|
||||
* even though it's an rxvt. */
|
||||
+ if (extra > 0)
|
||||
+ extra = atoi((char *)tp + extra);
|
||||
if (extra > 20000)
|
||||
extra = 0;
|
||||
|
||||
*** ../vim-7.3.945/src/version.c 2013-05-15 13:38:41.000000000 +0200
|
||||
--- src/version.c 2013-05-15 14:17:51.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 946,
|
||||
/**/
|
||||
|
||||
--
|
||||
No letters of the alphabet were harmed in the creation of this message.
|
||||
|
||||
/// 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 ///
|
703
7.3.947
Normal file
703
7.3.947
Normal file
@ -0,0 +1,703 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.947
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.947
|
||||
Problem: Python: No iterator for vim.list and vim.bufferlist.
|
||||
Solution: Add the iterators. Also fix name of FunctionType. Add tests for
|
||||
vim.buffers. (ZyX)
|
||||
Files: runtime/doc/if_pyth.txt, src/eval.c, src/if_py_both.h,
|
||||
src/if_python3.c, src/if_python.c, src/proto/eval.pro,
|
||||
src/testdir/test86.in, src/testdir/test86.ok,
|
||||
src/testdir/test87.in, src/testdir/test87.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.946/runtime/doc/if_pyth.txt 2013-05-15 13:38:41.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-15 14:24:11.000000000 +0200
|
||||
***************
|
||||
*** 214,219 ****
|
||||
--- 214,220 ----
|
||||
:py b = vim.buffers[i] # Indexing (read-only)
|
||||
:py b in vim.buffers # Membership test
|
||||
:py n = len(vim.buffers) # Number of elements
|
||||
+ :py for b in vim.buffers: # Iterating over buffer list
|
||||
<
|
||||
vim.windows *python-windows*
|
||||
A sequence object providing access to the list of vim windows. The
|
||||
*** ../vim-7.3.946/src/eval.c 2013-05-06 04:50:26.000000000 +0200
|
||||
--- src/eval.c 2013-05-15 14:24:11.000000000 +0200
|
||||
***************
|
||||
*** 390,397 ****
|
||||
static void clear_lval __ARGS((lval_T *lp));
|
||||
static void set_var_lval __ARGS((lval_T *lp, char_u *endp, typval_T *rettv, int copy, char_u *op));
|
||||
static int tv_op __ARGS((typval_T *tv1, typval_T *tv2, char_u *op));
|
||||
- static void list_add_watch __ARGS((list_T *l, listwatch_T *lw));
|
||||
- static void list_rem_watch __ARGS((list_T *l, listwatch_T *lwrem));
|
||||
static void list_fix_watch __ARGS((list_T *l, listitem_T *item));
|
||||
static void ex_unletlock __ARGS((exarg_T *eap, char_u *argstart, int deep));
|
||||
static int do_unlet_var __ARGS((lval_T *lp, char_u *name_end, int forceit));
|
||||
--- 390,395 ----
|
||||
***************
|
||||
*** 3106,3112 ****
|
||||
/*
|
||||
* Add a watcher to a list.
|
||||
*/
|
||||
! static void
|
||||
list_add_watch(l, lw)
|
||||
list_T *l;
|
||||
listwatch_T *lw;
|
||||
--- 3104,3110 ----
|
||||
/*
|
||||
* Add a watcher to a list.
|
||||
*/
|
||||
! void
|
||||
list_add_watch(l, lw)
|
||||
list_T *l;
|
||||
listwatch_T *lw;
|
||||
***************
|
||||
*** 3119,3125 ****
|
||||
* Remove a watcher from a list.
|
||||
* No warning when it isn't found...
|
||||
*/
|
||||
! static void
|
||||
list_rem_watch(l, lwrem)
|
||||
list_T *l;
|
||||
listwatch_T *lwrem;
|
||||
--- 3117,3123 ----
|
||||
* Remove a watcher from a list.
|
||||
* No warning when it isn't found...
|
||||
*/
|
||||
! void
|
||||
list_rem_watch(l, lwrem)
|
||||
list_T *l;
|
||||
listwatch_T *lwrem;
|
||||
*** ../vim-7.3.946/src/if_py_both.h 2013-05-15 13:38:41.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 14:24:11.000000000 +0200
|
||||
***************
|
||||
*** 531,596 ****
|
||||
};
|
||||
|
||||
/*
|
||||
! * Buffer list object - Implementation
|
||||
*/
|
||||
|
||||
! static PyTypeObject BufMapType;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PyObject_HEAD
|
||||
! } BufMapObject;
|
||||
|
||||
! static PyInt
|
||||
! BufMapLength(PyObject *self UNUSED)
|
||||
{
|
||||
! buf_T *b = firstbuf;
|
||||
! PyInt n = 0;
|
||||
|
||||
! while (b)
|
||||
! {
|
||||
! ++n;
|
||||
! b = b->b_next;
|
||||
! }
|
||||
|
||||
! return n;
|
||||
}
|
||||
|
||||
! static PyObject *
|
||||
! BufMapItem(PyObject *self UNUSED, PyObject *keyObject)
|
||||
{
|
||||
! buf_T *b;
|
||||
! int bnr;
|
||||
|
||||
! #if PY_MAJOR_VERSION < 3
|
||||
! if (PyInt_Check(keyObject))
|
||||
! bnr = PyInt_AsLong(keyObject);
|
||||
! else
|
||||
! #endif
|
||||
! if (PyLong_Check(keyObject))
|
||||
! bnr = PyLong_AsLong(keyObject);
|
||||
! else
|
||||
! {
|
||||
! PyErr_SetString(PyExc_ValueError, _("key must be integer"));
|
||||
! return NULL;
|
||||
! }
|
||||
|
||||
! b = buflist_findnr(bnr);
|
||||
|
||||
! if (b)
|
||||
! return BufferNew(b);
|
||||
! else
|
||||
! {
|
||||
! PyErr_SetString(PyExc_KeyError, _("no such buffer"));
|
||||
! return NULL;
|
||||
! }
|
||||
}
|
||||
|
||||
! static PyMappingMethods BufMapAsMapping = {
|
||||
! (lenfunc) BufMapLength,
|
||||
! (binaryfunc) BufMapItem,
|
||||
! (objobjargproc) 0,
|
||||
! };
|
||||
|
||||
typedef struct pylinkedlist_S {
|
||||
struct pylinkedlist_S *pll_next;
|
||||
--- 531,592 ----
|
||||
};
|
||||
|
||||
/*
|
||||
! * Generic iterator object
|
||||
*/
|
||||
|
||||
! static PyTypeObject IterType;
|
||||
!
|
||||
! typedef PyObject *(*nextfun)(void **);
|
||||
! typedef void (*destructorfun)(void *);
|
||||
!
|
||||
! /* Main purpose of this object is removing the need for do python initialization
|
||||
! * (i.e. PyType_Ready and setting type attributes) for a big bunch of objects.
|
||||
! */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PyObject_HEAD
|
||||
! void *cur;
|
||||
! nextfun next;
|
||||
! destructorfun destruct;
|
||||
! } IterObject;
|
||||
|
||||
! static PyObject *
|
||||
! IterNew(void *start, destructorfun destruct, nextfun next)
|
||||
{
|
||||
! IterObject *self;
|
||||
|
||||
! self = PyObject_NEW(IterObject, &IterType);
|
||||
! self->cur = start;
|
||||
! self->next = next;
|
||||
! self->destruct = destruct;
|
||||
|
||||
! return (PyObject *)(self);
|
||||
}
|
||||
|
||||
! static void
|
||||
! IterDestructor(PyObject *self)
|
||||
{
|
||||
! IterObject *this = (IterObject *)(self);
|
||||
|
||||
! this->destruct(this->cur);
|
||||
|
||||
! DESTRUCTOR_FINISH(self);
|
||||
! }
|
||||
|
||||
! static PyObject *
|
||||
! IterNext(PyObject *self)
|
||||
! {
|
||||
! IterObject *this = (IterObject *)(self);
|
||||
!
|
||||
! return this->next(&this->cur);
|
||||
}
|
||||
|
||||
! static PyObject *
|
||||
! IterIter(PyObject *self)
|
||||
! {
|
||||
! return self;
|
||||
! }
|
||||
|
||||
typedef struct pylinkedlist_S {
|
||||
struct pylinkedlist_S *pll_next;
|
||||
***************
|
||||
*** 990,995 ****
|
||||
--- 986,1040 ----
|
||||
return list;
|
||||
}
|
||||
|
||||
+ typedef struct
|
||||
+ {
|
||||
+ listwatch_T lw;
|
||||
+ list_T *list;
|
||||
+ } listiterinfo_T;
|
||||
+
|
||||
+ static void
|
||||
+ ListIterDestruct(listiterinfo_T *lii)
|
||||
+ {
|
||||
+ list_rem_watch(lii->list, &lii->lw);
|
||||
+ PyMem_Free(lii);
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ ListIterNext(listiterinfo_T **lii)
|
||||
+ {
|
||||
+ PyObject *r;
|
||||
+
|
||||
+ if (!((*lii)->lw.lw_item))
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (!(r = ConvertToPyObject(&((*lii)->lw.lw_item->li_tv))))
|
||||
+ return NULL;
|
||||
+
|
||||
+ (*lii)->lw.lw_item = (*lii)->lw.lw_item->li_next;
|
||||
+
|
||||
+ return r;
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ ListIter(PyObject *self)
|
||||
+ {
|
||||
+ listiterinfo_T *lii;
|
||||
+ list_T *l = ((ListObject *) (self))->list;
|
||||
+
|
||||
+ if (!(lii = PyMem_New(listiterinfo_T, 1)))
|
||||
+ {
|
||||
+ PyErr_NoMemory();
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ list_add_watch(l, &lii->lw);
|
||||
+ lii->lw.lw_item = l->lv_first;
|
||||
+ lii->list = l;
|
||||
+
|
||||
+ return IterNew(lii,
|
||||
+ (destructorfun) ListIterDestruct, (nextfun) ListIterNext);
|
||||
+ }
|
||||
+
|
||||
static int
|
||||
ListAssItem(PyObject *self, Py_ssize_t index, PyObject *obj)
|
||||
{
|
||||
***************
|
||||
*** 2869,2874 ****
|
||||
--- 2914,3029 ----
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
+ /*
|
||||
+ * Buffer list object - Implementation
|
||||
+ */
|
||||
+
|
||||
+ static PyTypeObject BufMapType;
|
||||
+
|
||||
+ typedef struct
|
||||
+ {
|
||||
+ PyObject_HEAD
|
||||
+ } BufMapObject;
|
||||
+
|
||||
+ static PyInt
|
||||
+ BufMapLength(PyObject *self UNUSED)
|
||||
+ {
|
||||
+ buf_T *b = firstbuf;
|
||||
+ PyInt n = 0;
|
||||
+
|
||||
+ while (b)
|
||||
+ {
|
||||
+ ++n;
|
||||
+ b = b->b_next;
|
||||
+ }
|
||||
+
|
||||
+ return n;
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ BufMapItem(PyObject *self UNUSED, PyObject *keyObject)
|
||||
+ {
|
||||
+ buf_T *b;
|
||||
+ int bnr;
|
||||
+
|
||||
+ #if PY_MAJOR_VERSION < 3
|
||||
+ if (PyInt_Check(keyObject))
|
||||
+ bnr = PyInt_AsLong(keyObject);
|
||||
+ else
|
||||
+ #endif
|
||||
+ if (PyLong_Check(keyObject))
|
||||
+ bnr = PyLong_AsLong(keyObject);
|
||||
+ else
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_ValueError, _("key must be integer"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ b = buflist_findnr(bnr);
|
||||
+
|
||||
+ if (b)
|
||||
+ return BufferNew(b);
|
||||
+ else
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_KeyError, _("no such buffer"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static void
|
||||
+ BufMapIterDestruct(PyObject *buffer)
|
||||
+ {
|
||||
+ /* Iteration was stopped before all buffers were processed */
|
||||
+ if (buffer)
|
||||
+ {
|
||||
+ Py_DECREF(buffer);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ BufMapIterNext(PyObject **buffer)
|
||||
+ {
|
||||
+ PyObject *next;
|
||||
+ PyObject *r;
|
||||
+
|
||||
+ if (!*buffer)
|
||||
+ return NULL;
|
||||
+
|
||||
+ r = *buffer;
|
||||
+
|
||||
+ if (CheckBuffer((BufferObject *)(r)))
|
||||
+ {
|
||||
+ *buffer = NULL;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (!((BufferObject *)(r))->buf->b_next)
|
||||
+ next = NULL;
|
||||
+ else if (!(next = BufferNew(((BufferObject *)(r))->buf->b_next)))
|
||||
+ return NULL;
|
||||
+ *buffer = next;
|
||||
+ /* Do not increment reference: we no longer hold it (decref), but whoever on
|
||||
+ * other side will hold (incref). Decref+incref = nothing.
|
||||
+ */
|
||||
+ return r;
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ BufMapIter(PyObject *self UNUSED)
|
||||
+ {
|
||||
+ PyObject *buffer;
|
||||
+
|
||||
+ buffer = BufferNew(firstbuf);
|
||||
+ return IterNew(buffer,
|
||||
+ (destructorfun) BufMapIterDestruct, (nextfun) BufMapIterNext);
|
||||
+ }
|
||||
+
|
||||
+ static PyMappingMethods BufMapAsMapping = {
|
||||
+ (lenfunc) BufMapLength,
|
||||
+ (binaryfunc) BufMapItem,
|
||||
+ (objobjargproc) 0,
|
||||
+ };
|
||||
+
|
||||
/* Current items object
|
||||
*/
|
||||
|
||||
***************
|
||||
*** 3383,3388 ****
|
||||
--- 3538,3551 ----
|
||||
OutputType.tp_setattr = OutputSetattr;
|
||||
#endif
|
||||
|
||||
+ vim_memset(&IterType, 0, sizeof(IterType));
|
||||
+ IterType.tp_name = "vim.iter";
|
||||
+ IterType.tp_basicsize = sizeof(IterObject);
|
||||
+ IterType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
+ IterType.tp_doc = "generic iterator object";
|
||||
+ IterType.tp_iter = IterIter;
|
||||
+ IterType.tp_iternext = IterNext;
|
||||
+
|
||||
vim_memset(&BufferType, 0, sizeof(BufferType));
|
||||
BufferType.tp_name = "vim.buffer";
|
||||
BufferType.tp_basicsize = sizeof(BufferType);
|
||||
***************
|
||||
*** 3426,3431 ****
|
||||
--- 3589,3595 ----
|
||||
BufMapType.tp_basicsize = sizeof(BufMapObject);
|
||||
BufMapType.tp_as_mapping = &BufMapAsMapping;
|
||||
BufMapType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
+ BufMapType.tp_iter = BufMapIter;
|
||||
BufferType.tp_doc = "vim buffer list";
|
||||
|
||||
vim_memset(&WinListType, 0, sizeof(WinListType));
|
||||
***************
|
||||
*** 3492,3497 ****
|
||||
--- 3656,3662 ----
|
||||
ListType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
ListType.tp_doc = "list pushing modifications to vim structure";
|
||||
ListType.tp_methods = ListMethods;
|
||||
+ ListType.tp_iter = ListIter;
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
ListType.tp_getattro = ListGetattro;
|
||||
ListType.tp_setattro = ListSetattro;
|
||||
***************
|
||||
*** 3501,3507 ****
|
||||
#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;
|
||||
--- 3666,3672 ----
|
||||
#endif
|
||||
|
||||
vim_memset(&FunctionType, 0, sizeof(FunctionType));
|
||||
! FunctionType.tp_name = "vim.function";
|
||||
FunctionType.tp_basicsize = sizeof(FunctionObject);
|
||||
FunctionType.tp_dealloc = FunctionDestructor;
|
||||
FunctionType.tp_call = FunctionCall;
|
||||
*** ../vim-7.3.946/src/if_python3.c 2013-05-15 13:38:41.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 14:24:11.000000000 +0200
|
||||
***************
|
||||
*** 1519,1524 ****
|
||||
--- 1519,1525 ----
|
||||
/* The special value is removed from sys.path in Python3_Init(). */
|
||||
static wchar_t *(argv[2]) = {L"/must>not&exist/foo", NULL};
|
||||
|
||||
+ PyType_Ready(&IterType);
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
*** ../vim-7.3.946/src/if_python.c 2013-05-15 13:38:41.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 14:24:11.000000000 +0200
|
||||
***************
|
||||
*** 1219,1224 ****
|
||||
--- 1219,1225 ----
|
||||
static char *(argv[2]) = {"/must>not&exist/foo", NULL};
|
||||
|
||||
/* Fixups... */
|
||||
+ PyType_Ready(&IterType);
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
*** ../vim-7.3.946/src/proto/eval.pro 2013-05-06 03:52:44.000000000 +0200
|
||||
--- src/proto/eval.pro 2013-05-15 14:24:11.000000000 +0200
|
||||
***************
|
||||
*** 127,130 ****
|
||||
--- 127,132 ----
|
||||
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 *));
|
||||
+ void list_add_watch __ARGS((list_T *l, listwatch_T *lw));
|
||||
+ void list_rem_watch __ARGS((list_T *l, listwatch_T *lwrem));
|
||||
/* vim: set ft=c : */
|
||||
*** ../vim-7.3.946/src/testdir/test86.in 2013-05-12 21:16:17.000000000 +0200
|
||||
--- src/testdir/test86.in 2013-05-15 14:27:21.000000000 +0200
|
||||
***************
|
||||
*** 477,482 ****
|
||||
--- 477,485 ----
|
||||
: call RecVars(oname)
|
||||
:endfor
|
||||
:only
|
||||
+ :for buf in g:bufs[1:]
|
||||
+ : execute 'bwipeout!' buf
|
||||
+ :endfor
|
||||
:"
|
||||
:" Test buffer object
|
||||
:vnew
|
||||
***************
|
||||
*** 519,524 ****
|
||||
--- 522,583 ----
|
||||
# Should not happen in any case
|
||||
cb.append('No exception for ' + expr)
|
||||
EOF
|
||||
+ :"
|
||||
+ :" Test vim.buffers object
|
||||
+ :set hidden
|
||||
+ :edit a
|
||||
+ :buffer #
|
||||
+ :edit b
|
||||
+ :buffer #
|
||||
+ :edit c
|
||||
+ :buffer #
|
||||
+ py << EOF
|
||||
+ # Check GCing iterator that was not fully exhausted
|
||||
+ i = iter(vim.buffers)
|
||||
+ cb.append('i:' + str(next(i)))
|
||||
+ # and also check creating more then one iterator at a time
|
||||
+ i2 = iter(vim.buffers)
|
||||
+ cb.append('i2:' + str(next(i2)))
|
||||
+ cb.append('i:' + str(next(i)))
|
||||
+ # The following should trigger GC and not cause any problems
|
||||
+ del i
|
||||
+ del i2
|
||||
+ i3 = iter(vim.buffers)
|
||||
+ cb.append('i3:' + str(next(i3)))
|
||||
+ del i3
|
||||
+
|
||||
+ prevnum = 0
|
||||
+ for b in vim.buffers:
|
||||
+ # Check buffer order
|
||||
+ if prevnum >= b.number:
|
||||
+ cb.append('!!! Buffer numbers not in strictly ascending order')
|
||||
+ # Check indexing: vim.buffers[number].number == number
|
||||
+ cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + '=' + repr(b))
|
||||
+ prevnum = b.number
|
||||
+
|
||||
+ cb.append(str(len(vim.buffers)))
|
||||
+
|
||||
+ bnums = list(map(lambda b: b.number, vim.buffers))[1:]
|
||||
+
|
||||
+ # Test wiping out buffer with existing iterator
|
||||
+ i4 = iter(vim.buffers)
|
||||
+ cb.append('i4:' + str(next(i4)))
|
||||
+ vim.command('bwipeout! ' + str(bnums.pop(0)))
|
||||
+ try:
|
||||
+ next(i4)
|
||||
+ except vim.error:
|
||||
+ pass
|
||||
+ else:
|
||||
+ cb.append('!!!! No vim.error')
|
||||
+ i4 = iter(vim.buffers)
|
||||
+ vim.command('bwipeout! ' + str(bnums.pop(-1)))
|
||||
+ vim.command('bwipeout! ' + str(bnums.pop(-1)))
|
||||
+ cb.append('i4:' + str(next(i4)))
|
||||
+ try:
|
||||
+ next(i4)
|
||||
+ except StopIteration:
|
||||
+ cb.append('StopIteration')
|
||||
+ EOF
|
||||
:endfun
|
||||
:"
|
||||
:call Test()
|
||||
*** ../vim-7.3.946/src/testdir/test86.ok 2013-05-15 13:38:41.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-15 14:27:21.000000000 +0200
|
||||
***************
|
||||
*** 319,321 ****
|
||||
--- 319,333 ----
|
||||
Second line
|
||||
Third line
|
||||
foo
|
||||
+ i:<buffer test86.in>
|
||||
+ i2:<buffer test86.in>
|
||||
+ i:<buffer a>
|
||||
+ i3:<buffer test86.in>
|
||||
+ 1:<buffer test86.in>=<buffer test86.in>
|
||||
+ 6:<buffer a>=<buffer a>
|
||||
+ 7:<buffer b>=<buffer b>
|
||||
+ 8:<buffer c>=<buffer c>
|
||||
+ 4
|
||||
+ i4:<buffer test86.in>
|
||||
+ i4:<buffer test86.in>
|
||||
+ StopIteration
|
||||
*** ../vim-7.3.946/src/testdir/test87.in 2013-05-12 21:16:17.000000000 +0200
|
||||
--- src/testdir/test87.in 2013-05-15 14:27:21.000000000 +0200
|
||||
***************
|
||||
*** 446,451 ****
|
||||
--- 446,454 ----
|
||||
: call RecVars(oname)
|
||||
:endfor
|
||||
:only
|
||||
+ :for buf in g:bufs[1:]
|
||||
+ : execute 'bwipeout!' buf
|
||||
+ :endfor
|
||||
:"
|
||||
:" Test buffer object
|
||||
:vnew
|
||||
***************
|
||||
*** 488,493 ****
|
||||
--- 491,552 ----
|
||||
# Should not happen in any case
|
||||
cb.append('No exception for ' + expr)
|
||||
EOF
|
||||
+ :"
|
||||
+ :" Test vim.buffers object
|
||||
+ :set hidden
|
||||
+ :edit a
|
||||
+ :buffer #
|
||||
+ :edit b
|
||||
+ :buffer #
|
||||
+ :edit c
|
||||
+ :buffer #
|
||||
+ py3 << EOF
|
||||
+ # Check GCing iterator that was not fully exhausted
|
||||
+ i = iter(vim.buffers)
|
||||
+ cb.append('i:' + str(next(i)))
|
||||
+ # and also check creating more then one iterator at a time
|
||||
+ i2 = iter(vim.buffers)
|
||||
+ cb.append('i2:' + str(next(i2)))
|
||||
+ cb.append('i:' + str(next(i)))
|
||||
+ # The following should trigger GC and not cause any problems
|
||||
+ del i
|
||||
+ del i2
|
||||
+ i3 = iter(vim.buffers)
|
||||
+ cb.append('i3:' + str(next(i3)))
|
||||
+ del i3
|
||||
+
|
||||
+ prevnum = 0
|
||||
+ for b in vim.buffers:
|
||||
+ # Check buffer order
|
||||
+ if prevnum >= b.number:
|
||||
+ cb.append('!!! Buffer numbers not in strictly ascending order')
|
||||
+ # Check indexing: vim.buffers[number].number == number
|
||||
+ cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + '=' + repr(b))
|
||||
+ prevnum = b.number
|
||||
+
|
||||
+ cb.append(str(len(vim.buffers)))
|
||||
+
|
||||
+ bnums = list(map(lambda b: b.number, vim.buffers))[1:]
|
||||
+
|
||||
+ # Test wiping out buffer with existing iterator
|
||||
+ i4 = iter(vim.buffers)
|
||||
+ cb.append('i4:' + str(next(i4)))
|
||||
+ vim.command('bwipeout! ' + str(bnums.pop(0)))
|
||||
+ try:
|
||||
+ next(i4)
|
||||
+ except vim.error:
|
||||
+ pass
|
||||
+ else:
|
||||
+ cb.append('!!!! No vim.error')
|
||||
+ i4 = iter(vim.buffers)
|
||||
+ vim.command('bwipeout! ' + str(bnums.pop(-1)))
|
||||
+ vim.command('bwipeout! ' + str(bnums.pop(-1)))
|
||||
+ cb.append('i4:' + str(next(i4)))
|
||||
+ try:
|
||||
+ next(i4)
|
||||
+ except StopIteration:
|
||||
+ cb.append('StopIteration')
|
||||
+ EOF
|
||||
:endfun
|
||||
:"
|
||||
:call Test()
|
||||
***************
|
||||
*** 496,501 ****
|
||||
--- 555,561 ----
|
||||
:call garbagecollect(1)
|
||||
:"
|
||||
:/^start:/,$wq! test.out
|
||||
+ :call getchar()
|
||||
ENDTEST
|
||||
|
||||
start:
|
||||
*** ../vim-7.3.946/src/testdir/test87.ok 2013-05-15 13:38:41.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-15 14:27:21.000000000 +0200
|
||||
***************
|
||||
*** 308,310 ****
|
||||
--- 308,322 ----
|
||||
Second line
|
||||
Third line
|
||||
foo
|
||||
+ i:<buffer test87.in>
|
||||
+ i2:<buffer test87.in>
|
||||
+ i:<buffer a>
|
||||
+ i3:<buffer test87.in>
|
||||
+ 1:<buffer test87.in>=<buffer test87.in>
|
||||
+ 6:<buffer a>=<buffer a>
|
||||
+ 7:<buffer b>=<buffer b>
|
||||
+ 8:<buffer c>=<buffer c>
|
||||
+ 4
|
||||
+ i4:<buffer test87.in>
|
||||
+ i4:<buffer test87.in>
|
||||
+ StopIteration
|
||||
*** ../vim-7.3.946/src/version.c 2013-05-15 14:22:36.000000000 +0200
|
||||
--- src/version.c 2013-05-15 14:25:26.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 947,
|
||||
/**/
|
||||
|
||||
--
|
||||
"It's so simple to be wise. Just think of something stupid to say
|
||||
and then don't say it." -- Sam Levenson
|
||||
|
||||
/// 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 ///
|
423
7.3.948
Normal file
423
7.3.948
Normal file
@ -0,0 +1,423 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.948
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.948
|
||||
Problem: Cannot build with Python 2.2
|
||||
Solution: Make Python interface work with Python 2.2
|
||||
Make 2.2 the first supported version. (ZyX)
|
||||
Files: src/if_py_both.h, src/if_python3.c, src/if_python.c,
|
||||
src/testdir/test86.in, src/testdir/test86.ok,
|
||||
src/testdir/test87.ok, src/configure.in, src/auto/configure
|
||||
|
||||
|
||||
*** ../vim-7.3.947/src/if_py_both.h 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 14:49:11.000000000 +0200
|
||||
***************
|
||||
*** 564,569 ****
|
||||
--- 564,570 ----
|
||||
return (PyObject *)(self);
|
||||
}
|
||||
|
||||
+ #if 0 /* unused */
|
||||
static void
|
||||
IterDestructor(PyObject *self)
|
||||
{
|
||||
***************
|
||||
*** 573,578 ****
|
||||
--- 574,580 ----
|
||||
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
+ #endif
|
||||
|
||||
static PyObject *
|
||||
IterNext(PyObject *self)
|
||||
***************
|
||||
*** 696,708 ****
|
||||
}
|
||||
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;
|
||||
--- 698,704 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! if (PyObject_IsTrue(val))
|
||||
this->dict->dv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->dict->dv_lock = 0;
|
||||
***************
|
||||
*** 1202,1214 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! if (!PyBool_Check(val))
|
||||
! {
|
||||
! PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
|
||||
! return -1;
|
||||
! }
|
||||
!
|
||||
! if (val == Py_True)
|
||||
this->list->lv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->list->lv_lock = 0;
|
||||
--- 1198,1204 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! if (PyObject_IsTrue(val))
|
||||
this->list->lv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->list->lv_lock = 0;
|
||||
***************
|
||||
*** 1484,1497 ****
|
||||
|
||||
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)
|
||||
{
|
||||
--- 1474,1481 ----
|
||||
|
||||
if (flags & SOPT_BOOL)
|
||||
{
|
||||
! r = set_option_value_for(key, PyObject_IsTrue(valObject), NULL,
|
||||
! opt_flags, this->opt_type, this->from);
|
||||
}
|
||||
else if (flags & SOPT_NUM)
|
||||
{
|
||||
*** ../vim-7.3.947/src/if_python3.c 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 14:42:21.000000000 +0200
|
||||
***************
|
||||
*** 156,161 ****
|
||||
--- 156,162 ----
|
||||
# define PyMapping_Items py3_PyMapping_Items
|
||||
# define PyIter_Next py3_PyIter_Next
|
||||
# define PyObject_GetIter py3_PyObject_GetIter
|
||||
+ # define PyObject_IsTrue py3_PyObject_IsTrue
|
||||
# define PyModule_GetDict py3_PyModule_GetDict
|
||||
#undef PyRun_SimpleString
|
||||
# define PyRun_SimpleString py3_PyRun_SimpleString
|
||||
***************
|
||||
*** 264,269 ****
|
||||
--- 265,271 ----
|
||||
static PyObject* (*py3_PyDict_New)(void);
|
||||
static PyObject* (*py3_PyIter_Next)(PyObject *);
|
||||
static PyObject* (*py3_PyObject_GetIter)(PyObject *);
|
||||
+ static int (*py3_PyObject_IsTrue)(PyObject *);
|
||||
static PyObject* (*py3_Py_BuildValue)(char *, ...);
|
||||
static int (*py3_PyType_Ready)(PyTypeObject *type);
|
||||
static int (*py3_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
|
||||
***************
|
||||
*** 392,397 ****
|
||||
--- 394,400 ----
|
||||
{"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items},
|
||||
{"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
|
||||
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
|
||||
+ {"PyObject_IsTrue", (PYTHON_PROC*)&py3_PyObject_IsTrue},
|
||||
{"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
|
||||
{"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
|
||||
{"PyType_Ready", (PYTHON_PROC*)&py3_PyType_Ready},
|
||||
*** ../vim-7.3.947/src/if_python.c 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 14:42:21.000000000 +0200
|
||||
***************
|
||||
*** 229,234 ****
|
||||
--- 229,235 ----
|
||||
# define _Py_TrueStruct (*dll__Py_TrueStruct)
|
||||
# define PyObject_Init dll__PyObject_Init
|
||||
# define PyObject_GetIter dll_PyObject_GetIter
|
||||
+ # define PyObject_IsTrue dll_PyObject_IsTrue
|
||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
|
||||
# define PyType_IsSubtype dll_PyType_IsSubtype
|
||||
# endif
|
||||
***************
|
||||
*** 324,329 ****
|
||||
--- 325,331 ----
|
||||
static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
|
||||
static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
|
||||
static PyObject* (*dll_PyObject_GetIter)(PyObject *);
|
||||
+ static int (*dll_PyObject_IsTrue)(PyObject *);
|
||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
|
||||
static iternextfunc dll__PyObject_NextNotImplemented;
|
||||
# endif
|
||||
***************
|
||||
*** 459,464 ****
|
||||
--- 461,467 ----
|
||||
{"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
|
||||
{"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
|
||||
{"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter},
|
||||
+ {"PyObject_IsTrue", (PYTHON_PROC*)&dll_PyObject_IsTrue},
|
||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
|
||||
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
|
||||
# endif
|
||||
***************
|
||||
*** 787,793 ****
|
||||
* so the following does both: unlock GIL and save thread state in TLS
|
||||
* without deleting thread state
|
||||
*/
|
||||
! PyEval_SaveThread();
|
||||
|
||||
initialised = 1;
|
||||
}
|
||||
--- 790,799 ----
|
||||
* so the following does both: unlock GIL and save thread state in TLS
|
||||
* without deleting thread state
|
||||
*/
|
||||
! #ifndef PY_CAN_RECURSE
|
||||
! saved_python_thread =
|
||||
! #endif
|
||||
! PyEval_SaveThread();
|
||||
|
||||
initialised = 1;
|
||||
}
|
||||
*** ../vim-7.3.947/src/testdir/test86.in 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/testdir/test86.in 2013-05-15 14:42:21.000000000 +0200
|
||||
***************
|
||||
*** 183,220 ****
|
||||
: $put ='[0.0, 0.0]'
|
||||
:endif
|
||||
:let messages=[]
|
||||
! :py <<EOF
|
||||
d=vim.bindeval('{}')
|
||||
m=vim.bindeval('messages')
|
||||
! try:
|
||||
! d['abc']
|
||||
! except Exception as e:
|
||||
! m.extend([e.__class__.__name__])
|
||||
!
|
||||
! try:
|
||||
! d['abc']="\0"
|
||||
! except Exception as e:
|
||||
! m.extend([e.__class__.__name__])
|
||||
!
|
||||
! try:
|
||||
! d['abc']=vim
|
||||
! except Exception as e:
|
||||
! m.extend([e.__class__.__name__])
|
||||
!
|
||||
! try:
|
||||
! d['']=1
|
||||
! except Exception as e:
|
||||
! m.extend([e.__class__.__name__])
|
||||
!
|
||||
! try:
|
||||
! d['a\0b']=1
|
||||
! except Exception as e:
|
||||
! m.extend([e.__class__.__name__])
|
||||
!
|
||||
! try:
|
||||
! d[b'a\0b']=1
|
||||
! except Exception as e:
|
||||
! m.extend([e.__class__.__name__])
|
||||
EOF
|
||||
:$put =messages
|
||||
:unlet messages
|
||||
--- 183,203 ----
|
||||
: $put ='[0.0, 0.0]'
|
||||
:endif
|
||||
:let messages=[]
|
||||
! py <<EOF
|
||||
d=vim.bindeval('{}')
|
||||
m=vim.bindeval('messages')
|
||||
! def em(expr, g=globals(), l=locals()):
|
||||
! try:
|
||||
! exec(expr, g, l)
|
||||
! except:
|
||||
! m.extend([sys.exc_type.__name__])
|
||||
!
|
||||
! em('d["abc"]')
|
||||
! em('d["abc"]="\\0"')
|
||||
! em('d["abc"]=vim')
|
||||
! em('d[""]=1')
|
||||
! em('d["a\\0b"]=1')
|
||||
! em('d[u"a\\0b"]=1')
|
||||
EOF
|
||||
:$put =messages
|
||||
:unlet messages
|
||||
***************
|
||||
*** 394,407 ****
|
||||
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)
|
||||
--- 377,390 ----
|
||||
def e(s, g=globals(), l=locals()):
|
||||
try:
|
||||
exec(s, g, l)
|
||||
! except:
|
||||
! vim.command('throw ' + repr(sys.exc_type.__name__))
|
||||
|
||||
def ev(s, g=globals(), l=locals()):
|
||||
try:
|
||||
return eval(s, g, l)
|
||||
! except:
|
||||
! vim.command('throw ' + repr(sys.exc_type.__name__))
|
||||
return 0
|
||||
EOF
|
||||
:function E(s)
|
||||
*** ../vim-7.3.947/src/testdir/test86.ok 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-15 14:42:21.000000000 +0200
|
||||
***************
|
||||
*** 82,88 ****
|
||||
bar
|
||||
>>> paste
|
||||
p/gopts1: False
|
||||
- inv: 2! ValueError
|
||||
p/wopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
wopts1! KeyError
|
||||
--- 82,87 ----
|
||||
***************
|
||||
*** 224,230 ****
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: False
|
||||
- inv: 2! ValueError
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
--- 223,228 ----
|
||||
***************
|
||||
*** 280,286 ****
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: False
|
||||
- inv: 2! ValueError
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
--- 278,283 ----
|
||||
*** ../vim-7.3.947/src/testdir/test87.ok 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-15 14:42:21.000000000 +0200
|
||||
***************
|
||||
*** 71,77 ****
|
||||
bar
|
||||
>>> paste
|
||||
p/gopts1: False
|
||||
- inv: 2! ValueError
|
||||
p/wopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
wopts1! KeyError
|
||||
--- 71,76 ----
|
||||
***************
|
||||
*** 213,219 ****
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: False
|
||||
- inv: 2! ValueError
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
--- 212,217 ----
|
||||
***************
|
||||
*** 269,275 ****
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: False
|
||||
- inv: 2! ValueError
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
--- 267,272 ----
|
||||
*** ../vim-7.3.947/src/configure.in 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/configure.in 2013-05-15 14:46:11.000000000 +0200
|
||||
***************
|
||||
*** 863,872 ****
|
||||
${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
|
||||
]])
|
||||
|
||||
! dnl -- it must be at least version 1.4
|
||||
! AC_MSG_CHECKING(Python is 1.4 or better)
|
||||
if ${vi_cv_path_python} -c \
|
||||
! "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
|
||||
then
|
||||
AC_MSG_RESULT(yep)
|
||||
|
||||
--- 863,872 ----
|
||||
${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
|
||||
]])
|
||||
|
||||
! dnl -- it must be at least version 2.2
|
||||
! AC_MSG_CHECKING(Python is 2.2 or better)
|
||||
if ${vi_cv_path_python} -c \
|
||||
! "import sys; sys.exit(${vi_cv_var_python_version} < 2.2)"
|
||||
then
|
||||
AC_MSG_RESULT(yep)
|
||||
|
||||
*** ../vim-7.3.947/src/auto/configure 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/auto/configure 2013-05-15 14:46:28.000000000 +0200
|
||||
***************
|
||||
*** 5289,5298 ****
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5
|
||||
$as_echo "$vi_cv_var_python_version" >&6; }
|
||||
|
||||
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 1.4 or better" >&5
|
||||
! $as_echo_n "checking Python is 1.4 or better... " >&6; }
|
||||
if ${vi_cv_path_python} -c \
|
||||
! "import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
|
||||
then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5
|
||||
$as_echo "yep" >&6; }
|
||||
--- 5289,5298 ----
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5
|
||||
$as_echo "$vi_cv_var_python_version" >&6; }
|
||||
|
||||
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 2.2 or better" >&5
|
||||
! $as_echo_n "checking Python is 2.2 or better... " >&6; }
|
||||
if ${vi_cv_path_python} -c \
|
||||
! "import sys; sys.exit(${vi_cv_var_python_version} < 2.2)"
|
||||
then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5
|
||||
$as_echo "yep" >&6; }
|
||||
*** ../vim-7.3.947/src/version.c 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/version.c 2013-05-15 14:43:39.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 948,
|
||||
/**/
|
||||
|
||||
--
|
||||
MARTHA'S WAY: Don't throw out all that leftover wine. Freeze into ice cubes
|
||||
for future use in casseroles and sauces.
|
||||
MY WAY: What leftover wine?
|
||||
|
||||
/// 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 ///
|
919
7.3.949
Normal file
919
7.3.949
Normal file
@ -0,0 +1,919 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.949
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.949
|
||||
Problem: Python: no easy access to tabpages.
|
||||
Solution: Add vim.tabpages and vim.current.tabpage. (ZyX)
|
||||
Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c,
|
||||
src/if_python.c, src/proto/if_python3.pro,
|
||||
src/proto/if_python.pro, src/proto/window.pro, src/structs.h,
|
||||
src/window.c
|
||||
|
||||
|
||||
*** ../vim-7.3.948/runtime/doc/if_pyth.txt 2013-05-15 14:39:47.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 223,228 ****
|
||||
--- 223,242 ----
|
||||
:py w in vim.windows # Membership test
|
||||
:py n = len(vim.windows) # Number of elements
|
||||
:py for w in vim.windows: # Sequential access
|
||||
+ < Note: vim.windows object always accesses current tab page,.
|
||||
+ |python-tabpage|.windows objects are bound to parent |python-tabpage|
|
||||
+ object and always use windows from that tab page (or throw vim.error
|
||||
+ in case tab page was deleted). You can keep a reference to both
|
||||
+ without keeping a reference to vim module object or |python-tabpage|,
|
||||
+ they will not loose their properties in this case.
|
||||
+
|
||||
+ vim.tabpages *python-tabpages*
|
||||
+ A sequence object providing access to the list of vim tab pages. The
|
||||
+ object supports the following operations: >
|
||||
+ :py t = vim.tabpages[i] # Indexing (read-only)
|
||||
+ :py t in vim.tabpages # Membership test
|
||||
+ :py n = len(vim.tabpages) # Number of elements
|
||||
+ :py for t in vim.tabpages: # Sequential access
|
||||
<
|
||||
vim.current *python-current*
|
||||
An object providing access (via specific attributes) to various
|
||||
***************
|
||||
*** 230,235 ****
|
||||
--- 244,250 ----
|
||||
vim.current.line The current line (RW) String
|
||||
vim.current.buffer The current buffer (RO) Buffer
|
||||
vim.current.window The current window (RO) Window
|
||||
+ vim.current.tabpage The current tab page (RO) TabPage
|
||||
vim.current.range The current line range (RO) Range
|
||||
|
||||
The last case deserves a little explanation. When the :python or
|
||||
***************
|
||||
*** 375,380 ****
|
||||
--- 390,397 ----
|
||||
Window objects represent vim windows. You can obtain them in a number of ways:
|
||||
- via vim.current.window (|python-current|)
|
||||
- from indexing vim.windows (|python-windows|)
|
||||
+ - from indexing "windows" attribute of a tab page (|python-tabpage|)
|
||||
+ - from the "window" attribute of a tab page (|python-tabpage|)
|
||||
|
||||
You can manipulate window objects only through their attributes. They have no
|
||||
methods, and no sequence or other interface.
|
||||
***************
|
||||
*** 407,412 ****
|
||||
--- 424,447 ----
|
||||
The width attribute is writable only if the screen is split vertically.
|
||||
|
||||
==============================================================================
|
||||
+ 6. Tab page objects *python-tabpage*
|
||||
+
|
||||
+ Tab page objects represent vim tab pages. You can obtain them in a number of
|
||||
+ ways:
|
||||
+ - via vim.current.tabpage (|python-current|)
|
||||
+ - from indexing vim.tabpages (|python-tabpages|)
|
||||
+
|
||||
+ You can use this object to access tab page windows. They have no methods and
|
||||
+ no sequence or other interfaces.
|
||||
+
|
||||
+ Tab page attributes are:
|
||||
+ number The tab page number like the one returned by
|
||||
+ |tabpagenr()|.
|
||||
+ windows Like |python-windows|, but for current tab page.
|
||||
+ vars The tab page |t:| variables.
|
||||
+ window Current tabpage window.
|
||||
+
|
||||
+ ==============================================================================
|
||||
6. pyeval() and py3eval() Vim functions *python-pyeval*
|
||||
|
||||
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
|
||||
*** ../vim-7.3.948/src/if_py_both.h 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 15:10:16.000000000 +0200
|
||||
***************
|
||||
*** 27,32 ****
|
||||
--- 27,33 ----
|
||||
|
||||
#define INVALID_BUFFER_VALUE ((buf_T *)(-1))
|
||||
#define INVALID_WINDOW_VALUE ((win_T *)(-1))
|
||||
+ #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1))
|
||||
|
||||
static int ConvertFromPyObject(PyObject *, typval_T *);
|
||||
static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *);
|
||||
***************
|
||||
*** 1579,1584 ****
|
||||
--- 1580,1734 ----
|
||||
(objobjargproc) OptionsAssItem,
|
||||
};
|
||||
|
||||
+ /* Tabpage object
|
||||
+ */
|
||||
+
|
||||
+ typedef struct
|
||||
+ {
|
||||
+ PyObject_HEAD
|
||||
+ tabpage_T *tab;
|
||||
+ } TabPageObject;
|
||||
+
|
||||
+ static PyObject *WinListNew(TabPageObject *tabObject);
|
||||
+
|
||||
+ static PyTypeObject TabPageType;
|
||||
+
|
||||
+ static int
|
||||
+ CheckTabPage(TabPageObject *this)
|
||||
+ {
|
||||
+ if (this->tab == INVALID_TABPAGE_VALUE)
|
||||
+ {
|
||||
+ PyErr_SetVim(_("attempt to refer to deleted tab page"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ TabPageNew(tabpage_T *tab)
|
||||
+ {
|
||||
+ TabPageObject *self;
|
||||
+
|
||||
+ if (TAB_PYTHON_REF(tab))
|
||||
+ {
|
||||
+ self = TAB_PYTHON_REF(tab);
|
||||
+ Py_INCREF(self);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ self = PyObject_NEW(TabPageObject, &TabPageType);
|
||||
+ if (self == NULL)
|
||||
+ return NULL;
|
||||
+ self->tab = tab;
|
||||
+ TAB_PYTHON_REF(tab) = self;
|
||||
+ }
|
||||
+
|
||||
+ return (PyObject *)(self);
|
||||
+ }
|
||||
+
|
||||
+ static void
|
||||
+ TabPageDestructor(PyObject *self)
|
||||
+ {
|
||||
+ TabPageObject *this = (TabPageObject *)(self);
|
||||
+
|
||||
+ if (this->tab && this->tab != INVALID_TABPAGE_VALUE)
|
||||
+ TAB_PYTHON_REF(this->tab) = NULL;
|
||||
+
|
||||
+ DESTRUCTOR_FINISH(self);
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ TabPageAttr(TabPageObject *this, char *name)
|
||||
+ {
|
||||
+ if (strcmp(name, "windows") == 0)
|
||||
+ return WinListNew(this);
|
||||
+ else if (strcmp(name, "number") == 0)
|
||||
+ return PyLong_FromLong((long) get_tab_number(this->tab));
|
||||
+ else if (strcmp(name, "vars") == 0)
|
||||
+ return DictionaryNew(this->tab->tp_vars);
|
||||
+ else if (strcmp(name, "window") == 0)
|
||||
+ {
|
||||
+ /* For current tab window.c does not bother to set or update tp_curwin
|
||||
+ */
|
||||
+ if (this->tab == curtab)
|
||||
+ return WindowNew(curwin);
|
||||
+ else
|
||||
+ return WindowNew(this->tab->tp_curwin);
|
||||
+ }
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ TabPageRepr(PyObject *self)
|
||||
+ {
|
||||
+ static char repr[100];
|
||||
+ TabPageObject *this = (TabPageObject *)(self);
|
||||
+
|
||||
+ if (this->tab == INVALID_TABPAGE_VALUE)
|
||||
+ {
|
||||
+ vim_snprintf(repr, 100, _("<tabpage object (deleted) at %p>"), (self));
|
||||
+ return PyString_FromString(repr);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ int t = get_tab_number(this->tab);
|
||||
+
|
||||
+ if (t == 0)
|
||||
+ vim_snprintf(repr, 100, _("<tabpage object (unknown) at %p>"),
|
||||
+ (self));
|
||||
+ else
|
||||
+ vim_snprintf(repr, 100, _("<tabpage %d>"), t - 1);
|
||||
+
|
||||
+ return PyString_FromString(repr);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static struct PyMethodDef TabPageMethods[] = {
|
||||
+ /* name, function, calling, documentation */
|
||||
+ { NULL, NULL, 0, NULL }
|
||||
+ };
|
||||
+
|
||||
+ /*
|
||||
+ * Window list object
|
||||
+ */
|
||||
+
|
||||
+ static PyTypeObject TabListType;
|
||||
+ static PySequenceMethods TabListAsSeq;
|
||||
+
|
||||
+ typedef struct
|
||||
+ {
|
||||
+ PyObject_HEAD
|
||||
+ } TabListObject;
|
||||
+
|
||||
+ static PyInt
|
||||
+ TabListLength(PyObject *self UNUSED)
|
||||
+ {
|
||||
+ tabpage_T *tp = first_tabpage;
|
||||
+ PyInt n = 0;
|
||||
+
|
||||
+ while (tp != NULL)
|
||||
+ {
|
||||
+ ++n;
|
||||
+ tp = tp->tp_next;
|
||||
+ }
|
||||
+
|
||||
+ return n;
|
||||
+ }
|
||||
+
|
||||
+ static PyObject *
|
||||
+ TabListItem(PyObject *self UNUSED, PyInt n)
|
||||
+ {
|
||||
+ tabpage_T *tp;
|
||||
+
|
||||
+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, --n)
|
||||
+ if (n == 0)
|
||||
+ return TabPageNew(tp);
|
||||
+
|
||||
+ PyErr_SetString(PyExc_IndexError, _("no such tab page"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
/* Window object
|
||||
*/
|
||||
|
||||
***************
|
||||
*** 1588,1595 ****
|
||||
win_T *win;
|
||||
} WindowObject;
|
||||
|
||||
- static int WindowSetattr(PyObject *, char *, PyObject *);
|
||||
- static PyObject *WindowRepr(PyObject *);
|
||||
static PyTypeObject WindowType;
|
||||
|
||||
static int
|
||||
--- 1738,1743 ----
|
||||
***************
|
||||
*** 1681,1687 ****
|
||||
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("[ssssssss]", "buffer", "cursor", "height", "vars",
|
||||
"options", "number", "row", "col");
|
||||
--- 1829,1835 ----
|
||||
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, firstwin));
|
||||
else if (strcmp(name,"__members__") == 0)
|
||||
return Py_BuildValue("[ssssssss]", "buffer", "cursor", "height", "vars",
|
||||
"options", "number", "row", "col");
|
||||
***************
|
||||
*** 1797,1803 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! int w = get_win_number(this->win);
|
||||
|
||||
if (w == 0)
|
||||
vim_snprintf(repr, 100, _("<window object (unknown) at %p>"),
|
||||
--- 1945,1951 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! int w = get_win_number(this->win, firstwin);
|
||||
|
||||
if (w == 0)
|
||||
vim_snprintf(repr, 100, _("<window object (unknown) at %p>"),
|
||||
***************
|
||||
*** 1824,1837 ****
|
||||
typedef struct
|
||||
{
|
||||
PyObject_HEAD
|
||||
} WinListObject;
|
||||
|
||||
static PyInt
|
||||
! WinListLength(PyObject *self UNUSED)
|
||||
{
|
||||
! win_T *w = firstwin;
|
||||
PyInt n = 0;
|
||||
|
||||
while (w != NULL)
|
||||
{
|
||||
++n;
|
||||
--- 1972,2030 ----
|
||||
typedef struct
|
||||
{
|
||||
PyObject_HEAD
|
||||
+ TabPageObject *tabObject;
|
||||
} WinListObject;
|
||||
|
||||
+ static PyObject *
|
||||
+ WinListNew(TabPageObject *tabObject)
|
||||
+ {
|
||||
+ WinListObject *self;
|
||||
+
|
||||
+ self = PyObject_NEW(WinListObject, &WinListType);
|
||||
+ self->tabObject = tabObject;
|
||||
+ Py_INCREF(tabObject);
|
||||
+
|
||||
+ return (PyObject *)(self);
|
||||
+ }
|
||||
+
|
||||
+ static void
|
||||
+ WinListDestructor(PyObject *self)
|
||||
+ {
|
||||
+ TabPageObject *tabObject = ((WinListObject *)(self))->tabObject;
|
||||
+
|
||||
+ if (tabObject)
|
||||
+ Py_DECREF((PyObject *)(tabObject));
|
||||
+
|
||||
+ DESTRUCTOR_FINISH(self);
|
||||
+ }
|
||||
+
|
||||
+ static win_T *
|
||||
+ get_firstwin(WinListObject *this)
|
||||
+ {
|
||||
+ if (this->tabObject)
|
||||
+ {
|
||||
+ if (CheckTabPage(this->tabObject))
|
||||
+ return NULL;
|
||||
+ /* For current tab window.c does not bother to set or update tp_firstwin
|
||||
+ */
|
||||
+ else if (this->tabObject->tab == curtab)
|
||||
+ return firstwin;
|
||||
+ else
|
||||
+ return this->tabObject->tab->tp_firstwin;
|
||||
+ }
|
||||
+ else
|
||||
+ return firstwin;
|
||||
+ }
|
||||
+
|
||||
static PyInt
|
||||
! WinListLength(PyObject *self)
|
||||
{
|
||||
! win_T *w;
|
||||
PyInt n = 0;
|
||||
|
||||
+ if (!(w = get_firstwin((WinListObject *)(self))))
|
||||
+ return -1;
|
||||
+
|
||||
while (w != NULL)
|
||||
{
|
||||
++n;
|
||||
***************
|
||||
*** 1842,1852 ****
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
! WinListItem(PyObject *self UNUSED, PyInt n)
|
||||
{
|
||||
win_T *w;
|
||||
|
||||
! for (w = firstwin; w != NULL; w = W_NEXT(w), --n)
|
||||
if (n == 0)
|
||||
return WindowNew(w);
|
||||
|
||||
--- 2035,2048 ----
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
! WinListItem(PyObject *self, PyInt n)
|
||||
{
|
||||
win_T *w;
|
||||
|
||||
! if (!(w = get_firstwin((WinListObject *)(self))))
|
||||
! return NULL;
|
||||
!
|
||||
! for (; w != NULL; w = W_NEXT(w), --n)
|
||||
if (n == 0)
|
||||
return WindowNew(w);
|
||||
|
||||
***************
|
||||
*** 3018,3029 ****
|
||||
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);
|
||||
--- 3214,3228 ----
|
||||
return (PyObject *)BufferNew(curbuf);
|
||||
else if (strcmp(name, "window") == 0)
|
||||
return (PyObject *)WindowNew(curwin);
|
||||
+ else if (strcmp(name, "tabpage") == 0)
|
||||
+ return (PyObject *)TabPageNew(curtab);
|
||||
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("[sssss]", "buffer", "window", "line", "range",
|
||||
! "tabpage");
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_AttributeError, name);
|
||||
***************
|
||||
*** 3568,3573 ****
|
||||
--- 3767,3789 ----
|
||||
WindowType.tp_setattr = WindowSetattr;
|
||||
#endif
|
||||
|
||||
+ vim_memset(&TabPageType, 0, sizeof(TabPageType));
|
||||
+ TabPageType.tp_name = "vim.tabpage";
|
||||
+ TabPageType.tp_basicsize = sizeof(TabPageObject);
|
||||
+ TabPageType.tp_dealloc = TabPageDestructor;
|
||||
+ TabPageType.tp_repr = TabPageRepr;
|
||||
+ TabPageType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
+ TabPageType.tp_doc = "vim tab page object";
|
||||
+ TabPageType.tp_methods = TabPageMethods;
|
||||
+ #if PY_MAJOR_VERSION >= 3
|
||||
+ TabPageType.tp_getattro = TabPageGetattro;
|
||||
+ TabPageType.tp_alloc = call_PyType_GenericAlloc;
|
||||
+ TabPageType.tp_new = call_PyType_GenericNew;
|
||||
+ TabPageType.tp_free = call_PyObject_Free;
|
||||
+ #else
|
||||
+ TabPageType.tp_getattr = TabPageGetattr;
|
||||
+ #endif
|
||||
+
|
||||
vim_memset(&BufMapType, 0, sizeof(BufMapType));
|
||||
BufMapType.tp_name = "vim.bufferlist";
|
||||
BufMapType.tp_basicsize = sizeof(BufMapObject);
|
||||
***************
|
||||
*** 3582,3587 ****
|
||||
--- 3798,3811 ----
|
||||
WinListType.tp_as_sequence = &WinListAsSeq;
|
||||
WinListType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
WinListType.tp_doc = "vim window list";
|
||||
+ WinListType.tp_dealloc = WinListDestructor;
|
||||
+
|
||||
+ vim_memset(&TabListType, 0, sizeof(TabListType));
|
||||
+ TabListType.tp_name = "vim.tabpagelist";
|
||||
+ TabListType.tp_basicsize = sizeof(TabListType);
|
||||
+ TabListType.tp_as_sequence = &TabListAsSeq;
|
||||
+ TabListType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
+ TabListType.tp_doc = "vim tab page list";
|
||||
|
||||
vim_memset(&RangeType, 0, sizeof(RangeType));
|
||||
RangeType.tp_name = "vim.range";
|
||||
*** ../vim-7.3.948/src/if_python3.c 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 626,631 ****
|
||||
--- 626,632 ----
|
||||
|
||||
#define WIN_PYTHON_REF(win) win->w_python3_ref
|
||||
#define BUF_PYTHON_REF(buf) buf->b_python3_ref
|
||||
+ #define TAB_PYTHON_REF(tab) tab->tp_python3_ref
|
||||
|
||||
static void
|
||||
call_PyObject_Free(void *p)
|
||||
***************
|
||||
*** 652,657 ****
|
||||
--- 653,659 ----
|
||||
static PyObject *OutputGetattro(PyObject *, PyObject *);
|
||||
static int OutputSetattro(PyObject *, PyObject *, PyObject *);
|
||||
static PyObject *BufferGetattro(PyObject *, PyObject *);
|
||||
+ static PyObject *TabPageGetattro(PyObject *, PyObject *);
|
||||
static PyObject *WindowGetattro(PyObject *, PyObject *);
|
||||
static int WindowSetattro(PyObject *, PyObject *, PyObject *);
|
||||
static PyObject *RangeGetattro(PyObject *, PyObject *);
|
||||
***************
|
||||
*** 1275,1280 ****
|
||||
--- 1277,1302 ----
|
||||
}
|
||||
}
|
||||
|
||||
+ /* TabPage object - Implementation
|
||||
+ */
|
||||
+
|
||||
+ static PyObject *
|
||||
+ TabPageGetattro(PyObject *self, PyObject *nameobj)
|
||||
+ {
|
||||
+ PyObject *r;
|
||||
+
|
||||
+ GET_ATTR_STRING(name, nameobj);
|
||||
+
|
||||
+ if (CheckTabPage((TabPageObject *)(self)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ r = TabPageAttr((TabPageObject *)(self), name);
|
||||
+ if (r || PyErr_Occurred())
|
||||
+ return r;
|
||||
+ else
|
||||
+ return PyObject_GenericGetAttr(self, nameobj);
|
||||
+ }
|
||||
+
|
||||
/* Window object - Implementation
|
||||
*/
|
||||
|
||||
***************
|
||||
*** 1303,1308 ****
|
||||
--- 1325,1346 ----
|
||||
return WindowSetattr(self, name, val);
|
||||
}
|
||||
|
||||
+ /* Tab page list object - Definitions
|
||||
+ */
|
||||
+
|
||||
+ static PySequenceMethods TabListAsSeq = {
|
||||
+ (lenfunc) TabListLength, /* sq_length, len(x) */
|
||||
+ (binaryfunc) 0, /* sq_concat, x+y */
|
||||
+ (ssizeargfunc) 0, /* sq_repeat, x*n */
|
||||
+ (ssizeargfunc) TabListItem, /* sq_item, x[i] */
|
||||
+ 0, /* sq_slice, x[i:j] */
|
||||
+ (ssizeobjargproc)0, /* sq_as_item, x[i]=v */
|
||||
+ 0, /* sq_ass_slice, x[i:j]=v */
|
||||
+ 0, /* sq_contains */
|
||||
+ 0, /* sq_inplace_concat */
|
||||
+ 0, /* sq_inplace_repeat */
|
||||
+ };
|
||||
+
|
||||
/* Window list object - Definitions
|
||||
*/
|
||||
|
||||
***************
|
||||
*** 1497,1502 ****
|
||||
--- 1535,1551 ----
|
||||
WIN_PYTHON_REF(win) = NULL;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ void
|
||||
+ python3_tabpage_free(tabpage_T *tab)
|
||||
+ {
|
||||
+ if (TAB_PYTHON_REF(tab) != NULL)
|
||||
+ {
|
||||
+ TabPageObject *tp = TAB_PYTHON_REF(tab);
|
||||
+ tp->tab = INVALID_TABPAGE_VALUE;
|
||||
+ TAB_PYTHON_REF(tab) = NULL;
|
||||
+ }
|
||||
+ }
|
||||
#endif
|
||||
|
||||
static BufMapObject TheBufferMap =
|
||||
***************
|
||||
*** 1507,1512 ****
|
||||
--- 1556,1562 ----
|
||||
static WinListObject TheWindowList =
|
||||
{
|
||||
PyObject_HEAD_INIT(&WinListType)
|
||||
+ NULL
|
||||
};
|
||||
|
||||
static CurrentObject TheCurrent =
|
||||
***************
|
||||
*** 1514,1519 ****
|
||||
--- 1564,1574 ----
|
||||
PyObject_HEAD_INIT(&CurrentType)
|
||||
};
|
||||
|
||||
+ static TabListObject TheTabPageList =
|
||||
+ {
|
||||
+ PyObject_HEAD_INIT(&TabListType)
|
||||
+ };
|
||||
+
|
||||
static PyObject *
|
||||
Py3Init_vim(void)
|
||||
{
|
||||
***************
|
||||
*** 1526,1533 ****
|
||||
--- 1581,1590 ----
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
+ PyType_Ready(&TabPageType);
|
||||
PyType_Ready(&BufMapType);
|
||||
PyType_Ready(&WinListType);
|
||||
+ PyType_Ready(&TabListType);
|
||||
PyType_Ready(&CurrentType);
|
||||
PyType_Ready(&DictionaryType);
|
||||
PyType_Ready(&ListType);
|
||||
***************
|
||||
*** 1551,1556 ****
|
||||
--- 1608,1615 ----
|
||||
PyModule_AddObject(mod, "current", (PyObject *)(void *)&TheCurrent);
|
||||
Py_INCREF((PyObject *)(void *)&TheWindowList);
|
||||
PyModule_AddObject(mod, "windows", (PyObject *)(void *)&TheWindowList);
|
||||
+ Py_INCREF((PyObject *)(void *)&TheTabPageList);
|
||||
+ PyModule_AddObject(mod, "tabpages", (PyObject *)(void *)&TheTabPageList);
|
||||
|
||||
PyModule_AddObject(mod, "vars", DictionaryNew(&globvardict));
|
||||
PyModule_AddObject(mod, "vvars", DictionaryNew(&vimvardict));
|
||||
*** ../vim-7.3.948/src/if_python.c 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 624,633 ****
|
||||
--- 624,635 ----
|
||||
|
||||
#define WIN_PYTHON_REF(win) win->w_python_ref
|
||||
#define BUF_PYTHON_REF(buf) buf->b_python_ref
|
||||
+ #define TAB_PYTHON_REF(tab) tab->tp_python_ref
|
||||
|
||||
static PyObject *OutputGetattr(PyObject *, char *);
|
||||
static PyObject *BufferGetattr(PyObject *, char *);
|
||||
static PyObject *WindowGetattr(PyObject *, char *);
|
||||
+ static PyObject *TabPageGetattr(PyObject *, char *);
|
||||
static PyObject *RangeGetattr(PyObject *, char *);
|
||||
static PyObject *DictionaryGetattr(PyObject *, char*);
|
||||
static PyObject *ListGetattr(PyObject *, char *);
|
||||
***************
|
||||
*** 1137,1142 ****
|
||||
--- 1139,1162 ----
|
||||
&((RangeObject *)(self))->end);
|
||||
}
|
||||
|
||||
+ /* TabPage object - Implementation
|
||||
+ */
|
||||
+
|
||||
+ static PyObject *
|
||||
+ TabPageGetattr(PyObject *self, char *name)
|
||||
+ {
|
||||
+ PyObject *r;
|
||||
+
|
||||
+ if (CheckTabPage((TabPageObject *)(self)))
|
||||
+ return NULL;
|
||||
+
|
||||
+ r = TabPageAttr((TabPageObject *)(self), name);
|
||||
+ if (r || PyErr_Occurred())
|
||||
+ return r;
|
||||
+ else
|
||||
+ return Py_FindMethod(TabPageMethods, self, name);
|
||||
+ }
|
||||
+
|
||||
/* Window object - Implementation
|
||||
*/
|
||||
|
||||
***************
|
||||
*** 1155,1160 ****
|
||||
--- 1175,1198 ----
|
||||
return Py_FindMethod(WindowMethods, self, name);
|
||||
}
|
||||
|
||||
+ /* Tab page list object - Definitions
|
||||
+ */
|
||||
+
|
||||
+ static PySequenceMethods TabListAsSeq = {
|
||||
+ (PyInquiry) TabListLength, /* sq_length, len(x) */
|
||||
+ (binaryfunc) 0, /* sq_concat, x+y */
|
||||
+ (PyIntArgFunc) 0, /* sq_repeat, x*n */
|
||||
+ (PyIntArgFunc) TabListItem, /* 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 list object - Definitions
|
||||
*/
|
||||
|
||||
***************
|
||||
*** 1198,1203 ****
|
||||
--- 1236,1252 ----
|
||||
WIN_PYTHON_REF(win) = NULL;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ void
|
||||
+ python_tabpage_free(tabpage_T *tab)
|
||||
+ {
|
||||
+ if (TAB_PYTHON_REF(tab) != NULL)
|
||||
+ {
|
||||
+ TabPageObject *tp = TAB_PYTHON_REF(tab);
|
||||
+ tp->tab = INVALID_TABPAGE_VALUE;
|
||||
+ TAB_PYTHON_REF(tab) = NULL;
|
||||
+ }
|
||||
+ }
|
||||
#endif
|
||||
|
||||
static BufMapObject TheBufferMap =
|
||||
***************
|
||||
*** 1208,1213 ****
|
||||
--- 1257,1263 ----
|
||||
static WinListObject TheWindowList =
|
||||
{
|
||||
PyObject_HEAD_INIT(&WinListType)
|
||||
+ NULL
|
||||
};
|
||||
|
||||
static CurrentObject TheCurrent =
|
||||
***************
|
||||
*** 1215,1220 ****
|
||||
--- 1265,1275 ----
|
||||
PyObject_HEAD_INIT(&CurrentType)
|
||||
};
|
||||
|
||||
+ static TabListObject TheTabPageList =
|
||||
+ {
|
||||
+ PyObject_HEAD_INIT(&TabListType)
|
||||
+ };
|
||||
+
|
||||
static int
|
||||
PythonMod_Init(void)
|
||||
{
|
||||
***************
|
||||
*** 1229,1236 ****
|
||||
--- 1284,1293 ----
|
||||
PyType_Ready(&BufferType);
|
||||
PyType_Ready(&RangeType);
|
||||
PyType_Ready(&WindowType);
|
||||
+ PyType_Ready(&TabPageType);
|
||||
PyType_Ready(&BufMapType);
|
||||
PyType_Ready(&WinListType);
|
||||
+ PyType_Ready(&TabListType);
|
||||
PyType_Ready(&CurrentType);
|
||||
PyType_Ready(&OptionsType);
|
||||
|
||||
***************
|
||||
*** 1246,1251 ****
|
||||
--- 1303,1309 ----
|
||||
PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
PyDict_SetItemString(dict, "current", (PyObject *)(void *)&TheCurrent);
|
||||
PyDict_SetItemString(dict, "windows", (PyObject *)(void *)&TheWindowList);
|
||||
+ PyDict_SetItemString(dict, "tabpages", (PyObject *)(void *)&TheTabPageList);
|
||||
tmp = DictionaryNew(&globvardict);
|
||||
PyDict_SetItemString(dict, "vars", tmp);
|
||||
Py_DECREF(tmp);
|
||||
*** ../vim-7.3.948/src/proto/if_python3.pro 2012-06-29 12:54:32.000000000 +0200
|
||||
--- src/proto/if_python3.pro 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 6,11 ****
|
||||
--- 6,12 ----
|
||||
void ex_py3file __ARGS((exarg_T *eap));
|
||||
void python3_buffer_free __ARGS((buf_T *buf));
|
||||
void python3_window_free __ARGS((win_T *win));
|
||||
+ void python3_tabpage_free __ARGS((tabpage_T *tab));
|
||||
void do_py3eval __ARGS((char_u *str, typval_T *rettv));
|
||||
void set_ref_in_python3 __ARGS((int copyID));
|
||||
/* vim: set ft=c : */
|
||||
*** ../vim-7.3.948/src/proto/if_python.pro 2012-06-29 12:54:32.000000000 +0200
|
||||
--- src/proto/if_python.pro 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 6,11 ****
|
||||
--- 6,12 ----
|
||||
void ex_pyfile __ARGS((exarg_T *eap));
|
||||
void python_buffer_free __ARGS((buf_T *buf));
|
||||
void python_window_free __ARGS((win_T *win));
|
||||
+ void python_tabpage_free __ARGS((tabpage_T *tab));
|
||||
void do_pyeval __ARGS((char_u *str, typval_T *rettv));
|
||||
void set_ref_in_python __ARGS((int copyID));
|
||||
/* vim: set ft=c : */
|
||||
*** ../vim-7.3.948/src/proto/window.pro 2013-05-12 19:00:36.000000000 +0200
|
||||
--- src/proto/window.pro 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 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 : */
|
||||
--- 74,79 ----
|
||||
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, win_T *first_win));
|
||||
! int get_tab_number __ARGS((tabpage_T *tp));
|
||||
/* vim: set ft=c : */
|
||||
*** ../vim-7.3.948/src/structs.h 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/structs.h 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 1759,1764 ****
|
||||
--- 1759,1772 ----
|
||||
dictitem_T tp_winvar; /* variable for "t:" Dictionary */
|
||||
dict_T *tp_vars; /* internal variables, local to tab page */
|
||||
#endif
|
||||
+
|
||||
+ #ifdef FEAT_PYTHON
|
||||
+ void *tp_python_ref; /* The Python value for this tab page */
|
||||
+ #endif
|
||||
+
|
||||
+ #ifdef FEAT_PYTHON3
|
||||
+ void *tp_python3_ref; /* The Python value for this tab page */
|
||||
+ #endif
|
||||
};
|
||||
|
||||
/*
|
||||
*** ../vim-7.3.948/src/window.c 2013-05-12 19:00:36.000000000 +0200
|
||||
--- src/window.c 2013-05-15 15:05:04.000000000 +0200
|
||||
***************
|
||||
*** 3510,3515 ****
|
||||
--- 3510,3524 ----
|
||||
hash_init(&tp->tp_vars->dv_hashtab);
|
||||
unref_var_dict(tp->tp_vars);
|
||||
#endif
|
||||
+
|
||||
+ #ifdef FEAT_PYTHON
|
||||
+ python_tabpage_free(tp);
|
||||
+ #endif
|
||||
+
|
||||
+ #ifdef FEAT_PYTHON3
|
||||
+ python3_tabpage_free(tp);
|
||||
+ #endif
|
||||
+
|
||||
vim_free(tp);
|
||||
}
|
||||
|
||||
***************
|
||||
*** 6734,6750 ****
|
||||
|
||||
#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
|
||||
--- 6743,6774 ----
|
||||
|
||||
#if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO)
|
||||
int
|
||||
! get_win_number(win_T *wp, win_T *first_win)
|
||||
{
|
||||
int i = 1;
|
||||
win_T *w;
|
||||
|
||||
! for (w = first_win; w != NULL && w != wp; w = W_NEXT(w))
|
||||
++i;
|
||||
|
||||
if (w == NULL)
|
||||
return 0;
|
||||
else
|
||||
return i;
|
||||
+ }
|
||||
+
|
||||
+ int
|
||||
+ get_tab_number(tabpage_T *tp)
|
||||
+ {
|
||||
+ int i = 1;
|
||||
+ tabpage_T *t;
|
||||
+
|
||||
+ for (t = first_tabpage; t != NULL && t != tp; t = t->tp_next)
|
||||
+ ++i;
|
||||
+
|
||||
+ if (t == NULL)
|
||||
+ return 0;
|
||||
+ else
|
||||
+ return i;
|
||||
}
|
||||
#endif
|
||||
*** ../vim-7.3.948/src/version.c 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/version.c 2013-05-15 15:06:37.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 949,
|
||||
/**/
|
||||
|
||||
--
|
||||
BLACK KNIGHT: Come on you pansy!
|
||||
[hah] [parry thrust]
|
||||
[ARTHUR chops the BLACK KNIGHT's right arm off]
|
||||
ARTHUR: Victory is mine! [kneeling]
|
||||
We thank thee Lord, that in thy merc-
|
||||
[Black Knight kicks Arthur in the head while he is praying]
|
||||
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 ///
|
185
7.3.950
Normal file
185
7.3.950
Normal file
@ -0,0 +1,185 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.950
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.950
|
||||
Problem: Python: Stack trace printer can't handle messages.
|
||||
Solution: Make KeyErrors use PyErr_SetObject. (ZyX)
|
||||
Files: src/if_py_both.h, src/if_python3.c, src/if_python.c
|
||||
|
||||
|
||||
*** ../vim-7.3.949/src/if_py_both.h 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 15:16:23.000000000 +0200
|
||||
***************
|
||||
*** 734,740 ****
|
||||
|
||||
if (di == NULL)
|
||||
{
|
||||
! PyErr_SetString(PyExc_KeyError, _("no such key in dictionary"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- 734,740 ----
|
||||
|
||||
if (di == NULL)
|
||||
{
|
||||
! PyErr_SetObject(PyExc_KeyError, keyObject);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 767,773 ****
|
||||
if (di == NULL)
|
||||
{
|
||||
DICTKEY_UNREF
|
||||
! PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
|
||||
return -1;
|
||||
}
|
||||
hi = hash_find(&d->dv_hashtab, di->di_key);
|
||||
--- 767,773 ----
|
||||
if (di == NULL)
|
||||
{
|
||||
DICTKEY_UNREF
|
||||
! PyErr_SetObject(PyExc_KeyError, keyObject);
|
||||
return -1;
|
||||
}
|
||||
hi = hash_find(&d->dv_hashtab, di->di_key);
|
||||
***************
|
||||
*** 1353,1359 ****
|
||||
|
||||
if (flags == 0)
|
||||
{
|
||||
! PyErr_SetString(PyExc_KeyError, "Option does not exist in given scope");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- 1353,1359 ----
|
||||
|
||||
if (flags == 0)
|
||||
{
|
||||
! PyErr_SetObject(PyExc_KeyError, keyObject);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 1447,1453 ****
|
||||
|
||||
if (flags == 0)
|
||||
{
|
||||
! PyErr_SetString(PyExc_KeyError, "Option does not exist in given scope");
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- 1447,1453 ----
|
||||
|
||||
if (flags == 0)
|
||||
{
|
||||
! PyErr_SetObject(PyExc_KeyError, keyObject);
|
||||
return -1;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 3145,3151 ****
|
||||
return BufferNew(b);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_KeyError, _("no such buffer"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--- 3145,3151 ----
|
||||
return BufferNew(b);
|
||||
else
|
||||
{
|
||||
! PyErr_SetObject(PyExc_KeyError, keyObject);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
*** ../vim-7.3.949/src/if_python3.c 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 15:16:23.000000000 +0200
|
||||
***************
|
||||
*** 128,133 ****
|
||||
--- 128,134 ----
|
||||
# define PyErr_Occurred py3_PyErr_Occurred
|
||||
# define PyErr_SetNone py3_PyErr_SetNone
|
||||
# define PyErr_SetString py3_PyErr_SetString
|
||||
+ # define PyErr_SetObject py3_PyErr_SetObject
|
||||
# define PyEval_InitThreads py3_PyEval_InitThreads
|
||||
# define PyEval_RestoreThread py3_PyEval_RestoreThread
|
||||
# define PyEval_SaveThread py3_PyEval_SaveThread
|
||||
***************
|
||||
*** 250,255 ****
|
||||
--- 251,257 ----
|
||||
static PyObject* (*py3_PyErr_NoMemory)(void);
|
||||
static void (*py3_Py_Finalize)(void);
|
||||
static void (*py3_PyErr_SetString)(PyObject *, const char *);
|
||||
+ static void (*py3_PyErr_SetObject)(PyObject *, PyObject *);
|
||||
static int (*py3_PyRun_SimpleString)(char *);
|
||||
static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *);
|
||||
static PyObject* (*py3_PyList_GetItem)(PyObject *, Py_ssize_t);
|
||||
***************
|
||||
*** 379,384 ****
|
||||
--- 381,387 ----
|
||||
{"PyErr_NoMemory", (PYTHON_PROC*)&py3_PyErr_NoMemory},
|
||||
{"Py_Finalize", (PYTHON_PROC*)&py3_Py_Finalize},
|
||||
{"PyErr_SetString", (PYTHON_PROC*)&py3_PyErr_SetString},
|
||||
+ {"PyErr_SetObject", (PYTHON_PROC*)&py3_PyErr_SetObject},
|
||||
{"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString},
|
||||
{"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String},
|
||||
{"PyList_GetItem", (PYTHON_PROC*)&py3_PyList_GetItem},
|
||||
*** ../vim-7.3.949/src/if_python.c 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 15:16:23.000000000 +0200
|
||||
***************
|
||||
*** 155,160 ****
|
||||
--- 155,161 ----
|
||||
# define PyErr_Occurred dll_PyErr_Occurred
|
||||
# define PyErr_SetNone dll_PyErr_SetNone
|
||||
# define PyErr_SetString dll_PyErr_SetString
|
||||
+ # define PyErr_SetObject dll_PyErr_SetObject
|
||||
# define PyEval_InitThreads dll_PyEval_InitThreads
|
||||
# define PyEval_RestoreThread dll_PyEval_RestoreThread
|
||||
# define PyEval_SaveThread dll_PyEval_SaveThread
|
||||
***************
|
||||
*** 260,265 ****
|
||||
--- 261,267 ----
|
||||
static PyObject*(*dll_PyErr_Occurred)(void);
|
||||
static void(*dll_PyErr_SetNone)(PyObject *);
|
||||
static void(*dll_PyErr_SetString)(PyObject *, const char *);
|
||||
+ static void(*dll_PyErr_SetObject)(PyObject *, PyObject *);
|
||||
static void(*dll_PyEval_InitThreads)(void);
|
||||
static void(*dll_PyEval_RestoreThread)(PyThreadState *);
|
||||
static PyThreadState*(*dll_PyEval_SaveThread)(void);
|
||||
***************
|
||||
*** 393,398 ****
|
||||
--- 395,401 ----
|
||||
{"PyErr_Occurred", (PYTHON_PROC*)&dll_PyErr_Occurred},
|
||||
{"PyErr_SetNone", (PYTHON_PROC*)&dll_PyErr_SetNone},
|
||||
{"PyErr_SetString", (PYTHON_PROC*)&dll_PyErr_SetString},
|
||||
+ {"PyErr_SetObject", (PYTHON_PROC*)&dll_PyErr_SetObject},
|
||||
{"PyEval_InitThreads", (PYTHON_PROC*)&dll_PyEval_InitThreads},
|
||||
{"PyEval_RestoreThread", (PYTHON_PROC*)&dll_PyEval_RestoreThread},
|
||||
{"PyEval_SaveThread", (PYTHON_PROC*)&dll_PyEval_SaveThread},
|
||||
*** ../vim-7.3.949/src/version.c 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/version.c 2013-05-15 15:17:56.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 950,
|
||||
/**/
|
||||
|
||||
--
|
||||
-rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed
|
||||
-rwxr-xr-t 4 root 131720 Jan 1 1970 /usr/ucb/vi
|
||||
-rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs
|
||||
|
||||
/// 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 ///
|
666
7.3.951
Normal file
666
7.3.951
Normal file
@ -0,0 +1,666 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.951
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.951
|
||||
Problem: Python exceptions have problems.
|
||||
Solution: Change some IndexErrors to TypeErrors. Make “line number out of
|
||||
range” an IndexError. Make “unable to get option value” a
|
||||
RuntimeError. Make all PyErr_SetString messages start with
|
||||
lowercase letter and use _(). (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.950/src/if_py_both.h 2013-05-15 15:35:05.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 15:38:57.000000000 +0200
|
||||
***************
|
||||
*** 71,77 ****
|
||||
{
|
||||
if (val == NULL)
|
||||
{
|
||||
! PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- 71,78 ----
|
||||
{
|
||||
if (val == NULL)
|
||||
{
|
||||
! PyErr_SetString(PyExc_AttributeError,
|
||||
! _("can't delete OutputObject attributes"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 919,925 ****
|
||||
|
||||
if (index>=ListLength(self))
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "list index out of range");
|
||||
return NULL;
|
||||
}
|
||||
li = list_find(((ListObject *) (self))->list, (long) index);
|
||||
--- 920,926 ----
|
||||
|
||||
if (index>=ListLength(self))
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, _("list index out of range"));
|
||||
return NULL;
|
||||
}
|
||||
li = list_find(((ListObject *) (self))->list, (long) index);
|
||||
***************
|
||||
*** 1047,1053 ****
|
||||
}
|
||||
if (index>length || (index==length && obj==NULL))
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "list index out of range");
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- 1048,1054 ----
|
||||
}
|
||||
if (index>length || (index==length && obj==NULL))
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, _("list index out of range"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 1186,1192 ****
|
||||
|
||||
if (val == NULL)
|
||||
{
|
||||
! PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- 1187,1194 ----
|
||||
|
||||
if (val == NULL)
|
||||
{
|
||||
! PyErr_SetString(PyExc_AttributeError,
|
||||
! _("cannot delete vim.dictionary attributes"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 1194,1200 ****
|
||||
{
|
||||
if (this->list->lv_lock == VAR_FIXED)
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed list"));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
--- 1196,1202 ----
|
||||
{
|
||||
if (this->list->lv_lock == VAR_FIXED)
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("cannot modify fixed list"));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
***************
|
||||
*** 1208,1214 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
--- 1210,1216 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_AttributeError, _("cannot set this attribute"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1377,1383 ****
|
||||
return PyBytes_FromString((char *) stringval);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_ValueError, "Unable to get option value");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--- 1379,1386 ----
|
||||
return PyBytes_FromString((char *) stringval);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_RuntimeError,
|
||||
! _("unable to get option value"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1455,1467 ****
|
||||
{
|
||||
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
|
||||
--- 1458,1471 ----
|
||||
{
|
||||
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
|
||||
***************
|
||||
*** 1491,1497 ****
|
||||
val = PyLong_AsLong(valObject);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_ValueError, "Object must be integer");
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- 1495,1501 ----
|
||||
val = PyLong_AsLong(valObject);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("object must be integer"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 1529,1535 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_ValueError, "Object must be string");
|
||||
return -1;
|
||||
}
|
||||
|
||||
--- 1533,1539 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("object must be string"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 2766,2772 ****
|
||||
|
||||
if (n < 0 || n > max)
|
||||
{
|
||||
! PyErr_SetString(PyExc_ValueError, _("line number out of range"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- 2770,2776 ----
|
||||
|
||||
if (n < 0 || n > max)
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, _("line number out of range"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 3135,3141 ****
|
||||
bnr = PyLong_AsLong(keyObject);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_ValueError, _("key must be integer"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--- 3139,3145 ----
|
||||
bnr = PyLong_AsLong(keyObject);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("key must be integer"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 3654,3660 ****
|
||||
return convert_dl(obj, tv, pymap_to_tv, lookupDict);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("unable to convert to vim structure"));
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
--- 3658,3665 ----
|
||||
return convert_dl(obj, tv, pymap_to_tv, lookupDict);
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError,
|
||||
! _("unable to convert to vim structure"));
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
*** ../vim-7.3.950/src/if_python3.c 2013-05-15 15:35:05.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 15:38:57.000000000 +0200
|
||||
***************
|
||||
*** 336,341 ****
|
||||
--- 336,342 ----
|
||||
static PyObject *p3imp_PyExc_KeyboardInterrupt;
|
||||
static PyObject *p3imp_PyExc_TypeError;
|
||||
static PyObject *p3imp_PyExc_ValueError;
|
||||
+ static PyObject *p3imp_PyExc_RuntimeError;
|
||||
|
||||
# define PyExc_AttributeError p3imp_PyExc_AttributeError
|
||||
# define PyExc_IndexError p3imp_PyExc_IndexError
|
||||
***************
|
||||
*** 343,348 ****
|
||||
--- 344,350 ----
|
||||
# define PyExc_KeyboardInterrupt p3imp_PyExc_KeyboardInterrupt
|
||||
# define PyExc_TypeError p3imp_PyExc_TypeError
|
||||
# define PyExc_ValueError p3imp_PyExc_ValueError
|
||||
+ # define PyExc_RuntimeError p3imp_PyExc_RuntimeError
|
||||
|
||||
/*
|
||||
* Table of name to function pointer of python.
|
||||
***************
|
||||
*** 580,591 ****
|
||||
--- 582,595 ----
|
||||
p3imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
|
||||
p3imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
|
||||
p3imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
|
||||
+ p3imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError");
|
||||
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);
|
||||
+ Py_XINCREF(p3imp_PyExc_RuntimeError);
|
||||
Py_XDECREF(exmod);
|
||||
}
|
||||
#endif /* DYNAMIC_PYTHON3 */
|
||||
***************
|
||||
*** 1132,1138 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--- 1136,1142 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1166,1172 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
--- 1170,1176 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1248,1254 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--- 1252,1258 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1275,1281 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
--- 1279,1285 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1450,1456 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
--- 1454,1460 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
***************
|
||||
*** 1474,1480 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
--- 1478,1484 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! PyErr_SetString(PyExc_TypeError, _("index must be int or slice"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
*** ../vim-7.3.950/src/if_python.c 2013-05-15 15:35:05.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 15:38:57.000000000 +0200
|
||||
***************
|
||||
*** 358,363 ****
|
||||
--- 358,364 ----
|
||||
static PyObject *imp_PyExc_KeyboardInterrupt;
|
||||
static PyObject *imp_PyExc_TypeError;
|
||||
static PyObject *imp_PyExc_ValueError;
|
||||
+ static PyObject *imp_PyExc_RuntimeError;
|
||||
|
||||
# define PyExc_AttributeError imp_PyExc_AttributeError
|
||||
# define PyExc_IndexError imp_PyExc_IndexError
|
||||
***************
|
||||
*** 365,370 ****
|
||||
--- 366,372 ----
|
||||
# define PyExc_KeyboardInterrupt imp_PyExc_KeyboardInterrupt
|
||||
# define PyExc_TypeError imp_PyExc_TypeError
|
||||
# define PyExc_ValueError imp_PyExc_ValueError
|
||||
+ # define PyExc_RuntimeError imp_PyExc_RuntimeError
|
||||
|
||||
/*
|
||||
* Table of name to function pointer of python.
|
||||
***************
|
||||
*** 593,604 ****
|
||||
--- 595,608 ----
|
||||
imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
|
||||
imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
|
||||
imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
|
||||
+ imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError");
|
||||
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);
|
||||
+ Py_XINCREF(imp_PyExc_RuntimeError);
|
||||
Py_XDECREF(exmod);
|
||||
}
|
||||
#endif /* DYNAMIC_PYTHON */
|
||||
*** ../vim-7.3.950/src/testdir/test86.ok 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-15 15:38:57.000000000 +0200
|
||||
***************
|
||||
*** 102,108 ****
|
||||
B: 1:1 2:1 3:1 4:1
|
||||
>>> previewheight
|
||||
p/gopts1: 12
|
||||
! inv: 'a'! ValueError
|
||||
p/wopts1! KeyError
|
||||
inv: 'a'! KeyError
|
||||
wopts1! KeyError
|
||||
--- 102,108 ----
|
||||
B: 1:1 2:1 3:1 4:1
|
||||
>>> previewheight
|
||||
p/gopts1: 12
|
||||
! inv: 'a'! TypeError
|
||||
p/wopts1! KeyError
|
||||
inv: 'a'! KeyError
|
||||
wopts1! KeyError
|
||||
***************
|
||||
*** 123,129 ****
|
||||
B: 1:5 2:5 3:5 4:5
|
||||
>>> operatorfunc
|
||||
p/gopts1: ''
|
||||
! inv: 2! ValueError
|
||||
p/wopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
wopts1! KeyError
|
||||
--- 123,129 ----
|
||||
B: 1:5 2:5 3:5 4:5
|
||||
>>> operatorfunc
|
||||
p/gopts1: ''
|
||||
! inv: 2! TypeError
|
||||
p/wopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
wopts1! KeyError
|
||||
***************
|
||||
*** 198,206 ****
|
||||
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
|
||||
--- 198,206 ----
|
||||
B: 1:'+2' 2:'+3' 3:'+1' 4:''
|
||||
>>> statusline
|
||||
p/gopts1: ''
|
||||
! inv: 0! TypeError
|
||||
p/wopts1: None
|
||||
! inv: 0! TypeError
|
||||
p/bopts1! KeyError
|
||||
inv: 0! KeyError
|
||||
bopts1! KeyError
|
||||
***************
|
||||
*** 259,265 ****
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: ''
|
||||
! inv: 1! ValueError
|
||||
G: ''
|
||||
W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
--- 259,265 ----
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: ''
|
||||
! inv: 1! TypeError
|
||||
G: ''
|
||||
W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
***************
|
||||
*** 288,301 ****
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
>>> 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:'.'
|
||||
--- 288,301 ----
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
>>> path
|
||||
p/gopts1: '.,/usr/include,,'
|
||||
! inv: 0! TypeError
|
||||
p/wopts1! KeyError
|
||||
inv: 0! KeyError
|
||||
wopts1! KeyError
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: None
|
||||
! inv: 0! TypeError
|
||||
G: '.,,'
|
||||
W: 1:'.,,' 2:',,' 3:'.,,' 4:'.'
|
||||
B: 1:'.,,' 2:',,' 3:'.,,' 4:'.'
|
||||
*** ../vim-7.3.950/src/testdir/test87.ok 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-15 15:38:57.000000000 +0200
|
||||
***************
|
||||
*** 91,97 ****
|
||||
B: 1:1 2:1 3:1 4:1
|
||||
>>> previewheight
|
||||
p/gopts1: 12
|
||||
! inv: 'a'! ValueError
|
||||
p/wopts1! KeyError
|
||||
inv: 'a'! KeyError
|
||||
wopts1! KeyError
|
||||
--- 91,97 ----
|
||||
B: 1:1 2:1 3:1 4:1
|
||||
>>> previewheight
|
||||
p/gopts1: 12
|
||||
! inv: 'a'! TypeError
|
||||
p/wopts1! KeyError
|
||||
inv: 'a'! KeyError
|
||||
wopts1! KeyError
|
||||
***************
|
||||
*** 112,118 ****
|
||||
B: 1:5 2:5 3:5 4:5
|
||||
>>> operatorfunc
|
||||
p/gopts1: b''
|
||||
! inv: 2! ValueError
|
||||
p/wopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
wopts1! KeyError
|
||||
--- 112,118 ----
|
||||
B: 1:5 2:5 3:5 4:5
|
||||
>>> operatorfunc
|
||||
p/gopts1: b''
|
||||
! inv: 2! TypeError
|
||||
p/wopts1! KeyError
|
||||
inv: 2! KeyError
|
||||
wopts1! KeyError
|
||||
***************
|
||||
*** 187,195 ****
|
||||
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
|
||||
--- 187,195 ----
|
||||
B: 1:'+2' 2:'+3' 3:'+1' 4:''
|
||||
>>> statusline
|
||||
p/gopts1: b''
|
||||
! inv: 0! TypeError
|
||||
p/wopts1: None
|
||||
! inv: 0! TypeError
|
||||
p/bopts1! KeyError
|
||||
inv: 0! KeyError
|
||||
bopts1! KeyError
|
||||
***************
|
||||
*** 248,254 ****
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: b''
|
||||
! inv: 1! ValueError
|
||||
G: ''
|
||||
W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
--- 248,254 ----
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: b''
|
||||
! inv: 1! TypeError
|
||||
G: ''
|
||||
W: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
B: 1:'A' 2:'B' 3:'' 4:'C'
|
||||
***************
|
||||
*** 277,290 ****
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
>>> 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:'.'
|
||||
--- 277,290 ----
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
>>> path
|
||||
p/gopts1: b'.,/usr/include,,'
|
||||
! inv: 0! TypeError
|
||||
p/wopts1! KeyError
|
||||
inv: 0! KeyError
|
||||
wopts1! KeyError
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
p/bopts1: None
|
||||
! inv: 0! TypeError
|
||||
G: '.,,'
|
||||
W: 1:'.,,' 2:',,' 3:'.,,' 4:'.'
|
||||
B: 1:'.,,' 2:',,' 3:'.,,' 4:'.'
|
||||
*** ../vim-7.3.950/src/version.c 2013-05-15 15:35:05.000000000 +0200
|
||||
--- src/version.c 2013-05-15 15:38:34.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 951,
|
||||
/**/
|
||||
|
||||
--
|
||||
5 out of 4 people have trouble with fractions.
|
||||
|
||||
/// 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 ///
|
166
7.3.952
Normal file
166
7.3.952
Normal file
@ -0,0 +1,166 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.952
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.952
|
||||
Problem: Python: It's not easy to change window/buffer/tabpage.
|
||||
Solution: Add ability to assign to vim.current.{tabpage,buffer,window}.
|
||||
(ZyX)
|
||||
Files: runtime/doc/if_pyth.txt, src/if_py_both.h
|
||||
|
||||
|
||||
*** ../vim-7.3.951/runtime/doc/if_pyth.txt 2013-05-15 15:12:25.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-15 15:48:39.000000000 +0200
|
||||
***************
|
||||
*** 242,250 ****
|
||||
An object providing access (via specific attributes) to various
|
||||
"current" objects available in vim:
|
||||
vim.current.line The current line (RW) String
|
||||
! vim.current.buffer The current buffer (RO) Buffer
|
||||
! vim.current.window The current window (RO) Window
|
||||
! vim.current.tabpage The current tab page (RO) TabPage
|
||||
vim.current.range The current line range (RO) Range
|
||||
|
||||
The last case deserves a little explanation. When the :python or
|
||||
--- 242,250 ----
|
||||
An object providing access (via specific attributes) to various
|
||||
"current" objects available in vim:
|
||||
vim.current.line The current line (RW) String
|
||||
! vim.current.buffer The current buffer (RW) Buffer
|
||||
! vim.current.window The current window (RW) Window
|
||||
! vim.current.tabpage The current tab page (RW) TabPage
|
||||
vim.current.range The current line range (RO) Range
|
||||
|
||||
The last case deserves a little explanation. When the :python or
|
||||
***************
|
||||
*** 252,257 ****
|
||||
--- 252,273 ----
|
||||
"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.
|
||||
|
||||
+ Note: When assigning to vim.current.{buffer,window,tabpage} it expects
|
||||
+ valid |python-buffer|, |python-window| or |python-tabpage| objects
|
||||
+ respectively. Assigning triggers normal (with |autocommand|s)
|
||||
+ switching to given buffer, window or tab page. It is the only way to
|
||||
+ switch UI objects in python: you can't assign to
|
||||
+ |python-tabpage|.window attribute. To switch without triggering
|
||||
+ autocommands use >
|
||||
+ py << EOF
|
||||
+ saved_eventignore = vim.options['eventignore']
|
||||
+ vim.options['eventignore'] = 'all'
|
||||
+ try:
|
||||
+ vim.current.buffer = vim.buffers[2] # Switch to buffer 2
|
||||
+ finally:
|
||||
+ vim.options['eventignore'] = saved_eventignore
|
||||
+ EOF
|
||||
+ <
|
||||
vim.vars *python-vars*
|
||||
vim.vvars *python-vvars*
|
||||
Dictionary-like objects holding dictionaries with global (|g:|) and
|
||||
*** ../vim-7.3.951/src/if_py_both.h 2013-05-15 15:44:24.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 15:48:39.000000000 +0200
|
||||
***************
|
||||
*** 3244,3249 ****
|
||||
--- 3244,3323 ----
|
||||
|
||||
return 0;
|
||||
}
|
||||
+ else if (strcmp(name, "buffer") == 0)
|
||||
+ {
|
||||
+ int count;
|
||||
+
|
||||
+ if (value->ob_type != &BufferType)
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_TypeError, _("expected vim.buffer object"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (CheckBuffer((BufferObject *)(value)))
|
||||
+ return -1;
|
||||
+ count = ((BufferObject *)(value))->buf->b_fnum;
|
||||
+
|
||||
+ if (do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, count, 0) == FAIL)
|
||||
+ {
|
||||
+ PyErr_SetVim(_("failed to switch to given buffer"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+ else if (strcmp(name, "window") == 0)
|
||||
+ {
|
||||
+ int count;
|
||||
+
|
||||
+ if (value->ob_type != &WindowType)
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_TypeError, _("expected vim.window object"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (CheckWindow((WindowObject *)(value)))
|
||||
+ return -1;
|
||||
+ count = get_win_number(((WindowObject *)(value))->win, firstwin);
|
||||
+
|
||||
+ if (!count)
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_ValueError,
|
||||
+ _("failed to find window in the current tab page"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ win_goto(((WindowObject *)(value))->win);
|
||||
+ if (((WindowObject *)(value))->win != curwin)
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ _("did not switch to the specified window"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
+ else if (strcmp(name, "tabpage") == 0)
|
||||
+ {
|
||||
+ if (value->ob_type != &TabPageType)
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_TypeError, _("expected vim.tabpage object"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ if (CheckTabPage((TabPageObject *)(value)))
|
||||
+ return -1;
|
||||
+
|
||||
+ goto_tabpage_tp(((TabPageObject *)(value))->tab, TRUE, TRUE);
|
||||
+ if (((TabPageObject *)(value))->tab != curtab)
|
||||
+ {
|
||||
+ PyErr_SetString(PyExc_RuntimeError,
|
||||
+ _("did not switch to the specified tab page"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+ }
|
||||
else
|
||||
{
|
||||
PyErr_SetString(PyExc_AttributeError, name);
|
||||
*** ../vim-7.3.951/src/version.c 2013-05-15 15:44:24.000000000 +0200
|
||||
--- src/version.c 2013-05-15 15:49:12.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 952,
|
||||
/**/
|
||||
|
||||
--
|
||||
Trees moving back and forth is what makes the wind blow.
|
||||
|
||||
/// 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 ///
|
103
7.3.953
Normal file
103
7.3.953
Normal file
@ -0,0 +1,103 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.953
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.953
|
||||
Problem: Python: string exceptions are deprecated.
|
||||
Solution: Make vim.error an Exception subclass. (ZyX)
|
||||
Files: src/if_python.c, src/if_python3.c
|
||||
|
||||
|
||||
*** ../vim-7.3.952/src/if_python.c 2013-05-15 15:44:24.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 16:02:20.000000000 +0200
|
||||
***************
|
||||
*** 149,154 ****
|
||||
--- 149,155 ----
|
||||
# define PyMem_Malloc dll_PyMem_Malloc
|
||||
# define PyDict_SetItemString dll_PyDict_SetItemString
|
||||
# define PyErr_BadArgument dll_PyErr_BadArgument
|
||||
+ # define PyErr_NewException dll_PyErr_NewException
|
||||
# define PyErr_Clear dll_PyErr_Clear
|
||||
# define PyErr_PrintEx dll_PyErr_PrintEx
|
||||
# define PyErr_NoMemory dll_PyErr_NoMemory
|
||||
***************
|
||||
*** 255,260 ****
|
||||
--- 256,262 ----
|
||||
static void* (*dll_PyMem_Malloc)(size_t);
|
||||
static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
|
||||
static int(*dll_PyErr_BadArgument)(void);
|
||||
+ static PyObject *(*dll_PyErr_NewException)(char *, PyObject *, PyObject *);
|
||||
static void(*dll_PyErr_Clear)(void);
|
||||
static void(*dll_PyErr_PrintEx)(int);
|
||||
static PyObject*(*dll_PyErr_NoMemory)(void);
|
||||
***************
|
||||
*** 391,396 ****
|
||||
--- 393,399 ----
|
||||
{"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
|
||||
{"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
|
||||
{"PyErr_BadArgument", (PYTHON_PROC*)&dll_PyErr_BadArgument},
|
||||
+ {"PyErr_NewException", (PYTHON_PROC*)&dll_PyErr_NewException},
|
||||
{"PyErr_Clear", (PYTHON_PROC*)&dll_PyErr_Clear},
|
||||
{"PyErr_PrintEx", (PYTHON_PROC*)&dll_PyErr_PrintEx},
|
||||
{"PyErr_NoMemory", (PYTHON_PROC*)&dll_PyErr_NoMemory},
|
||||
***************
|
||||
*** 1304,1310 ****
|
||||
mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION);
|
||||
dict = PyModule_GetDict(mod);
|
||||
|
||||
! VimError = Py_BuildValue("s", "vim.error");
|
||||
|
||||
PyDict_SetItemString(dict, "error", VimError);
|
||||
PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
--- 1307,1313 ----
|
||||
mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION);
|
||||
dict = PyModule_GetDict(mod);
|
||||
|
||||
! VimError = PyErr_NewException("vim.error", NULL, NULL);
|
||||
|
||||
PyDict_SetItemString(dict, "error", VimError);
|
||||
PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
*** ../vim-7.3.952/src/if_python3.c 2013-05-15 15:44:24.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 16:02:20.000000000 +0200
|
||||
***************
|
||||
*** 1606,1613 ****
|
||||
return NULL;
|
||||
|
||||
VimError = PyErr_NewException("vim.error", NULL, NULL);
|
||||
- Py_INCREF(VimError);
|
||||
|
||||
PyModule_AddObject(mod, "error", VimError);
|
||||
Py_INCREF((PyObject *)(void *)&TheBufferMap);
|
||||
PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
--- 1606,1613 ----
|
||||
return NULL;
|
||||
|
||||
VimError = PyErr_NewException("vim.error", NULL, NULL);
|
||||
|
||||
+ Py_INCREF(VimError);
|
||||
PyModule_AddObject(mod, "error", VimError);
|
||||
Py_INCREF((PyObject *)(void *)&TheBufferMap);
|
||||
PyModule_AddObject(mod, "buffers", (PyObject *)(void *)&TheBufferMap);
|
||||
*** ../vim-7.3.952/src/version.c 2013-05-15 15:51:03.000000000 +0200
|
||||
--- src/version.c 2013-05-15 16:02:43.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 953,
|
||||
/**/
|
||||
|
||||
--
|
||||
The early bird gets the worm. If you want something else for
|
||||
breakfast, get up later.
|
||||
|
||||
/// 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 ///
|
94
7.3.954
Normal file
94
7.3.954
Normal file
@ -0,0 +1,94 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.954
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.954
|
||||
Problem: No check if PyObject_IsTrue fails.
|
||||
Solution: Add a check for -1 value. (ZyX)
|
||||
Files: src/if_py_both.h
|
||||
|
||||
|
||||
*** ../vim-7.3.953/src/if_py_both.h 2013-05-15 15:51:03.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 16:08:53.000000000 +0200
|
||||
***************
|
||||
*** 700,706 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! if (PyObject_IsTrue(val))
|
||||
this->dict->dv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->dict->dv_lock = 0;
|
||||
--- 700,709 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! int istrue = PyObject_IsTrue(val);
|
||||
! if (istrue == -1)
|
||||
! return -1;
|
||||
! else if (istrue)
|
||||
this->dict->dv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->dict->dv_lock = 0;
|
||||
***************
|
||||
*** 1201,1207 ****
|
||||
}
|
||||
else
|
||||
{
|
||||
! if (PyObject_IsTrue(val))
|
||||
this->list->lv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->list->lv_lock = 0;
|
||||
--- 1204,1213 ----
|
||||
}
|
||||
else
|
||||
{
|
||||
! int istrue = PyObject_IsTrue(val);
|
||||
! if (istrue == -1)
|
||||
! return -1;
|
||||
! else if (istrue)
|
||||
this->list->lv_lock = VAR_LOCKED;
|
||||
else
|
||||
this->list->lv_lock = 0;
|
||||
***************
|
||||
*** 1479,1485 ****
|
||||
|
||||
if (flags & SOPT_BOOL)
|
||||
{
|
||||
! r = set_option_value_for(key, PyObject_IsTrue(valObject), NULL,
|
||||
opt_flags, this->opt_type, this->from);
|
||||
}
|
||||
else if (flags & SOPT_NUM)
|
||||
--- 1485,1494 ----
|
||||
|
||||
if (flags & SOPT_BOOL)
|
||||
{
|
||||
! int istrue = PyObject_IsTrue(valObject);
|
||||
! if (istrue == -1)
|
||||
! return -1;
|
||||
! r = set_option_value_for(key, istrue, NULL,
|
||||
opt_flags, this->opt_type, this->from);
|
||||
}
|
||||
else if (flags & SOPT_NUM)
|
||||
*** ../vim-7.3.953/src/version.c 2013-05-15 16:04:34.000000000 +0200
|
||||
--- src/version.c 2013-05-15 16:08:26.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 954,
|
||||
/**/
|
||||
|
||||
--
|
||||
The early bird gets the worm. The second mouse gets the cheese.
|
||||
|
||||
/// 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 ///
|
339
7.3.955
Normal file
339
7.3.955
Normal file
@ -0,0 +1,339 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.955
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.955
|
||||
Problem: Python: Not enough tests.
|
||||
Solution: Add tests for vim.{current,window*,tabpage*}. (ZyX)
|
||||
Files: src/testdir/test86.in, src/testdir/test86.ok,
|
||||
src/testdir/test87.in, src/testdir/test87.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.954/src/testdir/test86.in 2013-05-15 14:51:31.000000000 +0200
|
||||
--- src/testdir/test86.in 2013-05-15 16:15:25.000000000 +0200
|
||||
***************
|
||||
*** 334,339 ****
|
||||
--- 334,340 ----
|
||||
:let g:foo = 'bac'
|
||||
:let w:abc = 'def'
|
||||
:let b:baz = 'bar'
|
||||
+ :let t:bar = 'jkl'
|
||||
:try
|
||||
: throw "Abc"
|
||||
:catch
|
||||
***************
|
||||
*** 342,347 ****
|
||||
--- 343,349 ----
|
||||
:put =pyeval('vim.vars[''foo'']')
|
||||
:put =pyeval('vim.current.window.vars[''abc'']')
|
||||
:put =pyeval('vim.current.buffer.vars[''baz'']')
|
||||
+ :put =pyeval('vim.current.tabpage.vars[''bar'']')
|
||||
:"
|
||||
:" Options
|
||||
:" paste: boolean, global
|
||||
***************
|
||||
*** 561,566 ****
|
||||
--- 563,640 ----
|
||||
except StopIteration:
|
||||
cb.append('StopIteration')
|
||||
EOF
|
||||
+ :"
|
||||
+ :" Test vim.{tabpage,window}list and vim.{tabpage,window} objects
|
||||
+ :tabnew 0
|
||||
+ :tabnew 1
|
||||
+ :vnew a.1
|
||||
+ :tabnew 2
|
||||
+ :vnew a.2
|
||||
+ :vnew b.2
|
||||
+ :vnew c.2
|
||||
+ py << EOF
|
||||
+ cb.append('Number of tabs: ' + str(len(vim.tabpages)))
|
||||
+ cb.append('Current tab pages:')
|
||||
+ def W(w):
|
||||
+ if '(unknown)' in repr(w):
|
||||
+ return '<window object (unknown)>'
|
||||
+ else:
|
||||
+ return repr(w)
|
||||
+ for t in vim.tabpages:
|
||||
+ cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window))
|
||||
+ cb.append(' Windows:')
|
||||
+ for w in t.windows:
|
||||
+ cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor))
|
||||
+ # Other values depend on the size of the terminal, so they are checked partly:
|
||||
+ for attr in ('height', 'row', 'width', 'col'):
|
||||
+ try:
|
||||
+ aval = getattr(w, attr)
|
||||
+ if type(aval) is not long:
|
||||
+ raise TypeError
|
||||
+ if aval < 0:
|
||||
+ raise ValueError
|
||||
+ except Exception:
|
||||
+ cb.append('!!!!!! Error while getting attribute ' + attr + ': ' + sys.exc_type.__name__)
|
||||
+ w.cursor = (len(w.buffer), 0)
|
||||
+ cb.append('Number of windows in current tab page: ' + str(len(vim.windows)))
|
||||
+ if list(vim.windows) != list(vim.current.tabpage.windows):
|
||||
+ cb.append('!!!!!! Windows differ')
|
||||
+ EOF
|
||||
+ :"
|
||||
+ :" Test vim.current
|
||||
+ py << EOF
|
||||
+ def H(o):
|
||||
+ return repr(o)
|
||||
+ cb.append('Current tab page: ' + repr(vim.current.tabpage))
|
||||
+ cb.append('Current window: ' + repr(vim.current.window) + ': ' + H(vim.current.window) + ' is ' + H(vim.current.tabpage.window))
|
||||
+ cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ ' is ' + H(vim.current.tabpage.window.buffer))
|
||||
+ # Assigning: fails
|
||||
+ try:
|
||||
+ vim.current.window = vim.tabpages[0].window
|
||||
+ except ValueError:
|
||||
+ cb.append('ValueError at assigning foreign tab window')
|
||||
+
|
||||
+ for attr in ('window', 'tabpage', 'buffer'):
|
||||
+ try:
|
||||
+ setattr(vim.current, attr, None)
|
||||
+ except TypeError:
|
||||
+ cb.append('Type error at assigning None to vim.current.' + attr)
|
||||
+
|
||||
+ # Assigning: success
|
||||
+ vim.current.tabpage = vim.tabpages[-2]
|
||||
+ vim.current.buffer = cb
|
||||
+ vim.current.window = vim.windows[0]
|
||||
+ vim.current.window.cursor = (len(vim.current.buffer), 0)
|
||||
+ cb.append('Current tab page: ' + repr(vim.current.tabpage))
|
||||
+ cb.append('Current window: ' + repr(vim.current.window))
|
||||
+ cb.append('Current buffer: ' + repr(vim.current.buffer))
|
||||
+ cb.append('Current line: ' + repr(vim.current.line))
|
||||
+ for b in vim.buffers:
|
||||
+ if b is not cb:
|
||||
+ vim.command('bwipeout! ' + b.number)
|
||||
+ EOF
|
||||
+ :tabonly!
|
||||
+ :only!
|
||||
:endfun
|
||||
:"
|
||||
:call Test()
|
||||
*** ../vim-7.3.954/src/testdir/test86.ok 2013-05-15 15:44:24.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-15 16:22:06.000000000 +0200
|
||||
***************
|
||||
*** 80,85 ****
|
||||
--- 80,86 ----
|
||||
bac
|
||||
def
|
||||
bar
|
||||
+ jkl
|
||||
>>> paste
|
||||
p/gopts1: False
|
||||
p/wopts1! KeyError
|
||||
***************
|
||||
*** 328,330 ****
|
||||
--- 329,361 ----
|
||||
i4:<buffer test86.in>
|
||||
i4:<buffer test86.in>
|
||||
StopIteration
|
||||
+ Number of tabs: 4
|
||||
+ Current tab pages:
|
||||
+ <tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
+ Windows:
|
||||
+ <window object (unknown)>(0): displays buffer <buffer test86.in>; cursor is at (954, 0)
|
||||
+ <tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
+ Windows:
|
||||
+ <window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
+ <tabpage 2>(3): 2 windows, current is <window object (unknown)>
|
||||
+ Windows:
|
||||
+ <window object (unknown)>(0): displays buffer <buffer a.1>; cursor is at (1, 0)
|
||||
+ <window object (unknown)>(0): displays buffer <buffer 1>; cursor is at (1, 0)
|
||||
+ <tabpage 3>(4): 4 windows, current is <window 0>
|
||||
+ Windows:
|
||||
+ <window 0>(1): displays buffer <buffer c.2>; cursor is at (1, 0)
|
||||
+ <window 1>(2): displays buffer <buffer b.2>; cursor is at (1, 0)
|
||||
+ <window 2>(3): displays buffer <buffer a.2>; cursor is at (1, 0)
|
||||
+ <window 3>(4): displays buffer <buffer 2>; cursor is at (1, 0)
|
||||
+ Number of windows in current tab page: 4
|
||||
+ Current tab page: <tabpage 3>
|
||||
+ Current window: <window 0>: <window 0> is <window 0>
|
||||
+ Current buffer: <buffer c.2>: <buffer c.2> is <buffer c.2> is <buffer c.2>
|
||||
+ ValueError at assigning foreign tab window
|
||||
+ Type error at assigning None to vim.current.window
|
||||
+ Type error at assigning None to vim.current.tabpage
|
||||
+ Type error at assigning None to vim.current.buffer
|
||||
+ Current tab page: <tabpage 2>
|
||||
+ Current window: <window 0>
|
||||
+ Current buffer: <buffer test86.in>
|
||||
+ Current line: 'Type error at assigning None to vim.current.buffer'
|
||||
*** ../vim-7.3.954/src/testdir/test87.in 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/testdir/test87.in 2013-05-15 16:15:25.000000000 +0200
|
||||
***************
|
||||
*** 320,325 ****
|
||||
--- 320,326 ----
|
||||
:let g:foo = 'bac'
|
||||
:let w:abc = 'def'
|
||||
:let b:baz = 'bar'
|
||||
+ :let t:bar = 'jkl'
|
||||
:try
|
||||
: throw "Abc"
|
||||
:catch
|
||||
***************
|
||||
*** 328,333 ****
|
||||
--- 329,335 ----
|
||||
:put =py3eval('vim.vars[''foo'']')
|
||||
:put =py3eval('vim.current.window.vars[''abc'']')
|
||||
:put =py3eval('vim.current.buffer.vars[''baz'']')
|
||||
+ :put =py3eval('vim.current.tabpage.vars[''bar'']')
|
||||
:"
|
||||
:" Options
|
||||
:" paste: boolean, global
|
||||
***************
|
||||
*** 547,552 ****
|
||||
--- 549,626 ----
|
||||
except StopIteration:
|
||||
cb.append('StopIteration')
|
||||
EOF
|
||||
+ :"
|
||||
+ :" Test vim.{tabpage,window}list and vim.{tabpage,window} objects
|
||||
+ :tabnew 0
|
||||
+ :tabnew 1
|
||||
+ :vnew a.1
|
||||
+ :tabnew 2
|
||||
+ :vnew a.2
|
||||
+ :vnew b.2
|
||||
+ :vnew c.2
|
||||
+ py3 << EOF
|
||||
+ def W(w):
|
||||
+ if '(unknown)' in repr(w):
|
||||
+ return '<window object (unknown)>'
|
||||
+ else:
|
||||
+ return repr(w)
|
||||
+ cb.append('Number of tabs: ' + str(len(vim.tabpages)))
|
||||
+ cb.append('Current tab pages:')
|
||||
+ for t in vim.tabpages:
|
||||
+ cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window))
|
||||
+ cb.append(' Windows:')
|
||||
+ for w in t.windows:
|
||||
+ cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor))
|
||||
+ # Other values depend on the size of the terminal, so they are checked partly:
|
||||
+ for attr in ('height', 'row', 'width', 'col'):
|
||||
+ try:
|
||||
+ aval = getattr(w, attr)
|
||||
+ if type(aval) is not int:
|
||||
+ raise TypeError
|
||||
+ if aval < 0:
|
||||
+ raise ValueError
|
||||
+ except Exception as e:
|
||||
+ cb.append('!!!!!! Error while getting attribute ' + attr + ': ' + e.__class__.__name__)
|
||||
+ w.cursor = (len(w.buffer), 0)
|
||||
+ cb.append('Number of windows in current tab page: ' + str(len(vim.windows)))
|
||||
+ if list(vim.windows) != list(vim.current.tabpage.windows):
|
||||
+ cb.append('!!!!!! Windows differ')
|
||||
+ EOF
|
||||
+ :"
|
||||
+ :" Test vim.current
|
||||
+ py3 << EOF
|
||||
+ def H(o):
|
||||
+ return repr(o)
|
||||
+ cb.append('Current tab page: ' + repr(vim.current.tabpage))
|
||||
+ cb.append('Current window: ' + repr(vim.current.window) + ': ' + H(vim.current.window) + ' is ' + H(vim.current.tabpage.window))
|
||||
+ cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ ' is ' + H(vim.current.tabpage.window.buffer))
|
||||
+ # Assigning: fails
|
||||
+ try:
|
||||
+ vim.current.window = vim.tabpages[0].window
|
||||
+ except ValueError:
|
||||
+ cb.append('ValueError at assigning foreign tab window')
|
||||
+
|
||||
+ for attr in ('window', 'tabpage', 'buffer'):
|
||||
+ try:
|
||||
+ setattr(vim.current, attr, None)
|
||||
+ except TypeError:
|
||||
+ cb.append('Type error at assigning None to vim.current.' + attr)
|
||||
+
|
||||
+ # Assigning: success
|
||||
+ vim.current.tabpage = vim.tabpages[-2]
|
||||
+ vim.current.buffer = cb
|
||||
+ vim.current.window = vim.windows[0]
|
||||
+ vim.current.window.cursor = (len(vim.current.buffer), 0)
|
||||
+ cb.append('Current tab page: ' + repr(vim.current.tabpage))
|
||||
+ cb.append('Current window: ' + repr(vim.current.window))
|
||||
+ cb.append('Current buffer: ' + repr(vim.current.buffer))
|
||||
+ cb.append('Current line: ' + repr(vim.current.line))
|
||||
+ for b in vim.buffers:
|
||||
+ if b is not cb:
|
||||
+ vim.command('bwipeout! ' + str(b.number))
|
||||
+ EOF
|
||||
+ :tabonly!
|
||||
+ :only!
|
||||
:endfun
|
||||
:"
|
||||
:call Test()
|
||||
*** ../vim-7.3.954/src/testdir/test87.ok 2013-05-15 15:44:24.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-15 16:21:39.000000000 +0200
|
||||
***************
|
||||
*** 69,74 ****
|
||||
--- 69,75 ----
|
||||
bac
|
||||
def
|
||||
bar
|
||||
+ jkl
|
||||
>>> paste
|
||||
p/gopts1: False
|
||||
p/wopts1! KeyError
|
||||
***************
|
||||
*** 317,319 ****
|
||||
--- 318,350 ----
|
||||
i4:<buffer test87.in>
|
||||
i4:<buffer test87.in>
|
||||
StopIteration
|
||||
+ Number of tabs: 4
|
||||
+ Current tab pages:
|
||||
+ <tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
+ Windows:
|
||||
+ <window object (unknown)>(0): displays buffer <buffer test87.in>; cursor is at (929, 0)
|
||||
+ <tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
+ Windows:
|
||||
+ <window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
+ <tabpage 2>(3): 2 windows, current is <window object (unknown)>
|
||||
+ Windows:
|
||||
+ <window object (unknown)>(0): displays buffer <buffer a.1>; cursor is at (1, 0)
|
||||
+ <window object (unknown)>(0): displays buffer <buffer 1>; cursor is at (1, 0)
|
||||
+ <tabpage 3>(4): 4 windows, current is <window 0>
|
||||
+ Windows:
|
||||
+ <window 0>(1): displays buffer <buffer c.2>; cursor is at (1, 0)
|
||||
+ <window 1>(2): displays buffer <buffer b.2>; cursor is at (1, 0)
|
||||
+ <window 2>(3): displays buffer <buffer a.2>; cursor is at (1, 0)
|
||||
+ <window 3>(4): displays buffer <buffer 2>; cursor is at (1, 0)
|
||||
+ Number of windows in current tab page: 4
|
||||
+ Current tab page: <tabpage 3>
|
||||
+ Current window: <window 0>: <window 0> is <window 0>
|
||||
+ Current buffer: <buffer c.2>: <buffer c.2> is <buffer c.2> is <buffer c.2>
|
||||
+ ValueError at assigning foreign tab window
|
||||
+ Type error at assigning None to vim.current.window
|
||||
+ Type error at assigning None to vim.current.tabpage
|
||||
+ Type error at assigning None to vim.current.buffer
|
||||
+ Current tab page: <tabpage 2>
|
||||
+ Current window: <window 0>
|
||||
+ Current buffer: <buffer test87.in>
|
||||
+ Current line: 'Type error at assigning None to vim.current.buffer'
|
||||
*** ../vim-7.3.954/src/version.c 2013-05-15 16:11:46.000000000 +0200
|
||||
--- src/version.c 2013-05-15 16:14:46.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 955,
|
||||
/**/
|
||||
|
||||
--
|
||||
FATHER: You only killed the bride's father - that's all -
|
||||
LAUNCELOT: Oh dear, I didn't really mean to...
|
||||
FATHER: Didn't mean to? You put your sword right through his head!
|
||||
LAUNCELOT: Gosh - Is he all right?
|
||||
"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 ///
|
224
7.3.956
Normal file
224
7.3.956
Normal file
@ -0,0 +1,224 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.956
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.956
|
||||
Problem: Python vim.bindeval() causes SIGABRT.
|
||||
Solution: Make pygilstate a local variable. (Yukihiro Nakadaira)
|
||||
Files: src/if_py_both.h, src/if_python.c, src/if_python3.c
|
||||
|
||||
|
||||
*** ../vim-7.3.955/src/if_py_both.h 2013-05-15 16:11:46.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 17:37:48.000000000 +0200
|
||||
***************
|
||||
*** 1298,1304 ****
|
||||
--- 1298,1311 ----
|
||||
}
|
||||
}
|
||||
|
||||
+ Py_BEGIN_ALLOW_THREADS
|
||||
+ Python_Lock_Vim();
|
||||
+
|
||||
error = func_call(name, &args, selfdict, &rettv);
|
||||
+
|
||||
+ Python_Release_Vim();
|
||||
+ Py_END_ALLOW_THREADS
|
||||
+
|
||||
if (error != OK)
|
||||
{
|
||||
result = NULL;
|
||||
*** ../vim-7.3.955/src/if_python.c 2013-05-15 16:04:34.000000000 +0200
|
||||
--- src/if_python.c 2013-05-15 17:37:48.000000000 +0200
|
||||
***************
|
||||
*** 676,686 ****
|
||||
typedef PyObject PyThreadState;
|
||||
#endif
|
||||
|
||||
! #ifdef PY_CAN_RECURSE
|
||||
! static PyGILState_STATE pygilstate = PyGILState_UNLOCKED;
|
||||
! #else
|
||||
static PyThreadState *saved_python_thread = NULL;
|
||||
- #endif
|
||||
|
||||
/*
|
||||
* Suspend a thread of the Python interpreter, other threads are allowed to
|
||||
--- 676,683 ----
|
||||
typedef PyObject PyThreadState;
|
||||
#endif
|
||||
|
||||
! #ifndef PY_CAN_RECURSE
|
||||
static PyThreadState *saved_python_thread = NULL;
|
||||
|
||||
/*
|
||||
* Suspend a thread of the Python interpreter, other threads are allowed to
|
||||
***************
|
||||
*** 689,699 ****
|
||||
static void
|
||||
Python_SaveThread(void)
|
||||
{
|
||||
- #ifdef PY_CAN_RECURSE
|
||||
- PyGILState_Release(pygilstate);
|
||||
- #else
|
||||
saved_python_thread = PyEval_SaveThread();
|
||||
- #endif
|
||||
}
|
||||
|
||||
/*
|
||||
--- 686,692 ----
|
||||
***************
|
||||
*** 703,715 ****
|
||||
static void
|
||||
Python_RestoreThread(void)
|
||||
{
|
||||
- #ifdef PY_CAN_RECURSE
|
||||
- pygilstate = PyGILState_Ensure();
|
||||
- #else
|
||||
PyEval_RestoreThread(saved_python_thread);
|
||||
saved_python_thread = NULL;
|
||||
- #endif
|
||||
}
|
||||
|
||||
void
|
||||
python_end()
|
||||
--- 696,705 ----
|
||||
static void
|
||||
Python_RestoreThread(void)
|
||||
{
|
||||
PyEval_RestoreThread(saved_python_thread);
|
||||
saved_python_thread = NULL;
|
||||
}
|
||||
+ #endif
|
||||
|
||||
void
|
||||
python_end()
|
||||
***************
|
||||
*** 725,738 ****
|
||||
--- 715,736 ----
|
||||
#ifdef DYNAMIC_PYTHON
|
||||
if (hinstPython && Py_IsInitialized())
|
||||
{
|
||||
+ # ifdef PY_CAN_RECURSE
|
||||
+ PyGILState_Ensure();
|
||||
+ # else
|
||||
Python_RestoreThread(); /* enter python */
|
||||
+ # endif
|
||||
Py_Finalize();
|
||||
}
|
||||
end_dynamic_python();
|
||||
#else
|
||||
if (Py_IsInitialized())
|
||||
{
|
||||
+ # ifdef PY_CAN_RECURSE
|
||||
+ PyGILState_Ensure();
|
||||
+ # else
|
||||
Python_RestoreThread(); /* enter python */
|
||||
+ # endif
|
||||
Py_Finalize();
|
||||
}
|
||||
#endif
|
||||
***************
|
||||
*** 837,842 ****
|
||||
--- 835,843 ----
|
||||
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
||||
char *saved_locale;
|
||||
#endif
|
||||
+ #ifdef PY_CAN_RECURSE
|
||||
+ PyGILState_STATE pygilstate;
|
||||
+ #endif
|
||||
|
||||
#ifndef PY_CAN_RECURSE
|
||||
if (recursive)
|
||||
***************
|
||||
*** 881,887 ****
|
||||
--- 882,892 ----
|
||||
}
|
||||
#endif
|
||||
|
||||
+ #ifdef PY_CAN_RECURSE
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ #else
|
||||
Python_RestoreThread(); /* enter python */
|
||||
+ #endif
|
||||
|
||||
if (rettv == NULL)
|
||||
PyRun_SimpleString((char *)(cmd));
|
||||
***************
|
||||
*** 905,911 ****
|
||||
--- 910,920 ----
|
||||
PyErr_Clear();
|
||||
}
|
||||
|
||||
+ #ifdef PY_CAN_RECURSE
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+ #else
|
||||
Python_SaveThread(); /* leave python */
|
||||
+ #endif
|
||||
|
||||
#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
|
||||
if (saved_locale != NULL)
|
||||
*** ../vim-7.3.955/src/if_python3.c 2013-05-15 16:04:34.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 17:37:48.000000000 +0200
|
||||
***************
|
||||
*** 699,706 ****
|
||||
* 1. Python interpreter main program.
|
||||
*/
|
||||
|
||||
- static PyGILState_STATE pygilstate = PyGILState_UNLOCKED;
|
||||
-
|
||||
void
|
||||
python3_end()
|
||||
{
|
||||
--- 699,704 ----
|
||||
***************
|
||||
*** 718,724 ****
|
||||
if (Py_IsInitialized())
|
||||
{
|
||||
// acquire lock before finalizing
|
||||
! pygilstate = PyGILState_Ensure();
|
||||
|
||||
Py_Finalize();
|
||||
}
|
||||
--- 716,722 ----
|
||||
if (Py_IsInitialized())
|
||||
{
|
||||
// acquire lock before finalizing
|
||||
! PyGILState_Ensure();
|
||||
|
||||
Py_Finalize();
|
||||
}
|
||||
***************
|
||||
*** 826,831 ****
|
||||
--- 824,830 ----
|
||||
#endif
|
||||
PyObject *cmdstr;
|
||||
PyObject *cmdbytes;
|
||||
+ PyGILState_STATE pygilstate;
|
||||
|
||||
#if defined(MACOS) && !defined(MACOS_X_UNIX)
|
||||
GetPort(&oldPort);
|
||||
*** ../vim-7.3.955/src/version.c 2013-05-15 16:27:33.000000000 +0200
|
||||
--- src/version.c 2013-05-15 17:48:15.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 956,
|
||||
/**/
|
||||
|
||||
--
|
||||
GUEST: He's killed the best man!
|
||||
SECOND GUEST: (holding a limp WOMAN) He's killed my auntie.
|
||||
FATHER: No, please! This is supposed to be a happy occasion! Let's
|
||||
not bicker and argue about who killed who ...
|
||||
"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 ///
|
287
7.3.957
Normal file
287
7.3.957
Normal file
@ -0,0 +1,287 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.957
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.957
|
||||
Problem: Python does not have a "do" command like Perl or Lua.
|
||||
Solution: Add the ":py3do" command. (Lilydjwg)
|
||||
Files: runtime/doc/if_pyth.txt, src/ex_cmds.h, src/ex_docmd.c,
|
||||
src/if_python3.c, src/proto/if_python3.pro
|
||||
|
||||
|
||||
*** ../vim-7.3.956/runtime/doc/if_pyth.txt 2013-05-15 15:51:03.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-15 18:04:17.000000000 +0200
|
||||
***************
|
||||
*** 490,495 ****
|
||||
--- 490,510 ----
|
||||
< *:py3file*
|
||||
The |:py3file| command works similar to |:pyfile|.
|
||||
|
||||
+ *:py3do*
|
||||
+ :[range]py3do {body} Execute Python function "def _vim_pydo(line, linenr):
|
||||
+ {body}" for each line in the [range], with the
|
||||
+ function arguments being set to the text of each line
|
||||
+ in turn, without a trailing <EOL>, and the current
|
||||
+ line number. The function should return a string or
|
||||
+ None. If a string is returned, it becomes the text of
|
||||
+ the line in the current turn. The default for [range]
|
||||
+ is the whole file: "1,$".
|
||||
+ {not in Vi}
|
||||
+
|
||||
+ Examples:
|
||||
+ >
|
||||
+ :py3do return "%s\t%d" % (line[::-1], len(line))
|
||||
+ :py3do if line: return "%4d: %s" % (linenr, line)
|
||||
|
||||
Vim can be built in four ways (:version output):
|
||||
1. No Python support (-python, -python3)
|
||||
*** ../vim-7.3.956/src/ex_cmds.h 2012-11-14 20:52:22.000000000 +0100
|
||||
--- src/ex_cmds.h 2013-05-15 18:01:55.000000000 +0200
|
||||
***************
|
||||
*** 743,748 ****
|
||||
--- 743,750 ----
|
||||
RANGE|FILE1|NEEDARG|CMDWIN),
|
||||
EX(CMD_py3, "py3", ex_py3,
|
||||
RANGE|EXTRA|NEEDARG|CMDWIN),
|
||||
+ EX(CMD_py3do, "py3do", ex_py3do,
|
||||
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
|
||||
EX(CMD_python3, "python3", ex_py3,
|
||||
RANGE|EXTRA|NEEDARG|CMDWIN),
|
||||
EX(CMD_py3file, "py3file", ex_py3file,
|
||||
*** ../vim-7.3.956/src/ex_docmd.c 2013-05-07 05:18:15.000000000 +0200
|
||||
--- src/ex_docmd.c 2013-05-15 18:01:55.000000000 +0200
|
||||
***************
|
||||
*** 272,277 ****
|
||||
--- 272,278 ----
|
||||
#endif
|
||||
#ifndef FEAT_PYTHON3
|
||||
# define ex_py3 ex_script_ni
|
||||
+ # define ex_py3do ex_ni
|
||||
# define ex_py3file ex_ni
|
||||
#endif
|
||||
#ifndef FEAT_TCL
|
||||
*** ../vim-7.3.956/src/if_python3.c 2013-05-15 17:49:00.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 18:23:30.000000000 +0200
|
||||
***************
|
||||
*** 76,81 ****
|
||||
--- 76,82 ----
|
||||
#else
|
||||
# define CODEC_ERROR_HANDLER NULL
|
||||
#endif
|
||||
+ #define DOPY_FUNC "_vim_pydo"
|
||||
|
||||
/* Python 3 does not support CObjects, always use Capsules */
|
||||
#define PY_USE_CAPSULE
|
||||
***************
|
||||
*** 126,131 ****
|
||||
--- 127,133 ----
|
||||
# define PyErr_PrintEx py3_PyErr_PrintEx
|
||||
# define PyErr_NoMemory py3_PyErr_NoMemory
|
||||
# define PyErr_Occurred py3_PyErr_Occurred
|
||||
+ # define PyErr_PrintEx py3_PyErr_PrintEx
|
||||
# define PyErr_SetNone py3_PyErr_SetNone
|
||||
# define PyErr_SetString py3_PyErr_SetString
|
||||
# define PyErr_SetObject py3_PyErr_SetObject
|
||||
***************
|
||||
*** 148,154 ****
|
||||
# define PyTuple_GetItem py3_PyTuple_GetItem
|
||||
# define PySlice_GetIndicesEx py3_PySlice_GetIndicesEx
|
||||
# define PyImport_ImportModule py3_PyImport_ImportModule
|
||||
- # define PyImport_AddModule py3_PyImport_AddModule
|
||||
# define PyObject_Init py3__PyObject_Init
|
||||
# define PyDict_New py3_PyDict_New
|
||||
# define PyDict_GetItemString py3_PyDict_GetItemString
|
||||
--- 150,155 ----
|
||||
***************
|
||||
*** 163,168 ****
|
||||
--- 164,174 ----
|
||||
# define PyRun_SimpleString py3_PyRun_SimpleString
|
||||
#undef PyRun_String
|
||||
# define PyRun_String py3_PyRun_String
|
||||
+ # define PyObject_GetAttrString py3_PyObject_GetAttrString
|
||||
+ # define PyObject_SetAttrString py3_PyObject_SetAttrString
|
||||
+ # define PyObject_CallFunctionObjArgs py3_PyObject_CallFunctionObjArgs
|
||||
+ # define PyEval_GetLocals py3_PyEval_GetLocals
|
||||
+ # define PyEval_GetGlobals py3_PyEval_GetGlobals
|
||||
# define PySys_SetObject py3_PySys_SetObject
|
||||
# define PySys_SetArgv py3_PySys_SetArgv
|
||||
# define PyType_Ready py3_PyType_Ready
|
||||
***************
|
||||
*** 178,183 ****
|
||||
--- 184,190 ----
|
||||
# define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented)
|
||||
# define PyModule_AddObject py3_PyModule_AddObject
|
||||
# define PyImport_AppendInittab py3_PyImport_AppendInittab
|
||||
+ # define PyImport_AddModule py3_PyImport_AddModule
|
||||
# if PY_VERSION_HEX >= 0x030300f0
|
||||
# undef _PyUnicode_AsString
|
||||
# define _PyUnicode_AsString py3_PyUnicode_AsUTF8
|
||||
***************
|
||||
*** 254,259 ****
|
||||
--- 261,271 ----
|
||||
static void (*py3_PyErr_SetObject)(PyObject *, PyObject *);
|
||||
static int (*py3_PyRun_SimpleString)(char *);
|
||||
static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *);
|
||||
+ static PyObject* (*py3_PyObject_GetAttrString)(PyObject *, const char *);
|
||||
+ static PyObject* (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *);
|
||||
+ static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...);
|
||||
+ static PyObject* (*py3_PyEval_GetGlobals)();
|
||||
+ static PyObject* (*py3_PyEval_GetLocals)();
|
||||
static PyObject* (*py3_PyList_GetItem)(PyObject *, Py_ssize_t);
|
||||
static PyObject* (*py3_PyImport_ImportModule)(const char *);
|
||||
static PyObject* (*py3_PyImport_AddModule)(const char *);
|
||||
***************
|
||||
*** 386,391 ****
|
||||
--- 398,408 ----
|
||||
{"PyErr_SetObject", (PYTHON_PROC*)&py3_PyErr_SetObject},
|
||||
{"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString},
|
||||
{"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String},
|
||||
+ {"PyObject_GetAttrString", (PYTHON_PROC*)&py3_PyObject_GetAttrString},
|
||||
+ {"PyObject_SetAttrString", (PYTHON_PROC*)&py3_PyObject_SetAttrString},
|
||||
+ {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&py3_PyObject_CallFunctionObjArgs},
|
||||
+ {"PyEval_GetGlobals", (PYTHON_PROC*)&py3_PyEval_GetGlobals},
|
||||
+ {"PyEval_GetLocals", (PYTHON_PROC*)&py3_PyEval_GetLocals},
|
||||
{"PyList_GetItem", (PYTHON_PROC*)&py3_PyList_GetItem},
|
||||
{"PyImport_ImportModule", (PYTHON_PROC*)&py3_PyImport_ImportModule},
|
||||
{"PyImport_AddModule", (PYTHON_PROC*)&py3_PyImport_AddModule},
|
||||
***************
|
||||
*** 990,995 ****
|
||||
--- 1007,1106 ----
|
||||
DoPy3Command(eap, buffer, NULL);
|
||||
}
|
||||
|
||||
+ void ex_py3do(exarg_T *eap)
|
||||
+ {
|
||||
+ linenr_T i;
|
||||
+ const char *code_hdr = "def " DOPY_FUNC "(line, linenr):\n ";
|
||||
+ const char *s = (const char *) eap->arg;
|
||||
+ size_t len;
|
||||
+ char *code;
|
||||
+ int status;
|
||||
+ PyObject *pyfunc, *pymain;
|
||||
+ PyGILState_STATE pygilstate;
|
||||
+
|
||||
+ if (Python3_Init())
|
||||
+ goto theend;
|
||||
+
|
||||
+ if (u_save(eap->line1 - 1, eap->line2 + 1) != OK)
|
||||
+ {
|
||||
+ EMSG(_("cannot save undo information"));
|
||||
+ return;
|
||||
+ }
|
||||
+ len = strlen(code_hdr) + strlen(s);
|
||||
+ code = malloc(len + 1);
|
||||
+ STRCPY(code, code_hdr);
|
||||
+ STRNCAT(code, s, len + 1);
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ status = PyRun_SimpleString(code);
|
||||
+ vim_free(code);
|
||||
+ if (status)
|
||||
+ {
|
||||
+ EMSG(_("failed to run the code"));
|
||||
+ return;
|
||||
+ }
|
||||
+ status = 0; /* good */
|
||||
+ pymain = PyImport_AddModule("__main__");
|
||||
+ pyfunc = PyObject_GetAttrString(pymain, DOPY_FUNC);
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+
|
||||
+ for (i = eap->line1; i <= eap->line2; i++)
|
||||
+ {
|
||||
+ const char *line;
|
||||
+ PyObject *pyline, *pylinenr, *pyret, *pybytes;
|
||||
+
|
||||
+ line = (char *)ml_get(i);
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ pyline = PyUnicode_Decode(line, strlen(line),
|
||||
+ (char *)ENC_OPT, CODEC_ERROR_HANDLER);
|
||||
+ pylinenr = PyLong_FromLong(i);
|
||||
+ pyret = PyObject_CallFunctionObjArgs(pyfunc, pyline, pylinenr, NULL);
|
||||
+ Py_DECREF(pyline);
|
||||
+ Py_DECREF(pylinenr);
|
||||
+ if (!pyret)
|
||||
+ {
|
||||
+ PyErr_PrintEx(0);
|
||||
+ PythonIO_Flush();
|
||||
+ status = 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (pyret && pyret != Py_None)
|
||||
+ {
|
||||
+ if (!PyUnicode_Check(pyret))
|
||||
+ {
|
||||
+ /* TODO: a proper error number */
|
||||
+ EMSG(_("E000: return value must be an instance of str"));
|
||||
+ Py_XDECREF(pyret);
|
||||
+ status = 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ pybytes = PyUnicode_AsEncodedString(pyret,
|
||||
+ (char *)ENC_OPT, CODEC_ERROR_HANDLER);
|
||||
+ ml_replace(i, (char_u *) PyBytes_AsString(pybytes), 1);
|
||||
+ Py_DECREF(pybytes);
|
||||
+ changed();
|
||||
+ #ifdef SYNTAX_HL
|
||||
+ syn_changed(i); /* recompute syntax hl. for this line */
|
||||
+ #endif
|
||||
+ }
|
||||
+ Py_XDECREF(pyret);
|
||||
+ PythonIO_Flush();
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+ }
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ out:
|
||||
+ Py_DECREF(pyfunc);
|
||||
+ PyObject_SetAttrString(pymain, DOPY_FUNC, NULL);
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+ if (status)
|
||||
+ return;
|
||||
+ check_cursor();
|
||||
+ update_curbuf(NOT_VALID);
|
||||
+
|
||||
+ theend:
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/******************************************************
|
||||
* 2. Python output stream: writes output via [e]msg().
|
||||
*/
|
||||
*** ../vim-7.3.956/src/proto/if_python3.pro 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/proto/if_python3.pro 2013-05-15 18:01:55.000000000 +0200
|
||||
***************
|
||||
*** 3,8 ****
|
||||
--- 3,9 ----
|
||||
void python3_end __ARGS((void));
|
||||
int python3_loaded __ARGS((void));
|
||||
void ex_py3 __ARGS((exarg_T *eap));
|
||||
+ void ex_py3do __ARGS((exarg_T *eap));
|
||||
void ex_py3file __ARGS((exarg_T *eap));
|
||||
void python3_buffer_free __ARGS((buf_T *buf));
|
||||
void python3_window_free __ARGS((win_T *win));
|
||||
*** ../vim-7.3.956/src/version.c 2013-05-15 17:49:00.000000000 +0200
|
||||
--- src/version.c 2013-05-15 18:16:28.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 957,
|
||||
/**/
|
||||
|
||||
--
|
||||
FATHER: We are here today to witness the union of two young people in the
|
||||
joyful bond of the holy wedlock. Unfortunately, one of them, my son
|
||||
Herbert, has just fallen to his death.
|
||||
[Murmurs from CROWD; the BRIDE smiles with relief, coughs.]
|
||||
"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 ///
|
67
7.3.958
Normal file
67
7.3.958
Normal file
@ -0,0 +1,67 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.958
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.958
|
||||
Problem: Python: Iteration destructor not set.
|
||||
Solution: Put IterDestructor to use. (ZyX)
|
||||
Files: src/if_py_both.c
|
||||
|
||||
|
||||
*** ../vim-7.3.957/src/if_py_both.h 2013-05-15 17:49:00.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-15 19:00:19.000000000 +0200
|
||||
***************
|
||||
*** 566,572 ****
|
||||
return (PyObject *)(self);
|
||||
}
|
||||
|
||||
- #if 0 /* unused */
|
||||
static void
|
||||
IterDestructor(PyObject *self)
|
||||
{
|
||||
--- 566,571 ----
|
||||
***************
|
||||
*** 576,582 ****
|
||||
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
- #endif
|
||||
|
||||
static PyObject *
|
||||
IterNext(PyObject *self)
|
||||
--- 575,580 ----
|
||||
***************
|
||||
*** 3823,3828 ****
|
||||
--- 3821,3827 ----
|
||||
IterType.tp_doc = "generic iterator object";
|
||||
IterType.tp_iter = IterIter;
|
||||
IterType.tp_iternext = IterNext;
|
||||
+ IterType.tp_dealloc = IterDestructor;
|
||||
|
||||
vim_memset(&BufferType, 0, sizeof(BufferType));
|
||||
BufferType.tp_name = "vim.buffer";
|
||||
*** ../vim-7.3.957/src/version.c 2013-05-15 18:28:08.000000000 +0200
|
||||
--- src/version.c 2013-05-15 19:05:28.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 958,
|
||||
/**/
|
||||
|
||||
--
|
||||
Yesterday is history.
|
||||
Tomorrow is a mystery.
|
||||
Today is a gift.
|
||||
That's why it is called 'present'.
|
||||
|
||||
/// 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 ///
|
74
7.3.959
Normal file
74
7.3.959
Normal file
@ -0,0 +1,74 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.959
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.959 (after 7.3.957)
|
||||
Problem: Missing error number.
|
||||
Solution: Assign an error number.
|
||||
Files: src/if_python3.c
|
||||
|
||||
|
||||
*** ../vim-7.3.958/src/if_python3.c 2013-05-15 18:28:08.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-15 19:41:51.000000000 +0200
|
||||
***************
|
||||
*** 1007,1013 ****
|
||||
DoPy3Command(eap, buffer, NULL);
|
||||
}
|
||||
|
||||
! void ex_py3do(exarg_T *eap)
|
||||
{
|
||||
linenr_T i;
|
||||
const char *code_hdr = "def " DOPY_FUNC "(line, linenr):\n ";
|
||||
--- 1007,1014 ----
|
||||
DoPy3Command(eap, buffer, NULL);
|
||||
}
|
||||
|
||||
! void
|
||||
! ex_py3do(exarg_T *eap)
|
||||
{
|
||||
linenr_T i;
|
||||
const char *code_hdr = "def " DOPY_FUNC "(line, linenr):\n ";
|
||||
***************
|
||||
*** 1068,1075 ****
|
||||
{
|
||||
if (!PyUnicode_Check(pyret))
|
||||
{
|
||||
! /* TODO: a proper error number */
|
||||
! EMSG(_("E000: return value must be an instance of str"));
|
||||
Py_XDECREF(pyret);
|
||||
status = 1;
|
||||
goto out;
|
||||
--- 1069,1075 ----
|
||||
{
|
||||
if (!PyUnicode_Check(pyret))
|
||||
{
|
||||
! EMSG(_("E863: return value must be an instance of str"));
|
||||
Py_XDECREF(pyret);
|
||||
status = 1;
|
||||
goto out;
|
||||
*** ../vim-7.3.958/src/version.c 2013-05-15 19:07:03.000000000 +0200
|
||||
--- src/version.c 2013-05-15 19:38:05.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 959,
|
||||
/**/
|
||||
|
||||
|
||||
--
|
||||
CRONE: Who sent you?
|
||||
ARTHUR: The Knights Who Say Ni!
|
||||
CRONE: Aaaagh! (she looks around in rear) No! We have no shrubberies here.
|
||||
"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 ///
|
47
7.3.960
Normal file
47
7.3.960
Normal file
@ -0,0 +1,47 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.960
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.960
|
||||
Problem: Compiler warning for unused variable.
|
||||
Solution: Put declaration in #ifdef.
|
||||
Files: src/window.c
|
||||
|
||||
|
||||
*** ../vim-7.3.959/src/window.c 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/window.c 2013-05-15 23:11:02.000000000 +0200
|
||||
***************
|
||||
*** 2124,2130 ****
|
||||
--- 2124,2132 ----
|
||||
{
|
||||
if (firstwin == lastwin)
|
||||
{
|
||||
+ #ifdef FEAT_AUTOCMD
|
||||
buf_T *old_curbuf = curbuf;
|
||||
+ #endif
|
||||
|
||||
/*
|
||||
* Closing the last window in a tab page. First go to another tab
|
||||
*** ../vim-7.3.959/src/version.c 2013-05-15 19:44:35.000000000 +0200
|
||||
--- src/version.c 2013-05-15 23:12:12.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 960,
|
||||
/**/
|
||||
|
||||
--
|
||||
Did you ever stop to think... and forget to start again?
|
||||
-- Steven Wright
|
||||
|
||||
/// 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 ///
|
90
7.3.961
Normal file
90
7.3.961
Normal file
@ -0,0 +1,90 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.961
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.961
|
||||
Problem: Tests 86 and 87 fail when using another language than English.
|
||||
Solution: Set the language to C in the test. (Dominique Pelle)
|
||||
Files: src/testdir/test86.in, src/testdir/test87.in,
|
||||
src/testdir/test87.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.960/src/testdir/test86.in 2013-05-15 16:27:33.000000000 +0200
|
||||
--- src/testdir/test86.in 2013-05-16 18:58:46.000000000 +0200
|
||||
***************
|
||||
*** 5,14 ****
|
||||
./configure --without-pymalloc
|
||||
See http://svn.python.org/view/python/trunk/Misc/README.valgrind?view=markup
|
||||
|
||||
-
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:if !has('python') | e! test.ok | wq! test.out | endif
|
||||
:py import vim
|
||||
:fun Test()
|
||||
:let l = []
|
||||
--- 5,14 ----
|
||||
./configure --without-pymalloc
|
||||
See http://svn.python.org/view/python/trunk/Misc/README.valgrind?view=markup
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:if !has('python') | e! test.ok | wq! test.out | endif
|
||||
+ :lang C
|
||||
:py import vim
|
||||
:fun Test()
|
||||
:let l = []
|
||||
*** ../vim-7.3.960/src/testdir/test87.in 2013-05-15 16:27:33.000000000 +0200
|
||||
--- src/testdir/test87.in 2013-05-16 18:56:21.000000000 +0200
|
||||
***************
|
||||
*** 3,8 ****
|
||||
--- 3,9 ----
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:if !has('python3') | e! test.ok | wq! test.out | endif
|
||||
+ :lang C
|
||||
:py3 import vim
|
||||
:fun Test()
|
||||
:let l = []
|
||||
*** ../vim-7.3.960/src/testdir/test87.ok 2013-05-15 16:27:33.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-16 20:46:05.000000000 +0200
|
||||
***************
|
||||
*** 322,328 ****
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test87.in>; cursor is at (929, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
<window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
--- 322,328 ----
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test87.in>; cursor is at (930, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
<window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
*** ../vim-7.3.960/src/version.c 2013-05-15 23:13:06.000000000 +0200
|
||||
--- src/version.c 2013-05-16 20:47:38.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 961,
|
||||
/**/
|
||||
|
||||
--
|
||||
When I look deep into your eyes, I see JPEG artifacts.
|
||||
I can tell by the pixels that we're wrong for each other. (xkcd)
|
||||
|
||||
/// 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 ///
|
230
7.3.962
Normal file
230
7.3.962
Normal file
@ -0,0 +1,230 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.962
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.962
|
||||
Problem: Python tests are not portable.
|
||||
Solution: Use shiftwidth instead of iminsert. (ZyX)
|
||||
Files: src/testdir/test86.in, src/testdir/test86.ok,
|
||||
src/testdir/test87.in, src/testdir/test87.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.961/src/testdir/test86.in 2013-05-16 20:47:51.000000000 +0200
|
||||
--- src/testdir/test86.in 2013-05-17 13:34:56.000000000 +0200
|
||||
***************
|
||||
*** 354,360 ****
|
||||
:" 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
|
||||
--- 354,360 ----
|
||||
:" colorcolumn: string, window-local
|
||||
:" statusline: string, window-local/global
|
||||
:" autoindent: boolean, buffer-local
|
||||
! :" shiftwidth: number, buffer-local
|
||||
:" omnifunc: string, buffer-local
|
||||
:" preserveindent: boolean, buffer-local/global
|
||||
:" path: string, buffer-local/global
|
||||
***************
|
||||
*** 411,417 ****
|
||||
: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 ]]
|
||||
--- 411,417 ----
|
||||
: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+=[['shiftwidth', 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 ]]
|
||||
*** ../vim-7.3.961/src/testdir/test86.ok 2013-05-15 16:27:33.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-17 13:34:56.000000000 +0200
|
||||
***************
|
||||
*** 232,238 ****
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
! >>> iminsert
|
||||
p/gopts1! KeyError
|
||||
inv: 3! KeyError
|
||||
gopts1! KeyError
|
||||
--- 232,238 ----
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
! >>> shiftwidth
|
||||
p/gopts1! KeyError
|
||||
inv: 3! KeyError
|
||||
gopts1! KeyError
|
||||
***************
|
||||
*** 241,255 ****
|
||||
wopts1! KeyError
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
! p/bopts1: 2
|
||||
! G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
! G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
>>> omnifunc
|
||||
p/gopts1! KeyError
|
||||
inv: 1! KeyError
|
||||
--- 241,255 ----
|
||||
wopts1! KeyError
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
! p/bopts1: 8
|
||||
! G: 8
|
||||
! W: 1:0 2:2 3:8 4:1
|
||||
! B: 1:0 2:2 3:8 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
! G: 8
|
||||
! W: 1:0 2:2 3:8 4:1
|
||||
! B: 1:0 2:2 3:8 4:1
|
||||
>>> omnifunc
|
||||
p/gopts1! KeyError
|
||||
inv: 1! KeyError
|
||||
***************
|
||||
*** 333,339 ****
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test86.in>; cursor is at (954, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
<window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
--- 333,339 ----
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test86.in>; cursor is at (955, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
<window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
*** ../vim-7.3.961/src/testdir/test87.in 2013-05-16 20:47:51.000000000 +0200
|
||||
--- src/testdir/test87.in 2013-05-17 13:34:56.000000000 +0200
|
||||
***************
|
||||
*** 341,347 ****
|
||||
:" 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
|
||||
--- 341,347 ----
|
||||
:" colorcolumn: string, window-local
|
||||
:" statusline: string, window-local/global
|
||||
:" autoindent: boolean, buffer-local
|
||||
! :" shiftwidth: number, buffer-local
|
||||
:" omnifunc: string, buffer-local
|
||||
:" preserveindent: boolean, buffer-local/global
|
||||
:" path: string, buffer-local/global
|
||||
***************
|
||||
*** 398,404 ****
|
||||
: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 ]]
|
||||
--- 398,404 ----
|
||||
: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+=[['shiftwidth', 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 ]]
|
||||
*** ../vim-7.3.961/src/testdir/test87.ok 2013-05-16 20:47:51.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-17 13:34:56.000000000 +0200
|
||||
***************
|
||||
*** 221,227 ****
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
! >>> iminsert
|
||||
p/gopts1! KeyError
|
||||
inv: 3! KeyError
|
||||
gopts1! KeyError
|
||||
--- 221,227 ----
|
||||
G: 0
|
||||
W: 1:0 2:1 3:0 4:1
|
||||
B: 1:0 2:1 3:0 4:1
|
||||
! >>> shiftwidth
|
||||
p/gopts1! KeyError
|
||||
inv: 3! KeyError
|
||||
gopts1! KeyError
|
||||
***************
|
||||
*** 230,244 ****
|
||||
wopts1! KeyError
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
! p/bopts1: 2
|
||||
! G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
! G: 1
|
||||
! W: 1:0 2:2 3:2 4:1
|
||||
! B: 1:0 2:2 3:2 4:1
|
||||
>>> omnifunc
|
||||
p/gopts1! KeyError
|
||||
inv: 1! KeyError
|
||||
--- 230,244 ----
|
||||
wopts1! KeyError
|
||||
wopts2! KeyError
|
||||
wopts3! KeyError
|
||||
! p/bopts1: 8
|
||||
! G: 8
|
||||
! W: 1:0 2:2 3:8 4:1
|
||||
! B: 1:0 2:2 3:8 4:1
|
||||
del wopts3! KeyError
|
||||
del bopts3! ValueError
|
||||
! G: 8
|
||||
! W: 1:0 2:2 3:8 4:1
|
||||
! B: 1:0 2:2 3:8 4:1
|
||||
>>> omnifunc
|
||||
p/gopts1! KeyError
|
||||
inv: 1! KeyError
|
||||
*** ../vim-7.3.961/src/version.c 2013-05-16 20:47:51.000000000 +0200
|
||||
--- src/version.c 2013-05-17 13:36:36.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 962,
|
||||
/**/
|
||||
|
||||
--
|
||||
TIM: To the north there lies a cave, the cave of Caerbannog, wherein, carved
|
||||
in mystic runes, upon the very living rock, the last words of Olfin
|
||||
Bedwere of Rheged make plain the last resting place of the most Holy
|
||||
Grail.
|
||||
"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 ///
|
720
7.3.963
Normal file
720
7.3.963
Normal file
@ -0,0 +1,720 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.963
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.963
|
||||
Problem: Setting curbuf without curwin causes trouble.
|
||||
Solution: Add switch_buffer() and restore_buffer(). Block autocommands to
|
||||
avoid trouble.
|
||||
Files: src/eval.c, src/proto/eval.pro, src/proto/window.pro,
|
||||
src/if_py_both.h, src/window.c, src/testdir/test86.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.962/src/eval.c 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/eval.c 2013-05-17 14:50:35.000000000 +0200
|
||||
***************
|
||||
*** 11894,11900 ****
|
||||
win_T *win, *oldcurwin;
|
||||
char_u *varname;
|
||||
dictitem_T *v;
|
||||
! tabpage_T *tp;
|
||||
int done = FALSE;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
--- 11894,11900 ----
|
||||
win_T *win, *oldcurwin;
|
||||
char_u *varname;
|
||||
dictitem_T *v;
|
||||
! tabpage_T *tp, *oldtabpage;
|
||||
int done = FALSE;
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
***************
|
||||
*** 11912,11922 ****
|
||||
|
||||
if (win != NULL && varname != NULL)
|
||||
{
|
||||
! /* Set curwin to be our win, temporarily. Also set curbuf, so
|
||||
! * that we can get buffer-local options. */
|
||||
! oldcurwin = curwin;
|
||||
! curwin = win;
|
||||
! curbuf = win->w_buffer;
|
||||
|
||||
if (*varname == '&') /* window-local-option */
|
||||
{
|
||||
--- 11912,11920 ----
|
||||
|
||||
if (win != NULL && varname != NULL)
|
||||
{
|
||||
! /* Set curwin to be our win, temporarily. Also set the tabpage,
|
||||
! * otherwise the window is not valid. */
|
||||
! switch_win(&oldcurwin, &oldtabpage, win, tp);
|
||||
|
||||
if (*varname == '&') /* window-local-option */
|
||||
{
|
||||
***************
|
||||
*** 11936,11943 ****
|
||||
}
|
||||
|
||||
/* restore previous notion of curwin */
|
||||
! curwin = oldcurwin;
|
||||
! curbuf = curwin->w_buffer;
|
||||
}
|
||||
|
||||
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
|
||||
--- 11934,11940 ----
|
||||
}
|
||||
|
||||
/* restore previous notion of curwin */
|
||||
! restore_win(oldcurwin, oldtabpage);
|
||||
}
|
||||
|
||||
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
|
||||
***************
|
||||
*** 16641,16684 ****
|
||||
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, FALSE, FALSE);
|
||||
- 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 (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;
|
||||
- curbuf = curwin->w_buffer;
|
||||
- }
|
||||
- #endif
|
||||
- }
|
||||
-
|
||||
/*
|
||||
* "setwinvar()" and "settabwinvar()" functions
|
||||
*/
|
||||
--- 16638,16643 ----
|
||||
*** ../vim-7.3.962/src/proto/eval.pro 2013-05-15 14:39:47.000000000 +0200
|
||||
--- src/proto/eval.pro 2013-05-17 16:01:40.000000000 +0200
|
||||
***************
|
||||
*** 33,38 ****
|
||||
--- 33,40 ----
|
||||
void prof_child_exit __ARGS((proftime_T *tm));
|
||||
int eval_foldexpr __ARGS((char_u *arg, int *cp));
|
||||
void ex_let __ARGS((exarg_T *eap));
|
||||
+ void list_add_watch __ARGS((list_T *l, listwatch_T *lw));
|
||||
+ void list_rem_watch __ARGS((list_T *l, listwatch_T *lwrem));
|
||||
void *eval_for_line __ARGS((char_u *arg, int *errp, char_u **nextcmdp, int skip));
|
||||
int next_for_item __ARGS((void *fi_void, char_u *arg));
|
||||
void free_for_info __ARGS((void *fi_void));
|
||||
***************
|
||||
*** 125,132 ****
|
||||
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 *));
|
||||
- void list_add_watch __ARGS((list_T *l, listwatch_T *lw));
|
||||
- void list_rem_watch __ARGS((list_T *l, listwatch_T *lwrem));
|
||||
/* vim: set ft=c : */
|
||||
--- 127,130 ----
|
||||
*** ../vim-7.3.962/src/proto/window.pro 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/proto/window.pro 2013-05-17 15:04:14.000000000 +0200
|
||||
***************
|
||||
*** 32,37 ****
|
||||
--- 32,38 ----
|
||||
void tabpage_move __ARGS((int nr));
|
||||
void win_goto __ARGS((win_T *wp));
|
||||
win_T *win_find_nr __ARGS((int winnr));
|
||||
+ tabpage_T *win_find_tabpage __ARGS((win_T *win));
|
||||
void win_enter __ARGS((win_T *wp, int undo_sync));
|
||||
win_T *buf_jump_open_win __ARGS((buf_T *buf));
|
||||
win_T *buf_jump_open_tab __ARGS((buf_T *buf));
|
||||
***************
|
||||
*** 69,74 ****
|
||||
--- 70,79 ----
|
||||
void check_lnums __ARGS((int do_curwin));
|
||||
void make_snapshot __ARGS((int idx));
|
||||
void restore_snapshot __ARGS((int idx, int close_curwin));
|
||||
+ int switch_win __ARGS((win_T **save_curwin, tabpage_T **save_curtab, win_T *win, tabpage_T *tp));
|
||||
+ void restore_win __ARGS((win_T *save_curwin, tabpage_T *save_curtab));
|
||||
+ void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf));
|
||||
+ void restore_buffer __ARGS((buf_T *save_curbuf));
|
||||
int win_hasvertsplit __ARGS((void));
|
||||
int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id));
|
||||
int match_delete __ARGS((win_T *wp, int id, int perr));
|
||||
*** ../vim-7.3.962/src/if_py_both.h 2013-05-15 19:07:03.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-17 15:57:08.000000000 +0200
|
||||
***************
|
||||
*** 1413,1426 ****
|
||||
{
|
||||
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;
|
||||
--- 1413,1426 ----
|
||||
{
|
||||
win_T *save_curwin;
|
||||
tabpage_T *save_curtab;
|
||||
! buf_T *save_curbuf;
|
||||
int r = 0;
|
||||
|
||||
switch (opt_type)
|
||||
{
|
||||
case SREQ_WIN:
|
||||
! if (switch_win(&save_curwin, &save_curtab, (win_T *)from,
|
||||
! win_find_tabpage((win_T *)from)) == FAIL)
|
||||
{
|
||||
PyErr_SetVim("Problem while switching windows.");
|
||||
return -1;
|
||||
***************
|
||||
*** 1429,1437 ****
|
||||
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);
|
||||
--- 1429,1437 ----
|
||||
restore_win(save_curwin, save_curtab);
|
||||
break;
|
||||
case SREQ_BUF:
|
||||
! switch_buffer(&save_curbuf, (buf_T *)from);
|
||||
set_option_value(key, numval, stringval, opt_flags);
|
||||
! restore_buffer(save_curbuf);
|
||||
break;
|
||||
case SREQ_GLOBAL:
|
||||
set_option_value(key, numval, stringval, opt_flags);
|
||||
***************
|
||||
*** 2240,2249 ****
|
||||
*/
|
||||
if (line == Py_None || line == NULL)
|
||||
{
|
||||
! buf_T *savebuf = curbuf;
|
||||
|
||||
PyErr_Clear();
|
||||
! curbuf = buf;
|
||||
|
||||
if (u_savedel((linenr_T)n, 1L) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
--- 2240,2249 ----
|
||||
*/
|
||||
if (line == Py_None || line == NULL)
|
||||
{
|
||||
! buf_T *savebuf;
|
||||
|
||||
PyErr_Clear();
|
||||
! switch_buffer(&savebuf, buf);
|
||||
|
||||
if (u_savedel((linenr_T)n, 1L) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
***************
|
||||
*** 2251,2262 ****
|
||||
PyErr_SetVim(_("cannot delete line"));
|
||||
else
|
||||
{
|
||||
! if (buf == curwin->w_buffer)
|
||||
py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1);
|
||||
deleted_lines_mark((linenr_T)n, 1L);
|
||||
}
|
||||
|
||||
! curbuf = savebuf;
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
return FAIL;
|
||||
--- 2251,2262 ----
|
||||
PyErr_SetVim(_("cannot delete line"));
|
||||
else
|
||||
{
|
||||
! if (buf == savebuf)
|
||||
py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1);
|
||||
deleted_lines_mark((linenr_T)n, 1L);
|
||||
}
|
||||
|
||||
! restore_buffer(savebuf);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
return FAIL;
|
||||
***************
|
||||
*** 2269,2282 ****
|
||||
else if (PyString_Check(line))
|
||||
{
|
||||
char *save = StringToLine(line);
|
||||
! buf_T *savebuf = curbuf;
|
||||
|
||||
if (save == NULL)
|
||||
return FAIL;
|
||||
|
||||
/* We do not need to free "save" if ml_replace() consumes it. */
|
||||
PyErr_Clear();
|
||||
! curbuf = buf;
|
||||
|
||||
if (u_savesub((linenr_T)n) == FAIL)
|
||||
{
|
||||
--- 2269,2282 ----
|
||||
else if (PyString_Check(line))
|
||||
{
|
||||
char *save = StringToLine(line);
|
||||
! buf_T *savebuf;
|
||||
|
||||
if (save == NULL)
|
||||
return FAIL;
|
||||
|
||||
/* We do not need to free "save" if ml_replace() consumes it. */
|
||||
PyErr_Clear();
|
||||
! switch_buffer(&savebuf, buf);
|
||||
|
||||
if (u_savesub((linenr_T)n) == FAIL)
|
||||
{
|
||||
***************
|
||||
*** 2291,2300 ****
|
||||
else
|
||||
changed_bytes((linenr_T)n, 0);
|
||||
|
||||
! curbuf = savebuf;
|
||||
|
||||
/* Check that the cursor is not beyond the end of the line now. */
|
||||
! if (buf == curwin->w_buffer)
|
||||
check_cursor_col();
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
--- 2291,2300 ----
|
||||
else
|
||||
changed_bytes((linenr_T)n, 0);
|
||||
|
||||
! restore_buffer(savebuf);
|
||||
|
||||
/* Check that the cursor is not beyond the end of the line now. */
|
||||
! if (buf == savebuf)
|
||||
check_cursor_col();
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
***************
|
||||
*** 2333,2342 ****
|
||||
{
|
||||
PyInt i;
|
||||
PyInt n = (int)(hi - lo);
|
||||
! buf_T *savebuf = curbuf;
|
||||
|
||||
PyErr_Clear();
|
||||
! curbuf = buf;
|
||||
|
||||
if (u_savedel((linenr_T)lo, (long)n) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
--- 2333,2342 ----
|
||||
{
|
||||
PyInt i;
|
||||
PyInt n = (int)(hi - lo);
|
||||
! buf_T *savebuf;
|
||||
|
||||
PyErr_Clear();
|
||||
! switch_buffer(&savebuf, buf);
|
||||
|
||||
if (u_savedel((linenr_T)lo, (long)n) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
***************
|
||||
*** 2350,2361 ****
|
||||
break;
|
||||
}
|
||||
}
|
||||
! if (buf == curwin->w_buffer)
|
||||
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
|
||||
deleted_lines_mark((linenr_T)lo, (long)i);
|
||||
}
|
||||
|
||||
! curbuf = savebuf;
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
return FAIL;
|
||||
--- 2350,2361 ----
|
||||
break;
|
||||
}
|
||||
}
|
||||
! if (buf == savebuf)
|
||||
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
|
||||
deleted_lines_mark((linenr_T)lo, (long)i);
|
||||
}
|
||||
|
||||
! restore_buffer(savebuf);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
return FAIL;
|
||||
***************
|
||||
*** 2400,2409 ****
|
||||
}
|
||||
}
|
||||
|
||||
- savebuf = curbuf;
|
||||
-
|
||||
PyErr_Clear();
|
||||
! curbuf = buf;
|
||||
|
||||
if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
--- 2400,2409 ----
|
||||
}
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
!
|
||||
! // START of region without "return". Must call restore_buffer()!
|
||||
! switch_buffer(&savebuf, buf);
|
||||
|
||||
if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
***************
|
||||
*** 2480,2489 ****
|
||||
(long)MAXLNUM, (long)extra);
|
||||
changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
|
||||
|
||||
! if (buf == curwin->w_buffer)
|
||||
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra);
|
||||
|
||||
! curbuf = savebuf;
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
return FAIL;
|
||||
--- 2480,2490 ----
|
||||
(long)MAXLNUM, (long)extra);
|
||||
changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra);
|
||||
|
||||
! if (buf == savebuf)
|
||||
py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra);
|
||||
|
||||
! // END of region without "return".
|
||||
! restore_buffer(savebuf);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
return FAIL;
|
||||
***************
|
||||
*** 2522,2531 ****
|
||||
if (str == NULL)
|
||||
return FAIL;
|
||||
|
||||
- savebuf = curbuf;
|
||||
-
|
||||
PyErr_Clear();
|
||||
! curbuf = buf;
|
||||
|
||||
if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
--- 2523,2530 ----
|
||||
if (str == NULL)
|
||||
return FAIL;
|
||||
|
||||
PyErr_Clear();
|
||||
! switch_buffer(&savebuf, buf);
|
||||
|
||||
if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
***************
|
||||
*** 2535,2541 ****
|
||||
appended_lines_mark((linenr_T)n, 1L);
|
||||
|
||||
vim_free(str);
|
||||
! curbuf = savebuf;
|
||||
update_screen(VALID);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
--- 2534,2540 ----
|
||||
appended_lines_mark((linenr_T)n, 1L);
|
||||
|
||||
vim_free(str);
|
||||
! restore_buffer(savebuf);
|
||||
update_screen(VALID);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
***************
|
||||
*** 2574,2583 ****
|
||||
}
|
||||
}
|
||||
|
||||
- savebuf = curbuf;
|
||||
-
|
||||
PyErr_Clear();
|
||||
! curbuf = buf;
|
||||
|
||||
if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
--- 2573,2580 ----
|
||||
}
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
! switch_buffer(&savebuf, buf);
|
||||
|
||||
if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL)
|
||||
PyErr_SetVim(_("cannot save undo information"));
|
||||
***************
|
||||
*** 2607,2613 ****
|
||||
*/
|
||||
vim_free(array);
|
||||
|
||||
! curbuf = savebuf;
|
||||
update_screen(VALID);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
--- 2604,2610 ----
|
||||
*/
|
||||
vim_free(array);
|
||||
|
||||
! restore_buffer(savebuf);
|
||||
update_screen(VALID);
|
||||
|
||||
if (PyErr_Occurred() || VimErrorCheck())
|
||||
***************
|
||||
*** 3023,3029 ****
|
||||
pos_T *posp;
|
||||
char *pmark;
|
||||
char mark;
|
||||
! buf_T *curbuf_save;
|
||||
|
||||
if (CheckBuffer((BufferObject *)(self)))
|
||||
return NULL;
|
||||
--- 3020,3026 ----
|
||||
pos_T *posp;
|
||||
char *pmark;
|
||||
char mark;
|
||||
! buf_T *savebuf;
|
||||
|
||||
if (CheckBuffer((BufferObject *)(self)))
|
||||
return NULL;
|
||||
***************
|
||||
*** 3032,3041 ****
|
||||
return NULL;
|
||||
mark = *pmark;
|
||||
|
||||
! curbuf_save = curbuf;
|
||||
! curbuf = ((BufferObject *)(self))->buf;
|
||||
posp = getmark(mark, FALSE);
|
||||
! curbuf = curbuf_save;
|
||||
|
||||
if (posp == NULL)
|
||||
{
|
||||
--- 3029,3037 ----
|
||||
return NULL;
|
||||
mark = *pmark;
|
||||
|
||||
! switch_buffer(&savebuf, ((BufferObject *)(self))->buf);
|
||||
posp = getmark(mark, FALSE);
|
||||
! restore_buffer(savebuf);
|
||||
|
||||
if (posp == NULL)
|
||||
{
|
||||
*** ../vim-7.3.962/src/window.c 2013-05-15 23:13:06.000000000 +0200
|
||||
--- src/window.c 2013-05-17 15:57:17.000000000 +0200
|
||||
***************
|
||||
*** 4058,4063 ****
|
||||
--- 4058,4082 ----
|
||||
}
|
||||
#endif
|
||||
|
||||
+ #if (defined(FEAT_WINDOWS) && defined(FEAT_PYTHON)) || defined(PROTO)
|
||||
+ /*
|
||||
+ * Find the tabpage for window "win".
|
||||
+ */
|
||||
+ tabpage_T *
|
||||
+ win_find_tabpage(win)
|
||||
+ win_T *win;
|
||||
+ {
|
||||
+ win_T *wp;
|
||||
+ tabpage_T *tp;
|
||||
+
|
||||
+ for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
+ for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
|
||||
+ if (wp == win)
|
||||
+ return tp;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ #endif
|
||||
+
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
/*
|
||||
* Move to window above or below "count" times.
|
||||
***************
|
||||
*** 6550,6555 ****
|
||||
--- 6569,6673 ----
|
||||
|
||||
#endif
|
||||
|
||||
+ #if defined(FEAT_EVAL) || defined(PROTO)
|
||||
+ /*
|
||||
+ * Set "win" to be the curwin and "tp" to be the current tab page.
|
||||
+ * restore_win() MUST be called to undo.
|
||||
+ * No autocommands will be executed.
|
||||
+ * Returns FAIL if switching to "win" failed.
|
||||
+ */
|
||||
+ 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_AUTOCMD
|
||||
+ block_autocmds();
|
||||
+ # endif
|
||||
+ # ifdef FEAT_WINDOWS
|
||||
+ *save_curwin = curwin;
|
||||
+ if (tp != NULL)
|
||||
+ {
|
||||
+ *save_curtab = curtab;
|
||||
+ goto_tabpage_tp(tp, FALSE, FALSE);
|
||||
+ }
|
||||
+ if (!win_valid(win))
|
||||
+ {
|
||||
+ # ifdef FEAT_AUTOCMD
|
||||
+ unblock_autocmds();
|
||||
+ # endif
|
||||
+ return FAIL;
|
||||
+ }
|
||||
+ curwin = win;
|
||||
+ curbuf = curwin->w_buffer;
|
||||
+ # endif
|
||||
+ return OK;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Restore current tabpage and window saved by switch_win(), if still valid.
|
||||
+ */
|
||||
+ void
|
||||
+ restore_win(save_curwin, save_curtab)
|
||||
+ win_T *save_curwin;
|
||||
+ tabpage_T *save_curtab;
|
||||
+ {
|
||||
+ # ifdef FEAT_WINDOWS
|
||||
+ if (save_curtab != NULL && valid_tabpage(save_curtab))
|
||||
+ goto_tabpage_tp(save_curtab, FALSE, FALSE);
|
||||
+ if (win_valid(save_curwin))
|
||||
+ {
|
||||
+ curwin = save_curwin;
|
||||
+ curbuf = curwin->w_buffer;
|
||||
+ }
|
||||
+ # endif
|
||||
+ # ifdef FEAT_AUTOCMD
|
||||
+ unblock_autocmds();
|
||||
+ # endif
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Make "buf" the current buffer. restore_buffer() MUST be called to undo.
|
||||
+ * No autocommands will be executed. Use aucmd_prepbuf() if there are any.
|
||||
+ */
|
||||
+ void
|
||||
+ switch_buffer(save_curbuf, buf)
|
||||
+ buf_T *buf;
|
||||
+ buf_T **save_curbuf;
|
||||
+ {
|
||||
+ # ifdef FEAT_AUTOCMD
|
||||
+ block_autocmds();
|
||||
+ # endif
|
||||
+ *save_curbuf = curbuf;
|
||||
+ --curbuf->b_nwindows;
|
||||
+ curbuf = buf;
|
||||
+ curwin->w_buffer = buf;
|
||||
+ ++curbuf->b_nwindows;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Restore the current buffer after using switch_buffer().
|
||||
+ */
|
||||
+ void
|
||||
+ restore_buffer(save_curbuf)
|
||||
+ buf_T *save_curbuf;
|
||||
+ {
|
||||
+ # ifdef FEAT_AUTOCMD
|
||||
+ unblock_autocmds();
|
||||
+ # endif
|
||||
+ /* Check for valid buffer, just in case. */
|
||||
+ if (buf_valid(save_curbuf))
|
||||
+ {
|
||||
+ --curbuf->b_nwindows;
|
||||
+ curwin->w_buffer = save_curbuf;
|
||||
+ curbuf = save_curbuf;
|
||||
+ ++curbuf->b_nwindows;
|
||||
+ }
|
||||
+ }
|
||||
+ #endif
|
||||
+
|
||||
#if (defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE if there is any vertically split window.
|
||||
*** ../vim-7.3.962/src/testdir/test86.ok 2013-05-17 13:37:57.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-17 14:48:57.000000000 +0200
|
||||
***************
|
||||
*** 333,339 ****
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test86.in>; cursor is at (955, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
<window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
--- 333,339 ----
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test86.in>; cursor is at (954, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
<window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
*** ../vim-7.3.962/src/version.c 2013-05-17 13:37:57.000000000 +0200
|
||||
--- src/version.c 2013-05-17 15:59:48.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 963,
|
||||
/**/
|
||||
|
||||
--
|
||||
TIM: That is not an ordinary rabbit ... 'tis the most foul cruel and
|
||||
bad-tempered thing you ever set eyes on.
|
||||
ROBIN: You tit. I soiled my armour I was so scared!
|
||||
"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 ///
|
405
7.3.964
Normal file
405
7.3.964
Normal file
@ -0,0 +1,405 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.964
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.964
|
||||
Problem: Python: not so easy to access tab pages.
|
||||
Solution: Add window.tabpage, make window.number work with non-current tab
|
||||
pages. (ZyX)
|
||||
Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c,
|
||||
src/if_python.c, src/testdir/test86.ok, src/testdir/test87.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.963/runtime/doc/if_pyth.txt 2013-05-15 18:28:08.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-17 16:07:16.000000000 +0200
|
||||
***************
|
||||
*** 433,440 ****
|
||||
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.
|
||||
--- 433,441 ----
|
||||
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.
|
||||
+ tabpage (read-only) Window 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.
|
||||
***************
|
||||
*** 490,496 ****
|
||||
< *:py3file*
|
||||
The |:py3file| command works similar to |:pyfile|.
|
||||
|
||||
! *:py3do*
|
||||
:[range]py3do {body} Execute Python function "def _vim_pydo(line, linenr):
|
||||
{body}" for each line in the [range], with the
|
||||
function arguments being set to the text of each line
|
||||
--- 491,497 ----
|
||||
< *:py3file*
|
||||
The |:py3file| command works similar to |:pyfile|.
|
||||
|
||||
! *:py3do* *E863*
|
||||
:[range]py3do {body} Execute Python function "def _vim_pydo(line, linenr):
|
||||
{body}" for each line in the [range], with the
|
||||
function arguments being set to the text of each line
|
||||
*** ../vim-7.3.963/src/if_py_both.h 2013-05-17 16:03:53.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-17 16:07:16.000000000 +0200
|
||||
***************
|
||||
*** 31,36 ****
|
||||
--- 31,39 ----
|
||||
|
||||
static int ConvertFromPyObject(PyObject *, typval_T *);
|
||||
static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *);
|
||||
+ static PyObject *WindowNew(win_T *, tabpage_T *);
|
||||
+ static PyObject *BufferNew (buf_T *);
|
||||
+ static PyObject *LineToString(const char *);
|
||||
|
||||
static PyInt RangeStart;
|
||||
static PyInt RangeEnd;
|
||||
***************
|
||||
*** 1670,1678 ****
|
||||
/* For current tab window.c does not bother to set or update tp_curwin
|
||||
*/
|
||||
if (this->tab == curtab)
|
||||
! return WindowNew(curwin);
|
||||
else
|
||||
! return WindowNew(this->tab->tp_curwin);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
--- 1673,1681 ----
|
||||
/* For current tab window.c does not bother to set or update tp_curwin
|
||||
*/
|
||||
if (this->tab == curtab)
|
||||
! return WindowNew(curwin, curtab);
|
||||
else
|
||||
! return WindowNew(this->tab->tp_curwin, this->tab);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
***************
|
||||
*** 1754,1759 ****
|
||||
--- 1757,1763 ----
|
||||
{
|
||||
PyObject_HEAD
|
||||
win_T *win;
|
||||
+ TabPageObject *tabObject;
|
||||
} WindowObject;
|
||||
|
||||
static PyTypeObject WindowType;
|
||||
***************
|
||||
*** 1771,1777 ****
|
||||
}
|
||||
|
||||
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,
|
||||
--- 1775,1781 ----
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
! WindowNew(win_T *win, tabpage_T *tab)
|
||||
{
|
||||
/* We need to handle deletion of windows underneath us.
|
||||
* If we add a "w_python*_ref" field to the win_T structure,
|
||||
***************
|
||||
*** 1804,1809 ****
|
||||
--- 1808,1815 ----
|
||||
WIN_PYTHON_REF(win) = self;
|
||||
}
|
||||
|
||||
+ self->tabObject = ((TabPageObject *)(TabPageNew(tab)));
|
||||
+
|
||||
return (PyObject *)(self);
|
||||
}
|
||||
|
||||
***************
|
||||
*** 1815,1823 ****
|
||||
--- 1821,1849 ----
|
||||
if (this->win && this->win != INVALID_WINDOW_VALUE)
|
||||
WIN_PYTHON_REF(this->win) = NULL;
|
||||
|
||||
+ Py_DECREF(((PyObject *)(this->tabObject)));
|
||||
+
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
|
||||
+ static win_T *
|
||||
+ get_firstwin(TabPageObject *tabObject)
|
||||
+ {
|
||||
+ if (tabObject)
|
||||
+ {
|
||||
+ if (CheckTabPage(tabObject))
|
||||
+ return NULL;
|
||||
+ /* For current tab window.c does not bother to set or update tp_firstwin
|
||||
+ */
|
||||
+ else if (tabObject->tab == curtab)
|
||||
+ return firstwin;
|
||||
+ else
|
||||
+ return tabObject->tab->tp_firstwin;
|
||||
+ }
|
||||
+ else
|
||||
+ return firstwin;
|
||||
+ }
|
||||
+
|
||||
static PyObject *
|
||||
WindowAttr(WindowObject *this, char *name)
|
||||
{
|
||||
***************
|
||||
*** 1847,1856 ****
|
||||
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, firstwin));
|
||||
else if (strcmp(name,"__members__") == 0)
|
||||
! return Py_BuildValue("[ssssssss]", "buffer", "cursor", "height", "vars",
|
||||
! "options", "number", "row", "col");
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
--- 1873,1892 ----
|
||||
return OptionsNew(SREQ_WIN, this->win, (checkfun) CheckWindow,
|
||||
(PyObject *) this);
|
||||
else if (strcmp(name, "number") == 0)
|
||||
! {
|
||||
! if (CheckTabPage(this->tabObject))
|
||||
! return NULL;
|
||||
! return PyLong_FromLong((long)
|
||||
! get_win_number(this->win, get_firstwin(this->tabObject)));
|
||||
! }
|
||||
! else if (strcmp(name, "tabpage") == 0)
|
||||
! {
|
||||
! Py_INCREF(this->tabObject);
|
||||
! return (PyObject *)(this->tabObject);
|
||||
! }
|
||||
else if (strcmp(name,"__members__") == 0)
|
||||
! return Py_BuildValue("[sssssssss]", "buffer", "cursor", "height",
|
||||
! "vars", "options", "number", "row", "col", "tabpage");
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
***************
|
||||
*** 2016,2046 ****
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
|
||||
- static win_T *
|
||||
- get_firstwin(WinListObject *this)
|
||||
- {
|
||||
- if (this->tabObject)
|
||||
- {
|
||||
- if (CheckTabPage(this->tabObject))
|
||||
- return NULL;
|
||||
- /* For current tab window.c does not bother to set or update tp_firstwin
|
||||
- */
|
||||
- else if (this->tabObject->tab == curtab)
|
||||
- return firstwin;
|
||||
- else
|
||||
- return this->tabObject->tab->tp_firstwin;
|
||||
- }
|
||||
- else
|
||||
- return firstwin;
|
||||
- }
|
||||
-
|
||||
static PyInt
|
||||
WinListLength(PyObject *self)
|
||||
{
|
||||
win_T *w;
|
||||
PyInt n = 0;
|
||||
|
||||
! if (!(w = get_firstwin((WinListObject *)(self))))
|
||||
return -1;
|
||||
|
||||
while (w != NULL)
|
||||
--- 2052,2064 ----
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
|
||||
static PyInt
|
||||
WinListLength(PyObject *self)
|
||||
{
|
||||
win_T *w;
|
||||
PyInt n = 0;
|
||||
|
||||
! if (!(w = get_firstwin(((WinListObject *)(self))->tabObject)))
|
||||
return -1;
|
||||
|
||||
while (w != NULL)
|
||||
***************
|
||||
*** 2055,2068 ****
|
||||
static PyObject *
|
||||
WinListItem(PyObject *self, PyInt n)
|
||||
{
|
||||
win_T *w;
|
||||
|
||||
! if (!(w = get_firstwin((WinListObject *)(self))))
|
||||
return NULL;
|
||||
|
||||
for (; w != NULL; w = W_NEXT(w), --n)
|
||||
if (n == 0)
|
||||
! return WindowNew(w);
|
||||
|
||||
PyErr_SetString(PyExc_IndexError, _("no such window"));
|
||||
return NULL;
|
||||
--- 2073,2087 ----
|
||||
static PyObject *
|
||||
WinListItem(PyObject *self, PyInt n)
|
||||
{
|
||||
+ WinListObject *this = ((WinListObject *)(self));
|
||||
win_T *w;
|
||||
|
||||
! if (!(w = get_firstwin(this->tabObject)))
|
||||
return NULL;
|
||||
|
||||
for (; w != NULL; w = W_NEXT(w), --n)
|
||||
if (n == 0)
|
||||
! return WindowNew(w, this->tabObject? this->tabObject->tab: curtab);
|
||||
|
||||
PyErr_SetString(PyExc_IndexError, _("no such window"));
|
||||
return NULL;
|
||||
***************
|
||||
*** 3227,3233 ****
|
||||
if (strcmp(name, "buffer") == 0)
|
||||
return (PyObject *)BufferNew(curbuf);
|
||||
else if (strcmp(name, "window") == 0)
|
||||
! return (PyObject *)WindowNew(curwin);
|
||||
else if (strcmp(name, "tabpage") == 0)
|
||||
return (PyObject *)TabPageNew(curtab);
|
||||
else if (strcmp(name, "line") == 0)
|
||||
--- 3246,3252 ----
|
||||
if (strcmp(name, "buffer") == 0)
|
||||
return (PyObject *)BufferNew(curbuf);
|
||||
else if (strcmp(name, "window") == 0)
|
||||
! return (PyObject *)WindowNew(curwin, curtab);
|
||||
else if (strcmp(name, "tabpage") == 0)
|
||||
return (PyObject *)TabPageNew(curtab);
|
||||
else if (strcmp(name, "line") == 0)
|
||||
*** ../vim-7.3.963/src/if_python3.c 2013-05-15 19:44:35.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-17 16:07:16.000000000 +0200
|
||||
***************
|
||||
*** 611,619 ****
|
||||
}
|
||||
#endif /* DYNAMIC_PYTHON3 */
|
||||
|
||||
- static PyObject *BufferNew (buf_T *);
|
||||
- static PyObject *WindowNew(win_T *);
|
||||
- static PyObject *LineToString(const char *);
|
||||
static PyObject *BufferDir(PyObject *, PyObject *);
|
||||
|
||||
static int py3initialised = 0;
|
||||
--- 611,616 ----
|
||||
*** ../vim-7.3.963/src/if_python.c 2013-05-15 17:49:00.000000000 +0200
|
||||
--- src/if_python.c 2013-05-17 16:07:16.000000000 +0200
|
||||
***************
|
||||
*** 610,620 ****
|
||||
}
|
||||
#endif /* DYNAMIC_PYTHON */
|
||||
|
||||
- static PyObject *BufferNew (buf_T *);
|
||||
- static PyObject *WindowNew(win_T *);
|
||||
- static PyObject *DictionaryNew(dict_T *);
|
||||
- static PyObject *LineToString(const char *);
|
||||
-
|
||||
static int initialised = 0;
|
||||
#define PYINITIALISED initialised
|
||||
|
||||
--- 610,615 ----
|
||||
*** ../vim-7.3.963/src/testdir/test86.ok 2013-05-17 16:03:53.000000000 +0200
|
||||
--- src/testdir/test86.ok 2013-05-17 16:10:26.000000000 +0200
|
||||
***************
|
||||
*** 333,346 ****
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test86.in>; cursor is at (954, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
<tabpage 2>(3): 2 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer a.1>; cursor is at (1, 0)
|
||||
! <window object (unknown)>(0): displays buffer <buffer 1>; cursor is at (1, 0)
|
||||
<tabpage 3>(4): 4 windows, current is <window 0>
|
||||
Windows:
|
||||
<window 0>(1): displays buffer <buffer c.2>; cursor is at (1, 0)
|
||||
--- 333,346 ----
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(1): displays buffer <buffer test86.in>; cursor is at (954, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(1): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
<tabpage 2>(3): 2 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(1): displays buffer <buffer a.1>; cursor is at (1, 0)
|
||||
! <window object (unknown)>(2): displays buffer <buffer 1>; cursor is at (1, 0)
|
||||
<tabpage 3>(4): 4 windows, current is <window 0>
|
||||
Windows:
|
||||
<window 0>(1): displays buffer <buffer c.2>; cursor is at (1, 0)
|
||||
*** ../vim-7.3.963/src/testdir/test87.ok 2013-05-17 13:37:57.000000000 +0200
|
||||
--- src/testdir/test87.ok 2013-05-17 16:07:16.000000000 +0200
|
||||
***************
|
||||
*** 322,335 ****
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer test87.in>; cursor is at (930, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
<tabpage 2>(3): 2 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(0): displays buffer <buffer a.1>; cursor is at (1, 0)
|
||||
! <window object (unknown)>(0): displays buffer <buffer 1>; cursor is at (1, 0)
|
||||
<tabpage 3>(4): 4 windows, current is <window 0>
|
||||
Windows:
|
||||
<window 0>(1): displays buffer <buffer c.2>; cursor is at (1, 0)
|
||||
--- 322,335 ----
|
||||
Current tab pages:
|
||||
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(1): displays buffer <buffer test87.in>; cursor is at (930, 0)
|
||||
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(1): displays buffer <buffer 0>; cursor is at (1, 0)
|
||||
<tabpage 2>(3): 2 windows, current is <window object (unknown)>
|
||||
Windows:
|
||||
! <window object (unknown)>(1): displays buffer <buffer a.1>; cursor is at (1, 0)
|
||||
! <window object (unknown)>(2): displays buffer <buffer 1>; cursor is at (1, 0)
|
||||
<tabpage 3>(4): 4 windows, current is <window 0>
|
||||
Windows:
|
||||
<window 0>(1): displays buffer <buffer c.2>; cursor is at (1, 0)
|
||||
*** ../vim-7.3.963/src/version.c 2013-05-17 16:03:53.000000000 +0200
|
||||
--- src/version.c 2013-05-17 16:11:15.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 964,
|
||||
/**/
|
||||
|
||||
--
|
||||
ARTHUR: Go on, Bors, chop its head off.
|
||||
BORS: Right. Silly little bleeder. One rabbit stew coming up.
|
||||
"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 ///
|
331
7.3.965
Normal file
331
7.3.965
Normal file
@ -0,0 +1,331 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.965
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.965
|
||||
Problem: Python garbage collection not working properly.
|
||||
Solution: Add support for garbage collection. (ZyX)
|
||||
Files: src/if_py_both.h
|
||||
|
||||
|
||||
*** ../vim-7.3.964/src/if_py_both.h 2013-05-17 16:18:27.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-17 16:21:05.000000000 +0200
|
||||
***************
|
||||
*** 543,548 ****
|
||||
--- 543,550 ----
|
||||
|
||||
typedef PyObject *(*nextfun)(void **);
|
||||
typedef void (*destructorfun)(void *);
|
||||
+ typedef int (*traversefun)(void *, visitproc, void *);
|
||||
+ typedef int (*clearfun)(void **);
|
||||
|
||||
/* Main purpose of this object is removing the need for do python initialization
|
||||
* (i.e. PyType_Ready and setting type attributes) for a big bunch of objects.
|
||||
***************
|
||||
*** 554,563 ****
|
||||
void *cur;
|
||||
nextfun next;
|
||||
destructorfun destruct;
|
||||
} IterObject;
|
||||
|
||||
static PyObject *
|
||||
! IterNew(void *start, destructorfun destruct, nextfun next)
|
||||
{
|
||||
IterObject *self;
|
||||
|
||||
--- 556,568 ----
|
||||
void *cur;
|
||||
nextfun next;
|
||||
destructorfun destruct;
|
||||
+ traversefun traverse;
|
||||
+ clearfun clear;
|
||||
} IterObject;
|
||||
|
||||
static PyObject *
|
||||
! IterNew(void *start, destructorfun destruct, nextfun next, traversefun traverse,
|
||||
! clearfun clear)
|
||||
{
|
||||
IterObject *self;
|
||||
|
||||
***************
|
||||
*** 565,570 ****
|
||||
--- 570,577 ----
|
||||
self->cur = start;
|
||||
self->next = next;
|
||||
self->destruct = destruct;
|
||||
+ self->traverse = traverse;
|
||||
+ self->clear = clear;
|
||||
|
||||
return (PyObject *)(self);
|
||||
}
|
||||
***************
|
||||
*** 579,584 ****
|
||||
--- 586,613 ----
|
||||
DESTRUCTOR_FINISH(self);
|
||||
}
|
||||
|
||||
+ static int
|
||||
+ IterTraverse(PyObject *self, visitproc visit, void *arg)
|
||||
+ {
|
||||
+ IterObject *this = (IterObject *)(self);
|
||||
+
|
||||
+ if (this->traverse != NULL)
|
||||
+ return this->traverse(this->cur, visit, arg);
|
||||
+ else
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ static int
|
||||
+ IterClear(PyObject *self)
|
||||
+ {
|
||||
+ IterObject *this = (IterObject *)(self);
|
||||
+
|
||||
+ if (this->clear != NULL)
|
||||
+ return this->clear(&this->cur);
|
||||
+ else
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
static PyObject *
|
||||
IterNext(PyObject *self)
|
||||
{
|
||||
***************
|
||||
*** 1034,1040 ****
|
||||
lii->list = l;
|
||||
|
||||
return IterNew(lii,
|
||||
! (destructorfun) ListIterDestruct, (nextfun) ListIterNext);
|
||||
}
|
||||
|
||||
static int
|
||||
--- 1063,1070 ----
|
||||
lii->list = l;
|
||||
|
||||
return IterNew(lii,
|
||||
! (destructorfun) ListIterDestruct, (nextfun) ListIterNext,
|
||||
! NULL, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
***************
|
||||
*** 1348,1353 ****
|
||||
--- 1378,1430 ----
|
||||
PyObject *fromObj;
|
||||
} OptionsObject;
|
||||
|
||||
+ 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 int
|
||||
+ OptionsTraverse(PyObject *self, visitproc visit, void *arg)
|
||||
+ {
|
||||
+ Py_VISIT(((OptionsObject *)(self))->fromObj);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ static int
|
||||
+ OptionsClear(PyObject *self)
|
||||
+ {
|
||||
+ Py_CLEAR(((OptionsObject *)(self))->fromObj);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
static PyObject *
|
||||
OptionsItem(OptionsObject *this, PyObject *keyObject)
|
||||
{
|
||||
***************
|
||||
*** 1562,1600 ****
|
||||
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,
|
||||
--- 1639,1644 ----
|
||||
***************
|
||||
*** 1843,1848 ****
|
||||
--- 1887,1905 ----
|
||||
else
|
||||
return firstwin;
|
||||
}
|
||||
+ static int
|
||||
+ WindowTraverse(PyObject *self, visitproc visit, void *arg)
|
||||
+ {
|
||||
+ Py_VISIT(((PyObject *)(((WindowObject *)(self))->tabObject)));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ static int
|
||||
+ WindowClear(PyObject *self)
|
||||
+ {
|
||||
+ Py_CLEAR((((WindowObject *)(self))->tabObject));
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
static PyObject *
|
||||
WindowAttr(WindowObject *this, char *name)
|
||||
***************
|
||||
*** 3193,3198 ****
|
||||
--- 3250,3269 ----
|
||||
}
|
||||
}
|
||||
|
||||
+ static int
|
||||
+ BufMapIterTraverse(PyObject *buffer, visitproc visit, void *arg)
|
||||
+ {
|
||||
+ Py_VISIT(buffer);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ static int
|
||||
+ BufMapIterClear(PyObject **buffer)
|
||||
+ {
|
||||
+ Py_CLEAR(*buffer);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
static PyObject *
|
||||
BufMapIterNext(PyObject **buffer)
|
||||
{
|
||||
***************
|
||||
*** 3228,3234 ****
|
||||
|
||||
buffer = BufferNew(firstbuf);
|
||||
return IterNew(buffer,
|
||||
! (destructorfun) BufMapIterDestruct, (nextfun) BufMapIterNext);
|
||||
}
|
||||
|
||||
static PyMappingMethods BufMapAsMapping = {
|
||||
--- 3299,3306 ----
|
||||
|
||||
buffer = BufferNew(firstbuf);
|
||||
return IterNew(buffer,
|
||||
! (destructorfun) BufMapIterDestruct, (nextfun) BufMapIterNext,
|
||||
! (traversefun) BufMapIterTraverse, (clearfun) BufMapIterClear);
|
||||
}
|
||||
|
||||
static PyMappingMethods BufMapAsMapping = {
|
||||
***************
|
||||
*** 3837,3842 ****
|
||||
--- 3909,3916 ----
|
||||
IterType.tp_iter = IterIter;
|
||||
IterType.tp_iternext = IterNext;
|
||||
IterType.tp_dealloc = IterDestructor;
|
||||
+ IterType.tp_traverse = IterTraverse;
|
||||
+ IterType.tp_clear = IterClear;
|
||||
|
||||
vim_memset(&BufferType, 0, sizeof(BufferType));
|
||||
BufferType.tp_name = "vim.buffer";
|
||||
***************
|
||||
*** 3865,3870 ****
|
||||
--- 3939,3946 ----
|
||||
WindowType.tp_flags = Py_TPFLAGS_DEFAULT;
|
||||
WindowType.tp_doc = "vim Window object";
|
||||
WindowType.tp_methods = WindowMethods;
|
||||
+ WindowType.tp_traverse = WindowTraverse;
|
||||
+ WindowType.tp_clear = WindowClear;
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
WindowType.tp_getattro = WindowGetattro;
|
||||
WindowType.tp_setattro = WindowSetattro;
|
||||
***************
|
||||
*** 4003,4008 ****
|
||||
--- 4079,4086 ----
|
||||
OptionsType.tp_doc = "object for manipulating options";
|
||||
OptionsType.tp_as_mapping = &OptionsAsMapping;
|
||||
OptionsType.tp_dealloc = OptionsDestructor;
|
||||
+ OptionsType.tp_traverse = OptionsTraverse;
|
||||
+ OptionsType.tp_clear = OptionsClear;
|
||||
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
vim_memset(&vimmodule, 0, sizeof(vimmodule));
|
||||
*** ../vim-7.3.964/src/version.c 2013-05-17 16:18:27.000000000 +0200
|
||||
--- src/version.c 2013-05-17 16:21:24.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 965,
|
||||
/**/
|
||||
|
||||
--
|
||||
ARTHUR: Charge!
|
||||
[They all charge with swords drawn towards the RABBIT. A tremendous twenty
|
||||
second fight with Peckinpahish shots and borrowing heavily also on the
|
||||
Kung Fu and karate-type films ensues, in which some four KNIGHTS are
|
||||
comprehensively killed.]
|
||||
ARTHUR: Run away! Run away!
|
||||
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
|
||||
|
||||
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
||||
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
||||
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
||||
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
301
7.3.966
Normal file
301
7.3.966
Normal file
@ -0,0 +1,301 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.966
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.966
|
||||
Problem: There is ":py3do" but no ":pydo".
|
||||
Solution: Add the ":pydo" command. (Lilydjwg)
|
||||
Files: runtime/doc/if_pyth.txt, src/ex_cmds.h, src/ex_docmd.c,
|
||||
src/if_py_both.h, src/if_python.c, src/if_python3.c,
|
||||
src/proto/if_python.pro
|
||||
|
||||
|
||||
*** ../vim-7.3.965/runtime/doc/if_pyth.txt 2013-05-17 16:18:27.000000000 +0200
|
||||
--- runtime/doc/if_pyth.txt 2013-05-17 16:34:28.000000000 +0200
|
||||
***************
|
||||
*** 57,62 ****
|
||||
--- 57,78 ----
|
||||
Note: Python is very sensitive to the indenting. Make sure the "class" line
|
||||
and "EOF" do not have any indent.
|
||||
|
||||
+ *:pydo*
|
||||
+ :[range]pydo {body} Execute Python function "def _vim_pydo(line, linenr):
|
||||
+ {body}" for each line in the [range], with the
|
||||
+ function arguments being set to the text of each line
|
||||
+ in turn, without a trailing <EOL>, and the current
|
||||
+ line number. The function should return a string or
|
||||
+ None. If a string is returned, it becomes the text of
|
||||
+ the line in the current turn. The default for [range]
|
||||
+ is the whole file: "1,$".
|
||||
+ {not in Vi}
|
||||
+
|
||||
+ Examples:
|
||||
+ >
|
||||
+ :pydo return "%s\t%d" % (line[::-1], len(line))
|
||||
+ :pydo if line: return "%4d: %s" % (linenr, line)
|
||||
+ <
|
||||
*:pyfile* *:pyf*
|
||||
:[range]pyf[ile] {file}
|
||||
Execute the Python script in {file}. The whole
|
||||
***************
|
||||
*** 485,511 ****
|
||||
8. Python 3 *python3*
|
||||
|
||||
*: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|.
|
||||
!
|
||||
*:py3do* *E863*
|
||||
! :[range]py3do {body} Execute Python function "def _vim_pydo(line, linenr):
|
||||
! {body}" for each line in the [range], with the
|
||||
! function arguments being set to the text of each line
|
||||
! in turn, without a trailing <EOL>, and the current
|
||||
! line number. The function should return a string or
|
||||
! None. If a string is returned, it becomes the text of
|
||||
! the line in the current turn. The default for [range]
|
||||
! is the whole file: "1,$".
|
||||
! {not in Vi}
|
||||
|
||||
- Examples:
|
||||
- >
|
||||
- :py3do return "%s\t%d" % (line[::-1], len(line))
|
||||
- :py3do if line: return "%4d: %s" % (linenr, line)
|
||||
|
||||
Vim can be built in four ways (:version output):
|
||||
1. No Python support (-python, -python3)
|
||||
--- 501,514 ----
|
||||
8. Python 3 *python3*
|
||||
|
||||
*: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`.
|
||||
*:py3do* *E863*
|
||||
! The `:py3do` command works similar to `:pydo`.
|
||||
|
||||
|
||||
Vim can be built in four ways (:version output):
|
||||
1. No Python support (-python, -python3)
|
||||
*** ../vim-7.3.965/src/ex_cmds.h 2013-05-15 18:28:08.000000000 +0200
|
||||
--- src/ex_cmds.h 2013-05-17 16:29:38.000000000 +0200
|
||||
***************
|
||||
*** 739,744 ****
|
||||
--- 739,746 ----
|
||||
TRLBAR|CMDWIN),
|
||||
EX(CMD_python, "python", ex_python,
|
||||
RANGE|EXTRA|NEEDARG|CMDWIN),
|
||||
+ EX(CMD_pydo, "pydo", ex_pydo,
|
||||
+ RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
|
||||
EX(CMD_pyfile, "pyfile", ex_pyfile,
|
||||
RANGE|FILE1|NEEDARG|CMDWIN),
|
||||
EX(CMD_py3, "py3", ex_py3,
|
||||
*** ../vim-7.3.965/src/ex_docmd.c 2013-05-15 18:28:08.000000000 +0200
|
||||
--- src/ex_docmd.c 2013-05-17 16:29:38.000000000 +0200
|
||||
***************
|
||||
*** 268,273 ****
|
||||
--- 268,274 ----
|
||||
#endif
|
||||
#ifndef FEAT_PYTHON
|
||||
# define ex_python ex_script_ni
|
||||
+ # define ex_pydo ex_ni
|
||||
# define ex_pyfile ex_ni
|
||||
#endif
|
||||
#ifndef FEAT_PYTHON3
|
||||
*** ../vim-7.3.965/src/if_py_both.h 2013-05-17 16:24:27.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-17 16:29:38.000000000 +0200
|
||||
***************
|
||||
*** 22,27 ****
|
||||
--- 22,28 ----
|
||||
#else
|
||||
# define ENC_OPT "latin1"
|
||||
#endif
|
||||
+ #define DOPY_FUNC "_vim_pydo"
|
||||
|
||||
#define PyErr_SetVim(str) PyErr_SetString(VimError, str)
|
||||
|
||||
*** ../vim-7.3.965/src/if_python.c 2013-05-17 16:18:27.000000000 +0200
|
||||
--- src/if_python.c 2013-05-17 16:29:38.000000000 +0200
|
||||
***************
|
||||
*** 198,203 ****
|
||||
--- 198,206 ----
|
||||
# define PyModule_GetDict dll_PyModule_GetDict
|
||||
# define PyRun_SimpleString dll_PyRun_SimpleString
|
||||
# define PyRun_String dll_PyRun_String
|
||||
+ # define PyObject_GetAttrString dll_PyObject_GetAttrString
|
||||
+ # define PyObject_SetAttrString dll_PyObject_SetAttrString
|
||||
+ # define PyObject_CallFunctionObjArgs dll_PyObject_CallFunctionObjArgs
|
||||
# define PyString_AsString dll_PyString_AsString
|
||||
# define PyString_AsStringAndSize dll_PyString_AsStringAndSize
|
||||
# define PyString_FromString dll_PyString_FromString
|
||||
***************
|
||||
*** 303,308 ****
|
||||
--- 306,314 ----
|
||||
static PyObject*(*dll_PyModule_GetDict)(PyObject *);
|
||||
static int(*dll_PyRun_SimpleString)(char *);
|
||||
static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *);
|
||||
+ static PyObject* (*dll_PyObject_GetAttrString)(PyObject *, const char *);
|
||||
+ static PyObject* (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *);
|
||||
+ static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...);
|
||||
static char*(*dll_PyString_AsString)(PyObject *);
|
||||
static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *);
|
||||
static PyObject*(*dll_PyString_FromString)(const char *);
|
||||
***************
|
||||
*** 440,445 ****
|
||||
--- 446,454 ----
|
||||
{"PyModule_GetDict", (PYTHON_PROC*)&dll_PyModule_GetDict},
|
||||
{"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString},
|
||||
{"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String},
|
||||
+ {"PyObject_GetAttrString", (PYTHON_PROC*)&dll_PyObject_GetAttrString},
|
||||
+ {"PyObject_SetAttrString", (PYTHON_PROC*)&dll_PyObject_SetAttrString},
|
||||
+ {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&dll_PyObject_CallFunctionObjArgs},
|
||||
{"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString},
|
||||
{"PyString_AsStringAndSize", (PYTHON_PROC*)&dll_PyString_AsStringAndSize},
|
||||
{"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString},
|
||||
***************
|
||||
*** 995,1000 ****
|
||||
--- 1004,1096 ----
|
||||
DoPythonCommand(eap, buffer, NULL);
|
||||
}
|
||||
|
||||
+ void
|
||||
+ ex_pydo(exarg_T *eap)
|
||||
+ {
|
||||
+ linenr_T i;
|
||||
+ const char *code_hdr = "def " DOPY_FUNC "(line, linenr):\n ";
|
||||
+ const char *s = (const char *) eap->arg;
|
||||
+ size_t len;
|
||||
+ char *code;
|
||||
+ int status;
|
||||
+ PyObject *pyfunc, *pymain;
|
||||
+ PyGILState_STATE pygilstate;
|
||||
+
|
||||
+ if (Python_Init())
|
||||
+ return;
|
||||
+
|
||||
+ if (u_save(eap->line1 - 1, eap->line2 + 1) != OK)
|
||||
+ {
|
||||
+ EMSG(_("cannot save undo information"));
|
||||
+ return;
|
||||
+ }
|
||||
+ len = strlen(code_hdr) + strlen(s);
|
||||
+ code = malloc(len + 1);
|
||||
+ STRCPY(code, code_hdr);
|
||||
+ STRNCAT(code, s, len + 1);
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ status = PyRun_SimpleString(code);
|
||||
+ vim_free(code);
|
||||
+ if (status)
|
||||
+ {
|
||||
+ EMSG(_("failed to run the code"));
|
||||
+ return;
|
||||
+ }
|
||||
+ status = 0; /* good */
|
||||
+ pymain = PyImport_AddModule("__main__");
|
||||
+ pyfunc = PyObject_GetAttrString(pymain, DOPY_FUNC);
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+
|
||||
+ for (i = eap->line1; i <= eap->line2; i++)
|
||||
+ {
|
||||
+ const char *line;
|
||||
+ PyObject *pyline, *pylinenr, *pyret;
|
||||
+
|
||||
+ line = (char *)ml_get(i);
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ pyline = PyString_FromStringAndSize(line, strlen(line));
|
||||
+ pylinenr = PyLong_FromLong(i);
|
||||
+ pyret = PyObject_CallFunctionObjArgs(pyfunc, pyline, pylinenr, NULL);
|
||||
+ Py_DECREF(pyline);
|
||||
+ Py_DECREF(pylinenr);
|
||||
+ if (!pyret)
|
||||
+ {
|
||||
+ PyErr_PrintEx(0);
|
||||
+ PythonIO_Flush();
|
||||
+ status = 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (pyret && pyret != Py_None)
|
||||
+ {
|
||||
+ if (!PyString_Check(pyret))
|
||||
+ {
|
||||
+ EMSG(_("E863: return value must be an instance of str"));
|
||||
+ Py_XDECREF(pyret);
|
||||
+ status = 1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ ml_replace(i, (char_u *) PyString_AsString(pyret), 1);
|
||||
+ changed();
|
||||
+ #ifdef SYNTAX_HL
|
||||
+ syn_changed(i); /* recompute syntax hl. for this line */
|
||||
+ #endif
|
||||
+ }
|
||||
+ Py_XDECREF(pyret);
|
||||
+ PythonIO_Flush();
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+ }
|
||||
+ pygilstate = PyGILState_Ensure();
|
||||
+ out:
|
||||
+ Py_DECREF(pyfunc);
|
||||
+ PyObject_SetAttrString(pymain, DOPY_FUNC, NULL);
|
||||
+ PyGILState_Release(pygilstate);
|
||||
+ if (status)
|
||||
+ return;
|
||||
+ check_cursor();
|
||||
+ update_curbuf(NOT_VALID);
|
||||
+ }
|
||||
+
|
||||
/******************************************************
|
||||
* 2. Python output stream: writes output via [e]msg().
|
||||
*/
|
||||
*** ../vim-7.3.965/src/if_python3.c 2013-05-17 16:18:27.000000000 +0200
|
||||
--- src/if_python3.c 2013-05-17 16:29:38.000000000 +0200
|
||||
***************
|
||||
*** 76,82 ****
|
||||
#else
|
||||
# define CODEC_ERROR_HANDLER NULL
|
||||
#endif
|
||||
- #define DOPY_FUNC "_vim_pydo"
|
||||
|
||||
/* Python 3 does not support CObjects, always use Capsules */
|
||||
#define PY_USE_CAPSULE
|
||||
--- 76,81 ----
|
||||
*** ../vim-7.3.965/src/proto/if_python.pro 2013-05-15 15:12:25.000000000 +0200
|
||||
--- src/proto/if_python.pro 2013-05-17 16:29:38.000000000 +0200
|
||||
***************
|
||||
*** 3,8 ****
|
||||
--- 3,9 ----
|
||||
void python_end __ARGS((void));
|
||||
int python_loaded __ARGS((void));
|
||||
void ex_python __ARGS((exarg_T *eap));
|
||||
+ void ex_pydo __ARGS((exarg_T *eap));
|
||||
void ex_pyfile __ARGS((exarg_T *eap));
|
||||
void python_buffer_free __ARGS((buf_T *buf));
|
||||
void python_window_free __ARGS((win_T *win));
|
||||
*** ../vim-7.3.965/src/version.c 2013-05-17 16:24:27.000000000 +0200
|
||||
--- src/version.c 2013-05-17 16:39:19.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 966,
|
||||
/**/
|
||||
|
||||
--
|
||||
A hamburger walks into a bar, and the bartender says: "I'm sorry,
|
||||
but we don't serve food here."
|
||||
|
||||
/// 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 ///
|
112
7.3.967
Normal file
112
7.3.967
Normal file
@ -0,0 +1,112 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.9
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.967 (after 7.3.965)
|
||||
Problem: Build fails on Mac OSX. (Greg Novack)
|
||||
Solution: Undefine clear().
|
||||
Files: src/if_py_both.h
|
||||
|
||||
|
||||
*** ../vim-7.3.966/src/if_py_both.h 2013-05-17 16:39:59.000000000 +0200
|
||||
--- src/if_py_both.h 2013-05-17 20:40:47.000000000 +0200
|
||||
***************
|
||||
*** 474,480 ****
|
||||
static PyObject *ConvertToPyObject(typval_T *);
|
||||
|
||||
static PyObject *
|
||||
! VimEvalPy(PyObject *self UNUSED, PyObject *args UNUSED)
|
||||
{
|
||||
char *expr;
|
||||
typval_T *our_tv;
|
||||
--- 474,480 ----
|
||||
static PyObject *ConvertToPyObject(typval_T *);
|
||||
|
||||
static PyObject *
|
||||
! VimEvalPy(PyObject *self UNUSED, PyObject *args)
|
||||
{
|
||||
char *expr;
|
||||
typval_T *our_tv;
|
||||
***************
|
||||
*** 547,555 ****
|
||||
typedef int (*traversefun)(void *, visitproc, void *);
|
||||
typedef int (*clearfun)(void **);
|
||||
|
||||
! /* Main purpose of this object is removing the need for do python initialization
|
||||
! * (i.e. PyType_Ready and setting type attributes) for a big bunch of objects.
|
||||
! */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
--- 547,555 ----
|
||||
typedef int (*traversefun)(void *, visitproc, void *);
|
||||
typedef int (*clearfun)(void **);
|
||||
|
||||
! /* Main purpose of this object is removing the need for do python
|
||||
! * initialization (i.e. PyType_Ready and setting type attributes) for a big
|
||||
! * bunch of objects. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
***************
|
||||
*** 598,603 ****
|
||||
--- 598,608 ----
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /* Mac OSX defines clear() somewhere. */
|
||||
+ #ifdef clear
|
||||
+ # undef clear
|
||||
+ #endif
|
||||
+
|
||||
static int
|
||||
IterClear(PyObject *self)
|
||||
{
|
||||
***************
|
||||
*** 3287,3295 ****
|
||||
else if (!(next = BufferNew(((BufferObject *)(r))->buf->b_next)))
|
||||
return NULL;
|
||||
*buffer = next;
|
||||
! /* Do not increment reference: we no longer hold it (decref), but whoever on
|
||||
! * other side will hold (incref). Decref+incref = nothing.
|
||||
! */
|
||||
return r;
|
||||
}
|
||||
|
||||
--- 3292,3299 ----
|
||||
else if (!(next = BufferNew(((BufferObject *)(r))->buf->b_next)))
|
||||
return NULL;
|
||||
*buffer = next;
|
||||
! /* Do not increment reference: we no longer hold it (decref), but whoever
|
||||
! * on other side will hold (incref). Decref+incref = nothing. */
|
||||
return r;
|
||||
}
|
||||
|
||||
*** ../vim-7.3.966/src/version.c 2013-05-17 16:39:59.000000000 +0200
|
||||
--- src/version.c 2013-05-17 21:19:17.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 967,
|
||||
/**/
|
||||
|
||||
--
|
||||
ARTHUR: What does it say?
|
||||
BROTHER MAYNARD: It reads ... "Here may be found the last words of Joseph of
|
||||
Aramathea." "He who is valorous and pure of heart may find
|
||||
the Holy Grail in the aaaaarrrrrrggghhh..."
|
||||
ARTHUR: What?
|
||||
BROTHER MAYNARD: "The Aaaaarrrrrrggghhh..."
|
||||
"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 ///
|
58
7.3.968
Normal file
58
7.3.968
Normal file
@ -0,0 +1,58 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.968
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.968
|
||||
Problem: Multi-byte support is only available when compiled with "big"
|
||||
features.
|
||||
Solution: Include multi-byte by default, with "normal" features.
|
||||
Files: src/feature.h
|
||||
|
||||
|
||||
*** ../vim-7.3.967/src/feature.h 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/feature.h 2013-05-18 20:18:20.000000000 +0200
|
||||
***************
|
||||
*** 638,644 ****
|
||||
* Disabled for EBCDIC:
|
||||
* Multibyte support doesn't work on z/OS Unix currently.
|
||||
*/
|
||||
! #if (defined(FEAT_BIG) || defined(FEAT_GUI_GTK) || defined(FEAT_ARABIC)) \
|
||||
&& !defined(FEAT_MBYTE) && !defined(WIN16) \
|
||||
&& SIZEOF_INT >= 4 && !defined(EBCDIC)
|
||||
# define FEAT_MBYTE
|
||||
--- 638,644 ----
|
||||
* Disabled for EBCDIC:
|
||||
* Multibyte support doesn't work on z/OS Unix currently.
|
||||
*/
|
||||
! #if (defined(FEAT_NORMAL) || defined(FEAT_GUI_GTK) || defined(FEAT_ARABIC)) \
|
||||
&& !defined(FEAT_MBYTE) && !defined(WIN16) \
|
||||
&& SIZEOF_INT >= 4 && !defined(EBCDIC)
|
||||
# define FEAT_MBYTE
|
||||
*** ../vim-7.3.967/src/version.c 2013-05-17 21:20:13.000000000 +0200
|
||||
--- src/version.c 2013-05-18 20:21:19.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 968,
|
||||
/**/
|
||||
|
||||
--
|
||||
VOICE OVER: As the horrendous Black Beast lunged forward, escape for Arthur
|
||||
and his knights seemed hopeless, when, suddenly ... the animator
|
||||
suffered a fatal heart attack.
|
||||
ANIMATOR: Aaaaagh!
|
||||
VOICE OVER: The cartoon peril was no more ... The Quest for Holy Grail could
|
||||
continue.
|
||||
"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 ///
|
55
7.3.969
Normal file
55
7.3.969
Normal file
@ -0,0 +1,55 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.969
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.969
|
||||
Problem: Can't built with Python 3 and without Python 2.
|
||||
Solution: Adjust #ifdef. (Xavier de Gaye)
|
||||
Files: src/window.c
|
||||
|
||||
|
||||
*** ../vim-7.3.968/src/window.c 2013-05-17 16:03:53.000000000 +0200
|
||||
--- src/window.c 2013-05-18 20:53:21.000000000 +0200
|
||||
***************
|
||||
*** 4058,4064 ****
|
||||
}
|
||||
#endif
|
||||
|
||||
! #if (defined(FEAT_WINDOWS) && defined(FEAT_PYTHON)) || defined(PROTO)
|
||||
/*
|
||||
* Find the tabpage for window "win".
|
||||
*/
|
||||
--- 4058,4065 ----
|
||||
}
|
||||
#endif
|
||||
|
||||
! #if (defined(FEAT_WINDOWS) && (defined(FEAT_PYTHON) || defined(FEAT_PYTHON3))) \
|
||||
! || defined(PROTO)
|
||||
/*
|
||||
* Find the tabpage for window "win".
|
||||
*/
|
||||
*** ../vim-7.3.968/src/version.c 2013-05-18 20:45:51.000000000 +0200
|
||||
--- src/version.c 2013-05-18 20:54:16.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 969,
|
||||
/**/
|
||||
|
||||
--
|
||||
ROBIN: (warily) And if you get a question wrong?
|
||||
ARTHUR: You are cast into the Gorge of Eternal Peril.
|
||||
ROBIN: Oh ... wacho!
|
||||
"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 ///
|
135
7.3.971
Normal file
135
7.3.971
Normal file
@ -0,0 +1,135 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.971
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.971
|
||||
Problem: No support for VS2012 static code analysis.
|
||||
Solution: Add the ANALYZE option. (Mike Williams)
|
||||
Files: src/Make_mvc.mak
|
||||
|
||||
|
||||
*** ../vim-7.3.970/src/Make_mvc.mak 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/Make_mvc.mak 2013-05-19 16:38:29.000000000 +0200
|
||||
***************
|
||||
*** 20,26 ****
|
||||
#
|
||||
# !!!! After changing features do "nmake clean" first !!!!
|
||||
#
|
||||
! # Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
|
||||
#
|
||||
# GUI interface: GUI=yes (default is no)
|
||||
#
|
||||
--- 20,26 ----
|
||||
#
|
||||
# !!!! After changing features do "nmake clean" first !!!!
|
||||
#
|
||||
! # Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
|
||||
#
|
||||
# GUI interface: GUI=yes (default is no)
|
||||
#
|
||||
***************
|
||||
*** 87,106 ****
|
||||
# GETTEXT=[yes or no] (default is yes)
|
||||
# See http://sourceforge.net/projects/gettext/
|
||||
#
|
||||
! # PostScript printing: POSTSCRIPT=yes (default is no)
|
||||
#
|
||||
! # Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
|
||||
#
|
||||
! # XPM Image Support: XPM=[path to XPM directory]
|
||||
! # Default is "xpm", using the files included in the distribution.
|
||||
! # Use "no" to disable this feature.
|
||||
#
|
||||
! # Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
|
||||
#
|
||||
! # Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
|
||||
! # i386)
|
||||
#
|
||||
! # Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
|
||||
#
|
||||
# Debug version: DEBUG=yes
|
||||
# Mapfile: MAP=[no, yes or lines] (default is yes)
|
||||
--- 87,106 ----
|
||||
# GETTEXT=[yes or no] (default is yes)
|
||||
# See http://sourceforge.net/projects/gettext/
|
||||
#
|
||||
! # PostScript printing: POSTSCRIPT=yes (default is no)
|
||||
#
|
||||
! # Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
|
||||
#
|
||||
! # XPM Image Support: XPM=[path to XPM directory]
|
||||
! # Default is "xpm", using the files included in the distribution.
|
||||
! # Use "no" to disable this feature.
|
||||
#
|
||||
! # Optimization: OPTIMIZE=[SPACE, SPEED, MAXSPEED] (default is MAXSPEED)
|
||||
#
|
||||
! # Processor Version: CPUNR=[i386, i486, i586, i686, pentium4] (default is
|
||||
! # i386)
|
||||
#
|
||||
! # Version Support: WINVER=[0x0400, 0x0500] (default is 0x0400)
|
||||
#
|
||||
# Debug version: DEBUG=yes
|
||||
# Mapfile: MAP=[no, yes or lines] (default is yes)
|
||||
***************
|
||||
*** 108,117 ****
|
||||
# yes: Write a normal mapfile.
|
||||
# lines: Write a mapfile with line numbers (only for VC6 and later)
|
||||
#
|
||||
! # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
|
||||
! # doesn't work)
|
||||
#
|
||||
! # Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
|
||||
#
|
||||
# You can combine any of these interfaces
|
||||
#
|
||||
--- 108,119 ----
|
||||
# yes: Write a normal mapfile.
|
||||
# lines: Write a mapfile with line numbers (only for VC6 and later)
|
||||
#
|
||||
! # Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
|
||||
! # doesn't work)
|
||||
#
|
||||
! # Visual C Version: MSVCVER=m.n (default derived from nmake if undefined)
|
||||
! #
|
||||
! # Static Code Analysis: ANALYZE=yes (works with VS2012 only)
|
||||
#
|
||||
# You can combine any of these interfaces
|
||||
#
|
||||
***************
|
||||
*** 479,484 ****
|
||||
--- 481,491 ----
|
||||
CFLAGS=$(CFLAGS) $(WP64CHECK)
|
||||
!endif
|
||||
|
||||
+ # Static code analysis generally available starting with VS2012
|
||||
+ !if ("$(ANALYZE)" == "yes") && ("$(MSVCVER)" == "11.0")
|
||||
+ CFLAGS=$(CFLAGS) /analyze
|
||||
+ !endif
|
||||
+
|
||||
CFLAGS = $(CFLAGS) $(OPTFLAG) -DNDEBUG $(CPUARG)
|
||||
RCFLAGS = $(rcflags) $(rcvars) -DNDEBUG
|
||||
! ifdef USE_MSVCRT
|
||||
*** ../vim-7.3.970/src/version.c 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/version.c 2013-05-19 21:03:34.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 971,
|
||||
/**/
|
||||
|
||||
|
||||
--
|
||||
It is illegal for a driver to be blindfolded while operating a vehicle.
|
||||
[real standing law in Alabama, United States of America]
|
||||
|
||||
/// 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 ///
|
99
7.3.972
Normal file
99
7.3.972
Normal file
@ -0,0 +1,99 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.972
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.972
|
||||
Problem: Cursor not restored after InsertEnter autocommand if it moved to
|
||||
another line.
|
||||
Solution: Also restore if the saved line number is still valid. Allow
|
||||
setting v:char to skip restoring.
|
||||
Files: src/edit.c, runtime/doc/autocmd.txt
|
||||
|
||||
|
||||
*** ../vim-7.3.971/src/edit.c 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/edit.c 2013-05-19 21:09:37.000000000 +0200
|
||||
***************
|
||||
*** 382,394 ****
|
||||
else
|
||||
ptr = (char_u *)"i";
|
||||
set_vim_var_string(VV_INSERTMODE, ptr, 1);
|
||||
# endif
|
||||
apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf);
|
||||
|
||||
! /* Since Insert mode was not started yet a call to check_cursor_col()
|
||||
! * may have moved the cursor, especially with the "A" command. */
|
||||
! if (curwin->w_cursor.col != save_cursor.col
|
||||
! && curwin->w_cursor.lnum == save_cursor.lnum)
|
||||
{
|
||||
int save_state = State;
|
||||
|
||||
--- 382,402 ----
|
||||
else
|
||||
ptr = (char_u *)"i";
|
||||
set_vim_var_string(VV_INSERTMODE, ptr, 1);
|
||||
+ set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
|
||||
# endif
|
||||
apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf);
|
||||
|
||||
! /* Make sure the cursor didn't move. Do call check_cursor_col() in
|
||||
! * case the text was modified. Since Insert mode was not started yet
|
||||
! * a call to check_cursor_col() may move the cursor, especially with
|
||||
! * the "A" command, thus set State to avoid that. Also check that the
|
||||
! * line number is still valid (lines may have been deleted).
|
||||
! * Do not restore if v:char was set to a non-empty string. */
|
||||
! if (!equalpos(curwin->w_cursor, save_cursor)
|
||||
! # ifdef FEAT_EVAL
|
||||
! && *get_vim_var_str(VV_CHAR) == NUL
|
||||
! # endif
|
||||
! && save_cursor.lnum <= curbuf->b_ml.ml_line_count)
|
||||
{
|
||||
int save_state = State;
|
||||
|
||||
*** ../vim-7.3.971/runtime/doc/autocmd.txt 2013-03-19 13:33:18.000000000 +0100
|
||||
--- runtime/doc/autocmd.txt 2013-05-19 21:05:59.000000000 +0200
|
||||
***************
|
||||
*** 674,681 ****
|
||||
InsertEnter Just before starting Insert mode. Also for
|
||||
Replace mode and Virtual Replace mode. The
|
||||
|v:insertmode| variable indicates the mode.
|
||||
! Be careful not to move the cursor or do
|
||||
! anything else that the user does not expect.
|
||||
*InsertLeave*
|
||||
InsertLeave When leaving Insert mode. Also when using
|
||||
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
||||
--- 691,701 ----
|
||||
InsertEnter Just before starting Insert mode. Also for
|
||||
Replace mode and Virtual Replace mode. The
|
||||
|v:insertmode| variable indicates the mode.
|
||||
! Be careful not to do anything else that the
|
||||
! user does not expect.
|
||||
! The cursor is restored afterwards. If you do
|
||||
! not want that set |v:char| to a non-empty
|
||||
! string.
|
||||
*InsertLeave*
|
||||
InsertLeave When leaving Insert mode. Also when using
|
||||
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
||||
*** ../vim-7.3.971/src/version.c 2013-05-19 21:03:50.000000000 +0200
|
||||
--- src/version.c 2013-05-19 21:13:10.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 972,
|
||||
/**/
|
||||
|
||||
--
|
||||
It is illegal for anyone to try and stop a child from playfully jumping over
|
||||
puddles of water.
|
||||
[real standing law in California, United States of America]
|
||||
|
||||
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
||||
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
||||
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
||||
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
137
7.3.973
Normal file
137
7.3.973
Normal file
@ -0,0 +1,137 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.973
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.973
|
||||
Problem: Compiler warnings. Crash on startup. (Tony Mechelynck)
|
||||
Solution: Change EMSG2 to EMSGN. Make array one character longer.
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.972/src/regexp_nfa.c 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-19 21:56:31.000000000 +0200
|
||||
***************
|
||||
*** 273,279 ****
|
||||
NFA_HEAD, NFA_NHEAD, NFA_ALPHA, NFA_NALPHA,
|
||||
NFA_LOWER, NFA_NLOWER, NFA_UPPER, NFA_NUPPER
|
||||
};
|
||||
! char_u myconfig[9];
|
||||
char_u config[NCONFIGS][9] = {
|
||||
"000000100", /* digit */
|
||||
"100000100", /* non digit */
|
||||
--- 273,279 ----
|
||||
NFA_HEAD, NFA_NHEAD, NFA_ALPHA, NFA_NALPHA,
|
||||
NFA_LOWER, NFA_NLOWER, NFA_UPPER, NFA_NUPPER
|
||||
};
|
||||
! char_u myconfig[10];
|
||||
char_u config[NCONFIGS][9] = {
|
||||
"000000100", /* digit */
|
||||
"100000100", /* non digit */
|
||||
***************
|
||||
*** 400,406 ****
|
||||
}
|
||||
/* try to recognize character classes */
|
||||
for (i = 0; i < NCONFIGS; i++)
|
||||
! if (STRNCMP(myconfig, config[i],8) == 0)
|
||||
return classid[i] + extra_newl;
|
||||
|
||||
/* fallthrough => no success so far */
|
||||
--- 400,406 ----
|
||||
}
|
||||
/* try to recognize character classes */
|
||||
for (i = 0; i < NCONFIGS; i++)
|
||||
! if (STRNCMP(myconfig, config[i], 8) == 0)
|
||||
return classid[i] + extra_newl;
|
||||
|
||||
/* fallthrough => no success so far */
|
||||
***************
|
||||
*** 759,765 ****
|
||||
case Magic('&'):
|
||||
case Magic(')'):
|
||||
syntax_error = TRUE;
|
||||
! EMSG2(_(e_misplaced), no_Magic(c));
|
||||
return FAIL;
|
||||
|
||||
case Magic('='):
|
||||
--- 759,765 ----
|
||||
case Magic('&'):
|
||||
case Magic(')'):
|
||||
syntax_error = TRUE;
|
||||
! EMSGN(_(e_misplaced), no_Magic(c));
|
||||
return FAIL;
|
||||
|
||||
case Magic('='):
|
||||
***************
|
||||
*** 770,776 ****
|
||||
case Magic('{'):
|
||||
/* these should follow an atom, not form an atom */
|
||||
syntax_error = TRUE;
|
||||
! EMSG2(_(e_misplaced), no_Magic(c));
|
||||
return FAIL;
|
||||
|
||||
case Magic('~'): /* previous substitute pattern */
|
||||
--- 770,776 ----
|
||||
case Magic('{'):
|
||||
/* these should follow an atom, not form an atom */
|
||||
syntax_error = TRUE;
|
||||
! EMSGN(_(e_misplaced), no_Magic(c));
|
||||
return FAIL;
|
||||
|
||||
case Magic('~'): /* previous substitute pattern */
|
||||
***************
|
||||
*** 816,822 ****
|
||||
return FAIL;
|
||||
default:
|
||||
syntax_error = TRUE;
|
||||
! EMSG2(_("E867: (NFA) Unknown operator '\\z%c'"),
|
||||
no_Magic(c));
|
||||
return FAIL;
|
||||
}
|
||||
--- 816,822 ----
|
||||
return FAIL;
|
||||
default:
|
||||
syntax_error = TRUE;
|
||||
! EMSGN(_("E867: (NFA) Unknown operator '\\z%c'"),
|
||||
no_Magic(c));
|
||||
return FAIL;
|
||||
}
|
||||
***************
|
||||
*** 1363,1369 ****
|
||||
return FAIL;
|
||||
default:
|
||||
syntax_error = TRUE;
|
||||
! EMSG2(_("E869: (NFA) Unknown operator '\\@%c'"), op);
|
||||
return FAIL;
|
||||
}
|
||||
break;
|
||||
--- 1363,1369 ----
|
||||
return FAIL;
|
||||
default:
|
||||
syntax_error = TRUE;
|
||||
! EMSGN(_("E869: (NFA) Unknown operator '\\@%c'"), op);
|
||||
return FAIL;
|
||||
}
|
||||
break;
|
||||
*** ../vim-7.3.972/src/version.c 2013-05-19 21:15:08.000000000 +0200
|
||||
--- src/version.c 2013-05-19 22:29:03.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 973,
|
||||
/**/
|
||||
|
||||
--
|
||||
Sometimes I think the surest sign that intelligent life exists elsewhere
|
||||
in the universe is that none of it has tried to contact us. (Calvin)
|
||||
|
||||
/// 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 ///
|
158
7.3.974
Normal file
158
7.3.974
Normal file
@ -0,0 +1,158 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.974
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.974
|
||||
Problem: Can't build with ruby 1.8.5.
|
||||
Solution: Only use ruby_init_stack() when RUBY_INIT_STACK is defined.
|
||||
(Yukihiro Nakadaira)
|
||||
Files: src/if_ruby.c
|
||||
|
||||
|
||||
*** ../vim-7.3.973/src/if_ruby.c 2013-05-12 14:10:41.000000000 +0200
|
||||
--- src/if_ruby.c 2013-05-20 12:47:48.000000000 +0200
|
||||
***************
|
||||
*** 158,165 ****
|
||||
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)
|
||||
--- 158,167 ----
|
||||
static void ruby_io_init(void);
|
||||
static void ruby_vim_init(void);
|
||||
|
||||
! #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
! # if defined(__ia64) && !defined(ruby_init_stack)
|
||||
! # define ruby_init_stack(addr) ruby_init_stack((addr), rb_ia64_bsp())
|
||||
! # endif
|
||||
#endif
|
||||
|
||||
#if defined(DYNAMIC_RUBY) || defined(PROTO)
|
||||
***************
|
||||
*** 231,242 ****
|
||||
# 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
|
||||
--- 233,246 ----
|
||||
# define rb_float_new dll_rb_float_new
|
||||
# define rb_ary_new dll_rb_ary_new
|
||||
# define rb_ary_push dll_rb_ary_push
|
||||
! # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
! # 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
|
||||
# endif
|
||||
# else
|
||||
# define rb_str2cstr dll_rb_str2cstr
|
||||
***************
|
||||
*** 346,356 ****
|
||||
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
|
||||
--- 350,362 ----
|
||||
static VALUE (*dll_rb_float_new) (double);
|
||||
static VALUE (*dll_rb_ary_new) (void);
|
||||
static VALUE (*dll_rb_ary_push) (VALUE, VALUE);
|
||||
! # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
! # 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
|
||||
# endif
|
||||
# ifdef RUBY19_OR_LATER
|
||||
***************
|
||||
*** 491,500 ****
|
||||
# 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
|
||||
--- 497,502 ----
|
||||
***************
|
||||
*** 513,518 ****
|
||||
--- 515,526 ----
|
||||
{"rb_require", (RUBY_PROC*)&dll_rb_require},
|
||||
{"ruby_process_options", (RUBY_PROC*)&dll_ruby_process_options},
|
||||
# endif
|
||||
+ # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
+ # ifdef __ia64
|
||||
+ {"rb_ia64_bsp", (RUBY_PROC*)&dll_rb_ia64_bsp},
|
||||
+ # endif
|
||||
+ {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
|
||||
+ # endif
|
||||
{"", NULL},
|
||||
};
|
||||
|
||||
***************
|
||||
*** 735,741 ****
|
||||
NtInitialize(&argc, &argv);
|
||||
#endif
|
||||
{
|
||||
! #if defined(RUBY_VERSION) && RUBY_VERSION >= 18
|
||||
ruby_init_stack(ruby_stack_start);
|
||||
#endif
|
||||
ruby_init();
|
||||
--- 743,749 ----
|
||||
NtInitialize(&argc, &argv);
|
||||
#endif
|
||||
{
|
||||
! #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
|
||||
ruby_init_stack(ruby_stack_start);
|
||||
#endif
|
||||
ruby_init();
|
||||
*** ../vim-7.3.973/src/version.c 2013-05-19 22:31:13.000000000 +0200
|
||||
--- src/version.c 2013-05-20 12:51:22.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 974,
|
||||
/**/
|
||||
|
||||
--
|
||||
bashian roulette:
|
||||
$ ((RANDOM%6)) || rm -rf ~
|
||||
|
||||
/// 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 ///
|
70
7.3.975
Normal file
70
7.3.975
Normal file
@ -0,0 +1,70 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.975
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.975
|
||||
Problem: Crash in regexp parsing.
|
||||
Solution: Correctly compute the end of allocated memory.
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.974/src/regexp_nfa.c 2013-05-19 22:31:13.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-20 13:43:37.000000000 +0200
|
||||
***************
|
||||
*** 231,244 ****
|
||||
/* A reasonable estimation for size */
|
||||
nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
|
||||
|
||||
! /* Size for postfix representation of expr */
|
||||
postfix_size = sizeof(*post_start) * nstate_max;
|
||||
post_start = (int *)lalloc(postfix_size, TRUE);
|
||||
if (post_start == NULL)
|
||||
return FAIL;
|
||||
vim_memset(post_start, 0, postfix_size);
|
||||
post_ptr = post_start;
|
||||
! post_end = post_start + postfix_size;
|
||||
nfa_has_zend = FALSE;
|
||||
|
||||
regcomp_start(expr, re_flags);
|
||||
--- 231,249 ----
|
||||
/* A reasonable estimation for size */
|
||||
nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
|
||||
|
||||
! /* Some items blow up in size, such as [A-z]. Add more space for that.
|
||||
! * TODO: some patterns may still fail. */
|
||||
! // nstate_max += 1000;
|
||||
!
|
||||
! /* Size for postfix representation of expr. */
|
||||
postfix_size = sizeof(*post_start) * nstate_max;
|
||||
+
|
||||
post_start = (int *)lalloc(postfix_size, TRUE);
|
||||
if (post_start == NULL)
|
||||
return FAIL;
|
||||
vim_memset(post_start, 0, postfix_size);
|
||||
post_ptr = post_start;
|
||||
! post_end = post_start + nstate_max;
|
||||
nfa_has_zend = FALSE;
|
||||
|
||||
regcomp_start(expr, re_flags);
|
||||
*** ../vim-7.3.974/src/version.c 2013-05-20 12:52:23.000000000 +0200
|
||||
--- src/version.c 2013-05-20 13:42:10.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 975,
|
||||
/**/
|
||||
|
||||
--
|
||||
My Go, this amn keyboar oesn't have a .
|
||||
|
||||
/// 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 ///
|
87
7.3.976
Normal file
87
7.3.976
Normal file
@ -0,0 +1,87 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.976
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.976
|
||||
Problem: Can't build on HP-UX.
|
||||
Solution: Remove modern initialization. (John Marriott)
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.975/src/regexp_nfa.c 2013-05-20 13:44:24.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-20 13:51:07.000000000 +0200
|
||||
***************
|
||||
*** 1961,1974 ****
|
||||
static Frag_T st_pop __ARGS((Frag_T **p, Frag_T *stack));
|
||||
|
||||
/*
|
||||
! * Initialize Frag_T struct.
|
||||
*/
|
||||
static Frag_T
|
||||
frag(start, out)
|
||||
nfa_state_T *start;
|
||||
Ptrlist *out;
|
||||
{
|
||||
! Frag_T n = { start, out };
|
||||
return n;
|
||||
}
|
||||
|
||||
--- 1961,1977 ----
|
||||
static Frag_T st_pop __ARGS((Frag_T **p, Frag_T *stack));
|
||||
|
||||
/*
|
||||
! * Initialize a Frag_T struct and return it.
|
||||
*/
|
||||
static Frag_T
|
||||
frag(start, out)
|
||||
nfa_state_T *start;
|
||||
Ptrlist *out;
|
||||
{
|
||||
! Frag_T n;
|
||||
!
|
||||
! n.start = start;
|
||||
! n.out = out;
|
||||
return n;
|
||||
}
|
||||
|
||||
***************
|
||||
*** 2144,2150 ****
|
||||
if (postfix == NULL)
|
||||
return NULL;
|
||||
|
||||
! #define PUSH(s) st_push ((s), &stackp, stack_end)
|
||||
#define POP() st_pop(&stackp, stack); \
|
||||
if (stackp < stack) \
|
||||
{ \
|
||||
--- 2147,2153 ----
|
||||
if (postfix == NULL)
|
||||
return NULL;
|
||||
|
||||
! #define PUSH(s) st_push((s), &stackp, stack_end)
|
||||
#define POP() st_pop(&stackp, stack); \
|
||||
if (stackp < stack) \
|
||||
{ \
|
||||
*** ../vim-7.3.975/src/version.c 2013-05-20 13:44:24.000000000 +0200
|
||||
--- src/version.c 2013-05-20 13:54:56.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 976,
|
||||
/**/
|
||||
|
||||
--
|
||||
Dogs must have a permit signed by the mayor in order to congregate in groups
|
||||
of three or more on private property.
|
||||
[real standing law in Oklahoma, United States of America]
|
||||
|
||||
/// 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 ///
|
294
7.3.977
Normal file
294
7.3.977
Normal file
@ -0,0 +1,294 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.977
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.977
|
||||
Problem: Compiler warnings on 64 bit Windows.
|
||||
Solution: Add type casts. (Mike Williams) Also fix some white space and
|
||||
uncomment what was commented-out for testing.
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.976/src/regexp_nfa.c 2013-05-20 13:55:17.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-20 14:24:44.000000000 +0200
|
||||
***************
|
||||
*** 224,239 ****
|
||||
char_u *expr;
|
||||
int re_flags; /* see vim_regcomp() */
|
||||
{
|
||||
! int postfix_size;
|
||||
|
||||
nstate = 0;
|
||||
istate = 0;
|
||||
/* A reasonable estimation for size */
|
||||
! nstate_max = (STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
|
||||
|
||||
/* Some items blow up in size, such as [A-z]. Add more space for that.
|
||||
* TODO: some patterns may still fail. */
|
||||
! // nstate_max += 1000;
|
||||
|
||||
/* Size for postfix representation of expr. */
|
||||
postfix_size = sizeof(*post_start) * nstate_max;
|
||||
--- 224,239 ----
|
||||
char_u *expr;
|
||||
int re_flags; /* see vim_regcomp() */
|
||||
{
|
||||
! size_t postfix_size;
|
||||
|
||||
nstate = 0;
|
||||
istate = 0;
|
||||
/* A reasonable estimation for size */
|
||||
! nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER;
|
||||
|
||||
/* Some items blow up in size, such as [A-z]. Add more space for that.
|
||||
* TODO: some patterns may still fail. */
|
||||
! nstate_max += 1000;
|
||||
|
||||
/* Size for postfix representation of expr. */
|
||||
postfix_size = sizeof(*post_start) * nstate_max;
|
||||
***************
|
||||
*** 2177,2183 ****
|
||||
* No new state added here. */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate += 0;
|
||||
break;
|
||||
}
|
||||
e2 = POP();
|
||||
--- 2177,2183 ----
|
||||
* No new state added here. */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! /* nstate += 0; */
|
||||
break;
|
||||
}
|
||||
e2 = POP();
|
||||
***************
|
||||
*** 2190,2196 ****
|
||||
/* Negation of a character */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate += 0;
|
||||
break;
|
||||
}
|
||||
e1 = POP();
|
||||
--- 2190,2196 ----
|
||||
/* Negation of a character */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! /* nstate += 0; */
|
||||
break;
|
||||
}
|
||||
e1 = POP();
|
||||
***************
|
||||
*** 2204,2210 ****
|
||||
/* Alternation */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
e2 = POP();
|
||||
--- 2204,2210 ----
|
||||
/* Alternation */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
e2 = POP();
|
||||
***************
|
||||
*** 2219,2225 ****
|
||||
/* Zero or more */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
--- 2219,2225 ----
|
||||
/* Zero or more */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
***************
|
||||
*** 2234,2240 ****
|
||||
/* one or zero atoms=> greedy match */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
--- 2234,2240 ----
|
||||
/* one or zero atoms=> greedy match */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
***************
|
||||
*** 2248,2254 ****
|
||||
/* zero or one atoms => non-greedy match */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
--- 2248,2254 ----
|
||||
/* zero or one atoms => non-greedy match */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
***************
|
||||
*** 2262,2268 ****
|
||||
/* One or more */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
--- 2262,2268 ----
|
||||
/* One or more */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
e = POP();
|
||||
***************
|
||||
*** 2278,2284 ****
|
||||
* with max/min count of 0 */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
s = new_state(NFA_SKIP_CHAR, NULL, NULL);
|
||||
--- 2278,2284 ----
|
||||
* with max/min count of 0 */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
s = new_state(NFA_SKIP_CHAR, NULL, NULL);
|
||||
***************
|
||||
*** 2392,2398 ****
|
||||
/* Operands */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
break;
|
||||
}
|
||||
s = new_state(*p, NULL, NULL);
|
||||
--- 2392,2398 ----
|
||||
/* Operands */
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
break;
|
||||
}
|
||||
s = new_state(*p, NULL, NULL);
|
||||
***************
|
||||
*** 2407,2413 ****
|
||||
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate ++;
|
||||
return NULL; /* Return value when counting size is ignored anyway */
|
||||
}
|
||||
|
||||
--- 2407,2413 ----
|
||||
|
||||
if (nfa_calc_size == TRUE)
|
||||
{
|
||||
! nstate++;
|
||||
return NULL; /* Return value when counting size is ignored anyway */
|
||||
}
|
||||
|
||||
***************
|
||||
*** 2583,2589 ****
|
||||
save.startpos[subidx] = m->startpos[subidx];
|
||||
save.endpos[subidx] = m->endpos[subidx];
|
||||
m->startpos[subidx].lnum = reglnum;
|
||||
! m->startpos[subidx].col = reginput - regline + off;
|
||||
}
|
||||
else
|
||||
{
|
||||
--- 2583,2589 ----
|
||||
save.startpos[subidx] = m->startpos[subidx];
|
||||
save.endpos[subidx] = m->endpos[subidx];
|
||||
m->startpos[subidx].lnum = reglnum;
|
||||
! m->startpos[subidx].col = (colnr_T)(reginput - regline + off);
|
||||
}
|
||||
else
|
||||
{
|
||||
***************
|
||||
*** 2631,2637 ****
|
||||
save.startpos[subidx] = m->startpos[subidx];
|
||||
save.endpos[subidx] = m->endpos[subidx];
|
||||
m->endpos[subidx].lnum = reglnum;
|
||||
! m->endpos[subidx].col = reginput - regline + off;
|
||||
}
|
||||
else
|
||||
{
|
||||
--- 2631,2637 ----
|
||||
save.startpos[subidx] = m->startpos[subidx];
|
||||
save.endpos[subidx] = m->endpos[subidx];
|
||||
m->endpos[subidx].lnum = reglnum;
|
||||
! m->endpos[subidx].col = (colnr_T)(reginput - regline + off);
|
||||
}
|
||||
else
|
||||
{
|
||||
***************
|
||||
*** 3620,3626 ****
|
||||
int re_flags;
|
||||
{
|
||||
nfa_regprog_T *prog;
|
||||
! int prog_size;
|
||||
int *postfix;
|
||||
|
||||
if (expr == NULL)
|
||||
--- 3620,3626 ----
|
||||
int re_flags;
|
||||
{
|
||||
nfa_regprog_T *prog;
|
||||
! size_t prog_size;
|
||||
int *postfix;
|
||||
|
||||
if (expr == NULL)
|
||||
*** ../vim-7.3.976/src/version.c 2013-05-20 13:55:17.000000000 +0200
|
||||
--- src/version.c 2013-05-20 21:24:28.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 977,
|
||||
/**/
|
||||
|
||||
--
|
||||
A law to reduce crime states: "It is mandatory for a motorist with criminal
|
||||
intentions to stop at the city limits and telephone the chief of police as he
|
||||
is entering the town.
|
||||
[real standing law in Washington, United States of America]
|
||||
|
||||
/// 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 ///
|
180
7.3.978
Normal file
180
7.3.978
Normal file
@ -0,0 +1,180 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.978
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.978
|
||||
Problem: Regexp debug logs don't have a good name.
|
||||
Solution: Use clear names and make it possible to write logs for the old and
|
||||
new engines separately. (Taro Muraoka)
|
||||
Files: src/regexp.c, src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.977/src/regexp.c 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/regexp.c 2013-05-20 21:41:19.000000000 +0200
|
||||
***************
|
||||
*** 51,56 ****
|
||||
--- 51,58 ----
|
||||
# define BT_REGEXP_DUMP
|
||||
/* save the debugging data to a file instead of displaying it */
|
||||
# define BT_REGEXP_LOG
|
||||
+ # define BT_REGEXP_DEBUG_LOG
|
||||
+ # define BT_REGEXP_DEBUG_LOG_NAME "bt_regexp_debug.log"
|
||||
#endif
|
||||
|
||||
/*
|
||||
***************
|
||||
*** 7828,7838 ****
|
||||
|
||||
if (prog == NULL) /* error compiling regexp with initial engine */
|
||||
{
|
||||
! #ifdef DEBUG
|
||||
if (regexp_engine != BACKTRACKING_ENGINE) /* debugging log for NFA */
|
||||
{
|
||||
FILE *f;
|
||||
! f = fopen("debug.log", "a");
|
||||
if (f)
|
||||
{
|
||||
if (!syntax_error)
|
||||
--- 7830,7840 ----
|
||||
|
||||
if (prog == NULL) /* error compiling regexp with initial engine */
|
||||
{
|
||||
! #ifdef BT_REGEXP_DEBUG_LOG
|
||||
if (regexp_engine != BACKTRACKING_ENGINE) /* debugging log for NFA */
|
||||
{
|
||||
FILE *f;
|
||||
! f = fopen(BT_REGEXP_DEBUG_LOG_NAME, "a");
|
||||
if (f)
|
||||
{
|
||||
if (!syntax_error)
|
||||
***************
|
||||
*** 7842,7848 ****
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
! EMSG("(NFA) Could not open \"debug.log\" to write !!!");
|
||||
/*
|
||||
if (syntax_error)
|
||||
EMSG("NFA Regexp: Syntax Error !");
|
||||
--- 7844,7851 ----
|
||||
fclose(f);
|
||||
}
|
||||
else
|
||||
! EMSG2("(NFA) Could not open \"%s\" to write !!!",
|
||||
! BT_REGEXP_DEBUG_LOG_NAME);
|
||||
/*
|
||||
if (syntax_error)
|
||||
EMSG("NFA Regexp: Syntax Error !");
|
||||
*** ../vim-7.3.977/src/regexp_nfa.c 2013-05-20 21:26:26.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-20 21:41:19.000000000 +0200
|
||||
***************
|
||||
*** 9,14 ****
|
||||
--- 9,16 ----
|
||||
/* Comment this out to disable log files. They can get pretty big */
|
||||
# define ENABLE_LOG
|
||||
# define LOG_NAME "log_nfarun.log"
|
||||
+ # define NFA_REGEXP_DEBUG_LOG
|
||||
+ # define NFA_REGEXP_DEBUG_LOG_NAME "nfa_regexp_debug.log"
|
||||
#endif
|
||||
|
||||
/* Upper limit allowed for {m,n} repetitions handled by NFA */
|
||||
***************
|
||||
*** 2849,2860 ****
|
||||
int *listids = NULL;
|
||||
int j = 0;
|
||||
int len = 0;
|
||||
! #ifdef DEBUG
|
||||
! FILE *debug = fopen("list.log", "a");
|
||||
|
||||
if (debug == NULL)
|
||||
{
|
||||
! EMSG(_("(NFA) COULD NOT OPEN list.log !"));
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
--- 2851,2862 ----
|
||||
int *listids = NULL;
|
||||
int j = 0;
|
||||
int len = 0;
|
||||
! #ifdef NFA_REGEXP_DEBUG_LOG
|
||||
! FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG_NAME, "a");
|
||||
|
||||
if (debug == NULL)
|
||||
{
|
||||
! EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG_NAME);
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
***************
|
||||
*** 2950,2956 ****
|
||||
fprintf(log_fd, "\n");
|
||||
#endif
|
||||
|
||||
! #ifdef DEBUG
|
||||
fprintf(debug, "\n-------------------\n");
|
||||
#endif
|
||||
|
||||
--- 2952,2958 ----
|
||||
fprintf(log_fd, "\n");
|
||||
#endif
|
||||
|
||||
! #ifdef NFA_REGEXP_DEBUG_LOG
|
||||
fprintf(debug, "\n-------------------\n");
|
||||
#endif
|
||||
|
||||
***************
|
||||
*** 2966,2972 ****
|
||||
else
|
||||
t = &thislist->t[i];
|
||||
|
||||
! #ifdef DEBUG
|
||||
nfa_set_code(t->state->c);
|
||||
fprintf(debug, "%s, ", code);
|
||||
#endif
|
||||
--- 2968,2974 ----
|
||||
else
|
||||
t = &thislist->t[i];
|
||||
|
||||
! #ifdef NFA_REGEXP_DEBUG_LOG
|
||||
nfa_set_code(t->state->c);
|
||||
fprintf(debug, "%s, ", code);
|
||||
#endif
|
||||
***************
|
||||
*** 3436,3442 ****
|
||||
if (listids != NULL)
|
||||
vim_free(listids);
|
||||
#undef ADD_POS_NEG_STATE
|
||||
! #ifdef DEBUG
|
||||
fclose(debug);
|
||||
#endif
|
||||
|
||||
--- 3438,3444 ----
|
||||
if (listids != NULL)
|
||||
vim_free(listids);
|
||||
#undef ADD_POS_NEG_STATE
|
||||
! #ifdef NFA_REGEXP_DEBUG_LOG
|
||||
fclose(debug);
|
||||
#endif
|
||||
|
||||
*** ../vim-7.3.977/src/version.c 2013-05-20 21:26:26.000000000 +0200
|
||||
--- src/version.c 2013-05-20 21:48:27.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 978,
|
||||
/**/
|
||||
|
||||
--
|
||||
SIGIRO -- irony detected (iron 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 ///
|
69
7.3.979
Normal file
69
7.3.979
Normal file
@ -0,0 +1,69 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.979
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.979
|
||||
Problem: Complex NFA regexp doesn't work.
|
||||
Solution: Set actual state stack end instead of using an arbitrary number.
|
||||
(Yasuhiro Matsumoto)
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.978/src/regexp_nfa.c 2013-05-20 21:49:08.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-20 21:53:24.000000000 +0200
|
||||
***************
|
||||
*** 17,24 ****
|
||||
#define NFA_BRACES_MAXLIMIT 10
|
||||
/* For allocating space for the postfix representation */
|
||||
#define NFA_POSTFIX_MULTIPLIER (NFA_BRACES_MAXLIMIT + 2)*2
|
||||
- /* Size of stack, used when converting the postfix regexp into NFA */
|
||||
- #define NFA_STACK_SIZE 1024
|
||||
|
||||
enum
|
||||
{
|
||||
--- 17,22 ----
|
||||
***************
|
||||
*** 2160,2168 ****
|
||||
if (nfa_calc_size == FALSE)
|
||||
{
|
||||
/* Allocate space for the stack. Max states on the stack : nstate */
|
||||
! stack = (Frag_T *) lalloc((nstate + 1)*sizeof(Frag_T), TRUE);
|
||||
stackp = stack;
|
||||
! stack_end = stack + NFA_STACK_SIZE;
|
||||
}
|
||||
|
||||
for (p = postfix; p < end; ++p)
|
||||
--- 2158,2166 ----
|
||||
if (nfa_calc_size == FALSE)
|
||||
{
|
||||
/* Allocate space for the stack. Max states on the stack : nstate */
|
||||
! stack = (Frag_T *) lalloc((nstate + 1) * sizeof(Frag_T), TRUE);
|
||||
stackp = stack;
|
||||
! stack_end = stack + (nstate + 1);
|
||||
}
|
||||
|
||||
for (p = postfix; p < end; ++p)
|
||||
*** ../vim-7.3.978/src/version.c 2013-05-20 21:49:08.000000000 +0200
|
||||
--- src/version.c 2013-05-20 21:55:37.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 979,
|
||||
/**/
|
||||
|
||||
--
|
||||
Another bucket of what can only be described as human ordure hits ARTHUR.
|
||||
ARTHUR: ... Right! (to the KNIGHTS) That settles it!
|
||||
"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 ///
|
141
7.3.980
Normal file
141
7.3.980
Normal file
@ -0,0 +1,141 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.980
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.980
|
||||
Problem: Regexp logs may contain garbage. Character classes don't work
|
||||
correctly for multi-byte characters.
|
||||
Solution: Check for end of post list. Only use "is" functions for
|
||||
characters up to 255. (Ken Takata)
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.979/src/regexp_nfa.c 2013-05-20 21:56:53.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-20 22:09:01.000000000 +0200
|
||||
***************
|
||||
*** 1826,1838 ****
|
||||
else if (retval == OK)
|
||||
fprintf(f, ">>> NFA engine succeeded !\n");
|
||||
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
|
||||
! for (p=post_start; *p; p++)
|
||||
{
|
||||
nfa_set_code(*p);
|
||||
fprintf(f, "%s, ", code);
|
||||
}
|
||||
fprintf(f, "\"\nPostfix notation (int): ");
|
||||
! for (p=post_start; *p; p++)
|
||||
fprintf(f, "%d ", *p);
|
||||
fprintf(f, "\n\n");
|
||||
fclose(f);
|
||||
--- 1826,1838 ----
|
||||
else if (retval == OK)
|
||||
fprintf(f, ">>> NFA engine succeeded !\n");
|
||||
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
|
||||
! for (p = post_start; *p && p < post_end; p++)
|
||||
{
|
||||
nfa_set_code(*p);
|
||||
fprintf(f, "%s, ", code);
|
||||
}
|
||||
fprintf(f, "\"\nPostfix notation (int): ");
|
||||
! for (p = post_start; *p && p < post_end; p++)
|
||||
fprintf(f, "%d ", *p);
|
||||
fprintf(f, "\n\n");
|
||||
fclose(f);
|
||||
***************
|
||||
*** 2667,2677 ****
|
||||
switch (class)
|
||||
{
|
||||
case NFA_CLASS_ALNUM:
|
||||
! if (isalnum(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_ALPHA:
|
||||
! if (isalpha(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_BLANK:
|
||||
--- 2667,2677 ----
|
||||
switch (class)
|
||||
{
|
||||
case NFA_CLASS_ALNUM:
|
||||
! if (c >= 1 && c <= 255 && isalnum(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_ALPHA:
|
||||
! if (c >= 1 && c <= 255 && isalpha(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_BLANK:
|
||||
***************
|
||||
*** 2679,2685 ****
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_CNTRL:
|
||||
! if (iscntrl(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_DIGIT:
|
||||
--- 2679,2685 ----
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_CNTRL:
|
||||
! if (c >= 1 && c <= 255 && iscntrl(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_DIGIT:
|
||||
***************
|
||||
*** 2687,2693 ****
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_GRAPH:
|
||||
! if (isgraph(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_LOWER:
|
||||
--- 2687,2693 ----
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_GRAPH:
|
||||
! if (c >= 1 && c <= 255 && isgraph(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_LOWER:
|
||||
***************
|
||||
*** 2699,2705 ****
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_PUNCT:
|
||||
! if (ispunct(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_SPACE:
|
||||
--- 2699,2705 ----
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_PUNCT:
|
||||
! if (c >= 1 && c <= 255 && ispunct(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_SPACE:
|
||||
*** ../vim-7.3.979/src/version.c 2013-05-20 21:56:53.000000000 +0200
|
||||
--- src/version.c 2013-05-20 22:10:54.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 980,
|
||||
/**/
|
||||
|
||||
--
|
||||
Why is "abbreviation" such a long word?
|
||||
|
||||
/// 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 ///
|
101
7.3.981
Normal file
101
7.3.981
Normal file
@ -0,0 +1,101 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.981
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.981
|
||||
Problem: In the old regexp engine \i, \I, \f and \F don't work on
|
||||
multi-byte characters.
|
||||
Solution: Dereference pointer properly.
|
||||
Files: src/regexp.c, src/testdir/test64.in, src/testdir/test64.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.980/src/regexp.c 2013-05-20 21:49:08.000000000 +0200
|
||||
--- src/regexp.c 2013-05-20 23:58:32.000000000 +0200
|
||||
***************
|
||||
*** 5758,5764 ****
|
||||
case SIDENT + ADD_NL:
|
||||
while (count < maxcount)
|
||||
{
|
||||
! if (vim_isIDc(*scan) && (testval || !VIM_ISDIGIT(*scan)))
|
||||
{
|
||||
mb_ptr_adv(scan);
|
||||
}
|
||||
--- 5758,5764 ----
|
||||
case SIDENT + ADD_NL:
|
||||
while (count < maxcount)
|
||||
{
|
||||
! if (vim_isIDc(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
|
||||
{
|
||||
mb_ptr_adv(scan);
|
||||
}
|
||||
***************
|
||||
*** 5819,5825 ****
|
||||
case SFNAME + ADD_NL:
|
||||
while (count < maxcount)
|
||||
{
|
||||
! if (vim_isfilec(*scan) && (testval || !VIM_ISDIGIT(*scan)))
|
||||
{
|
||||
mb_ptr_adv(scan);
|
||||
}
|
||||
--- 5819,5825 ----
|
||||
case SFNAME + ADD_NL:
|
||||
while (count < maxcount)
|
||||
{
|
||||
! if (vim_isfilec(PTR2CHAR(scan)) && (testval || !VIM_ISDIGIT(*scan)))
|
||||
{
|
||||
mb_ptr_adv(scan);
|
||||
}
|
||||
*** ../vim-7.3.980/src/testdir/test64.in 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/testdir/test64.in 2013-05-20 23:58:09.000000000 +0200
|
||||
***************
|
||||
*** 262,267 ****
|
||||
--- 262,271 ----
|
||||
:call add(tl, ['[a-zA-Z]', 'a', 'a'])
|
||||
:call add(tl, ['[A-Z]', 'a'])
|
||||
:call add(tl, ['\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
|
||||
+ :call add(tl, ['\i\+', '&*§xx ', 'xx'])
|
||||
+ :call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx'])
|
||||
+ :call add(tl, ['\f\+', '&*fname ', 'fname'])
|
||||
+ :call add(tl, ['\%#=1\i\+', '&*fname ', 'fname'])
|
||||
|
||||
:"""" Tests for \z features
|
||||
:call add(tl, ['xx \ze test', 'xx ']) " must match after \ze
|
||||
*** ../vim-7.3.980/src/testdir/test64.ok 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/testdir/test64.ok 2013-05-21 00:00:08.000000000 +0200
|
||||
***************
|
||||
*** 203,208 ****
|
||||
--- 203,212 ----
|
||||
OK - [a-zA-Z]
|
||||
OK - [A-Z]
|
||||
OK - \C[^A-Z]\+
|
||||
+ OK - \i\+
|
||||
+ OK - \%#=1\i\+
|
||||
+ OK - \f\+
|
||||
+ OK - \%#=1\i\+
|
||||
OK - xx \ze test
|
||||
OK - abc\zeend
|
||||
OK - abc\zsdd
|
||||
*** ../vim-7.3.980/src/version.c 2013-05-20 22:19:58.000000000 +0200
|
||||
--- src/version.c 2013-05-21 00:01:30.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 981,
|
||||
/**/
|
||||
|
||||
--
|
||||
[The rest of the ARMY stand around looking at a loss.]
|
||||
INSPECTOR END OF FILM: (picks up megaphone) All right! Clear off! Go on!
|
||||
"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 ///
|
97
7.3.982
Normal file
97
7.3.982
Normal file
@ -0,0 +1,97 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.982
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.982
|
||||
Problem: In the new regexp engine \p does not work on multi-byte
|
||||
characters.
|
||||
Solution: Don't point to an integer but the characters.
|
||||
Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.981/src/regexp_nfa.c 2013-05-20 22:19:58.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-21 12:34:02.000000000 +0200
|
||||
***************
|
||||
*** 2931,2937 ****
|
||||
}
|
||||
if (c == NUL)
|
||||
n = 0;
|
||||
! cc = (char_u *)&c;
|
||||
|
||||
/* swap lists */
|
||||
thislist = &list[flag];
|
||||
--- 2931,2937 ----
|
||||
}
|
||||
if (c == NUL)
|
||||
n = 0;
|
||||
! cc = reginput;
|
||||
|
||||
/* swap lists */
|
||||
thislist = &list[flag];
|
||||
***************
|
||||
*** 2960,2966 ****
|
||||
if (neglist->n > 0)
|
||||
{
|
||||
t = &neglist->t[0];
|
||||
! neglist->n --;
|
||||
i--;
|
||||
}
|
||||
else
|
||||
--- 2960,2966 ----
|
||||
if (neglist->n > 0)
|
||||
{
|
||||
t = &neglist->t[0];
|
||||
! neglist->n--;
|
||||
i--;
|
||||
}
|
||||
else
|
||||
*** ../vim-7.3.981/src/testdir/test95.in 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/testdir/test95.in 2013-05-21 12:24:56.000000000 +0200
|
||||
***************
|
||||
*** 25,30 ****
|
||||
--- 25,33 ----
|
||||
:call add(tl, [' [^ ]\+', 'start มabcdม ', ' มabcdม'])
|
||||
:call add(tl, ['[ม[:alpha:][=a=]]\+', '879 aiaãมâมaiuvna ', 'aiaãมâมaiuvna'])
|
||||
|
||||
+ :" this is not a normal "i" but 0xec
|
||||
+ :call add(tl, ['\p\+', 'ìa', 'ìa'])
|
||||
+
|
||||
:"""" Run the tests
|
||||
|
||||
:"
|
||||
*** ../vim-7.3.981/src/testdir/test95.ok 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/testdir/test95.ok 2013-05-21 12:31:00.000000000 +0200
|
||||
***************
|
||||
*** 4,6 ****
|
||||
--- 4,7 ----
|
||||
OK - [^ม ]\+
|
||||
OK - [^ ]\+
|
||||
OK - [ม[:alpha:][=a=]]\+
|
||||
+ OK - \p\+
|
||||
*** ../vim-7.3.981/src/version.c 2013-05-21 00:02:54.000000000 +0200
|
||||
--- src/version.c 2013-05-21 12:32:41.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 982,
|
||||
/**/
|
||||
|
||||
--
|
||||
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
|
||||
KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
|
||||
HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
|
||||
LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
|
||||
BROTHER MAYNARD
|
||||
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
|
||||
|
||||
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
||||
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
||||
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
||||
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
109
7.3.983
Normal file
109
7.3.983
Normal file
@ -0,0 +1,109 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.983
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.983
|
||||
Problem: Uneccessary temp variable.
|
||||
Solution: Remove the variable.
|
||||
Files: src/regexp_nfa.c
|
||||
|
||||
|
||||
*** ../vim-7.3.982/src/regexp_nfa.c 2013-05-21 12:34:13.000000000 +0200
|
||||
--- src/regexp_nfa.c 2013-05-21 12:35:37.000000000 +0200
|
||||
***************
|
||||
*** 2833,2839 ****
|
||||
int old_reglnum = -1;
|
||||
int reginput_updated = FALSE;
|
||||
thread_T *t;
|
||||
- char_u *cc;
|
||||
char_u *old_reginput = NULL;
|
||||
char_u *old_regline = NULL;
|
||||
nfa_state_T *sta;
|
||||
--- 2833,2838 ----
|
||||
***************
|
||||
*** 2931,2937 ****
|
||||
}
|
||||
if (c == NUL)
|
||||
n = 0;
|
||||
- cc = reginput;
|
||||
|
||||
/* swap lists */
|
||||
thislist = &list[flag];
|
||||
--- 2930,2935 ----
|
||||
***************
|
||||
*** 3261,3272 ****
|
||||
break;
|
||||
|
||||
case NFA_KWORD: /* \k */
|
||||
! result = vim_iswordp(cc);
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
case NFA_SKWORD: /* \K */
|
||||
! result = !VIM_ISDIGIT(c) && vim_iswordp(cc);
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
--- 3259,3270 ----
|
||||
break;
|
||||
|
||||
case NFA_KWORD: /* \k */
|
||||
! result = vim_iswordp(reginput);
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
case NFA_SKWORD: /* \K */
|
||||
! result = !VIM_ISDIGIT(c) && vim_iswordp(reginput);
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
***************
|
||||
*** 3281,3292 ****
|
||||
break;
|
||||
|
||||
case NFA_PRINT: /* \p */
|
||||
! result = ptr2cells(cc) == 1;
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
case NFA_SPRINT: /* \P */
|
||||
! result = !VIM_ISDIGIT(c) && ptr2cells(cc) == 1;
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
--- 3279,3290 ----
|
||||
break;
|
||||
|
||||
case NFA_PRINT: /* \p */
|
||||
! result = ptr2cells(reginput) == 1;
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
case NFA_SPRINT: /* \P */
|
||||
! result = !VIM_ISDIGIT(c) && ptr2cells(reginput) == 1;
|
||||
ADD_POS_NEG_STATE(t->state);
|
||||
break;
|
||||
|
||||
*** ../vim-7.3.982/src/version.c 2013-05-21 12:34:13.000000000 +0200
|
||||
--- src/version.c 2013-05-21 12:41:58.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 983,
|
||||
/**/
|
||||
|
||||
--
|
||||
Communication is one of the most compli..., eh, well, it's hard.
|
||||
You know what I mean. Not?
|
||||
|
||||
/// 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 ///
|
49
7.3.984
Normal file
49
7.3.984
Normal file
@ -0,0 +1,49 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.984
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.984
|
||||
Problem: A Visual mapping that uses CTRL-G works differently when started
|
||||
from Insert mode. (Ein Brown)
|
||||
Solution: Reset old_mapped_len when handling typed text in Select mode.
|
||||
Files: src/normal.c
|
||||
|
||||
|
||||
*** ../vim-7.3.983/src/normal.c 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/normal.c 2013-05-20 21:11:55.000000000 +0200
|
||||
***************
|
||||
*** 701,706 ****
|
||||
--- 701,707 ----
|
||||
else
|
||||
c = 'c';
|
||||
msg_nowait = TRUE; /* don't delay going to insert mode */
|
||||
+ old_mapped_len = 0; /* do go to Insert mode */
|
||||
}
|
||||
#endif
|
||||
|
||||
*** ../vim-7.3.983/src/version.c 2013-05-21 12:43:52.000000000 +0200
|
||||
--- src/version.c 2013-05-21 12:45:02.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 984,
|
||||
/**/
|
||||
|
||||
--
|
||||
MICHAEL PALIN PLAYED: 1ST SOLDIER WITH A KEEN INTEREST IN BIRDS, DENNIS, MR
|
||||
DUCK (A VILLAGE CARPENTER WHO IS ALMOST KEENER THAN
|
||||
ANYONE ELSE TO BURN WITCHES), THREE-HEADED KNIGHT, SIR
|
||||
GALAHAD, KING OF SWAMP CASTLE, BROTHER MAYNARD'S ROOMATE
|
||||
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
|
||||
|
||||
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
||||
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
||||
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
||||
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
51
7.3.985
Normal file
51
7.3.985
Normal file
@ -0,0 +1,51 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.985
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.985
|
||||
Problem: GTK vim not started as gvim doesn't set WM_CLASS property to a
|
||||
useful value.
|
||||
Solution: Call g_set_prgname() on startup. (James McCoy)
|
||||
Files: src/gui_gtk_x11.c
|
||||
|
||||
|
||||
*** ../vim-7.3.984/src/gui_gtk_x11.c 2013-05-06 04:21:35.000000000 +0200
|
||||
--- src/gui_gtk_x11.c 2013-05-21 12:48:16.000000000 +0200
|
||||
***************
|
||||
*** 1447,1452 ****
|
||||
--- 1447,1457 ----
|
||||
using_gnome = 1;
|
||||
#endif
|
||||
|
||||
+ /* This defaults to argv[0], but we want it to match the name of the
|
||||
+ * shipped gvim.desktop so that Vim's windows can be associated with this
|
||||
+ * file. */
|
||||
+ g_set_prgname("gvim");
|
||||
+
|
||||
/* Don't use gtk_init() or gnome_init(), it exits on failure. */
|
||||
if (!gtk_init_check(&gui_argc, &gui_argv))
|
||||
{
|
||||
*** ../vim-7.3.984/src/version.c 2013-05-21 12:45:54.000000000 +0200
|
||||
--- src/version.c 2013-05-21 12:50:04.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 985,
|
||||
/**/
|
||||
|
||||
--
|
||||
A disclaimer for the disclaimer:
|
||||
"and before I get a huge amount of complaints , I have no control over the
|
||||
disclaimer at the end of this mail :-)" (Timothy Aldrich)
|
||||
|
||||
/// 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 ///
|
61
7.3.986
Normal file
61
7.3.986
Normal file
@ -0,0 +1,61 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.986
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.986
|
||||
Problem: Test 95 doesn't pass when 'encoding' isn't utf-8. (Yasuhiro
|
||||
Matsumoto)
|
||||
Solution: Force 'encoding' to be utf-8.
|
||||
Files: src/testdir/test95.in
|
||||
|
||||
|
||||
*** ../vim-7.3.985/src/testdir/test95.in 2013-05-21 12:34:13.000000000 +0200
|
||||
--- src/testdir/test95.in 2013-05-21 12:58:09.000000000 +0200
|
||||
***************
|
||||
*** 1,4 ****
|
||||
! Test for regexp patterns with multi-byte support.
|
||||
See test64 for the non-multi-byte tests.
|
||||
|
||||
A pattern that gives the expected result produces OK, so that we know it was
|
||||
--- 1,4 ----
|
||||
! Test for regexp patterns with multi-byte support, using utf-8.
|
||||
See test64 for the non-multi-byte tests.
|
||||
|
||||
A pattern that gives the expected result produces OK, so that we know it was
|
||||
***************
|
||||
*** 7,12 ****
|
||||
--- 7,13 ----
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:so mbyte.vim
|
||||
+ :set encoding=utf-8 viminfo+=nviminfo
|
||||
:" tl is a List of Lists with:
|
||||
:" regexp pattern
|
||||
:" text to test the pattern on
|
||||
*** ../vim-7.3.985/src/version.c 2013-05-21 12:52:00.000000000 +0200
|
||||
--- src/version.c 2013-05-21 12:59:32.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 986,
|
||||
/**/
|
||||
|
||||
--
|
||||
(letter from Mark to Mike, about the film's probable certificate)
|
||||
For an 'A' we would have to: Lose as many shits as possible; Take Jesus
|
||||
Christ out, if possible; Loose "I fart in your general direction"; Lose
|
||||
"the oral sex"; Lose "oh, fuck off"; Lose "We make castanets out of your
|
||||
testicles"
|
||||
"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 ///
|
201
7.3.987
Normal file
201
7.3.987
Normal file
@ -0,0 +1,201 @@
|
||||
To: vim_dev@googlegroups.com
|
||||
Subject: Patch 7.3.987
|
||||
Fcc: outbox
|
||||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||||
Mime-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
------------
|
||||
|
||||
Patch 7.3.987
|
||||
Problem: No easy to run an individual test. Tests 64 fails when
|
||||
'encoding' is not utf-8.
|
||||
Solution: Add individual test targets to the Makefile. Move some lines from
|
||||
test 64 to 95.
|
||||
Files: src/Makefile, src/testdir/test64.in, src/testdir/test64.ok,
|
||||
src/testdir/test95.in, src/testdir/test95.ok
|
||||
|
||||
|
||||
*** ../vim-7.3.986/src/Makefile 2013-05-19 19:16:25.000000000 +0200
|
||||
--- src/Makefile 2013-05-21 13:18:04.000000000 +0200
|
||||
***************
|
||||
*** 1861,1866 ****
|
||||
--- 1861,1879 ----
|
||||
./$$t || exit 1; echo $$t passed; \
|
||||
done
|
||||
|
||||
+ # Run individual test, assuming that Vim was already compiled.
|
||||
+ test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 \
|
||||
+ test11 test12 test13 test14 test15 test16 test17 test18 test19 \
|
||||
+ test21 test22 test23 test24 test25 test26 test27 test28 test29 \
|
||||
+ test31 test32 test33 test34 test35 test36 test37 test38 test39 \
|
||||
+ test41 test42 test43 test44 test45 test46 test47 test48 test49 \
|
||||
+ test51 test52 test53 test54 test55 test56 test57 test58 test59 \
|
||||
+ test61 test62 test63 test64 test65 test66 test67 test68 test69 \
|
||||
+ test71 test72 test73 test74 test75 test76 test77 test78 test79 \
|
||||
+ test81 test82 test83 test84 test85 test86 test87 test88 test89 \
|
||||
+ test91 test92 test93 test94 test95 test96 test97 test98 test99:
|
||||
+ cd testdir; rm $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET)
|
||||
+
|
||||
testclean:
|
||||
cd testdir; $(MAKE) -f Makefile clean
|
||||
if test -d $(PODIR); then \
|
||||
*** ../vim-7.3.986/src/testdir/test64.in 2013-05-21 00:02:54.000000000 +0200
|
||||
--- src/testdir/test64.in 2013-05-21 13:23:27.000000000 +0200
|
||||
***************
|
||||
*** 262,271 ****
|
||||
:call add(tl, ['[a-zA-Z]', 'a', 'a'])
|
||||
:call add(tl, ['[A-Z]', 'a'])
|
||||
:call add(tl, ['\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
|
||||
- :call add(tl, ['\i\+', '&*§xx ', 'xx'])
|
||||
- :call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx'])
|
||||
- :call add(tl, ['\f\+', '&*fname ', 'fname'])
|
||||
- :call add(tl, ['\%#=1\i\+', '&*fname ', 'fname'])
|
||||
|
||||
:"""" Tests for \z features
|
||||
:call add(tl, ['xx \ze test', 'xx ']) " must match after \ze
|
||||
--- 262,267 ----
|
||||
***************
|
||||
*** 290,302 ****
|
||||
|
||||
:"""" Combining different tests and features
|
||||
:call add(tl, ['[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
|
||||
- :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd'])
|
||||
:call add(tl, ['', 'abcd', ''])
|
||||
:call add(tl, ['\v(())', 'any possible text', ''])
|
||||
:call add(tl, ['\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
|
||||
:call add(tl, ['\v(test|)empty', 'tesempty', 'empty', ''])
|
||||
:call add(tl, ['\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a'])
|
||||
|
||||
|
||||
:"""" Run the tests
|
||||
|
||||
--- 286,303 ----
|
||||
|
||||
:"""" Combining different tests and features
|
||||
:call add(tl, ['[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
|
||||
:call add(tl, ['', 'abcd', ''])
|
||||
:call add(tl, ['\v(())', 'any possible text', ''])
|
||||
:call add(tl, ['\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
|
||||
:call add(tl, ['\v(test|)empty', 'tesempty', 'empty', ''])
|
||||
:call add(tl, ['\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a'])
|
||||
|
||||
+ :"""" \%u and friends
|
||||
+ :call add(tl, ['\%d32', 'yes no', ' '])
|
||||
+ :call add(tl, ['\%o40', 'yes no', ' '])
|
||||
+ :call add(tl, ['\%x20', 'yes no', ' '])
|
||||
+ :call add(tl, ['\%u0020', 'yes no', ' '])
|
||||
+ :call add(tl, ['\%U00000020', 'yes no', ' '])
|
||||
|
||||
:"""" Run the tests
|
||||
|
||||
*** ../vim-7.3.986/src/testdir/test64.ok 2013-05-21 00:02:54.000000000 +0200
|
||||
--- src/testdir/test64.ok 2013-05-21 13:23:37.000000000 +0200
|
||||
***************
|
||||
*** 203,212 ****
|
||||
OK - [a-zA-Z]
|
||||
OK - [A-Z]
|
||||
OK - \C[^A-Z]\+
|
||||
- OK - \i\+
|
||||
- OK - \%#=1\i\+
|
||||
- OK - \f\+
|
||||
- OK - \%#=1\i\+
|
||||
OK - xx \ze test
|
||||
OK - abc\zeend
|
||||
OK - abc\zsdd
|
||||
--- 203,208 ----
|
||||
***************
|
||||
*** 225,234 ****
|
||||
OK - .*John\&.*Bob
|
||||
OK - \v(test1)@=.*yep
|
||||
OK - [[:alpha:]]\{-2,6}
|
||||
- OK - [^[=a=]]\+
|
||||
OK -
|
||||
OK - \v(())
|
||||
OK - \v%(ab(xyz)c)
|
||||
OK - \v(test|)empty
|
||||
OK - \v(a|aa)(a|aa)
|
||||
192.168.0.1
|
||||
--- 221,234 ----
|
||||
OK - .*John\&.*Bob
|
||||
OK - \v(test1)@=.*yep
|
||||
OK - [[:alpha:]]\{-2,6}
|
||||
OK -
|
||||
OK - \v(())
|
||||
OK - \v%(ab(xyz)c)
|
||||
OK - \v(test|)empty
|
||||
OK - \v(a|aa)(a|aa)
|
||||
+ OK - \%d32
|
||||
+ OK - \%o40
|
||||
+ OK - \%x20
|
||||
+ OK - \%u0020
|
||||
+ OK - \%U00000020
|
||||
192.168.0.1
|
||||
*** ../vim-7.3.986/src/testdir/test95.in 2013-05-21 13:05:05.000000000 +0200
|
||||
--- src/testdir/test95.in 2013-05-21 13:24:19.000000000 +0200
|
||||
***************
|
||||
*** 7,13 ****
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:so mbyte.vim
|
||||
! :set encoding=utf-8 viminfo+=nviminfo
|
||||
:" tl is a List of Lists with:
|
||||
:" regexp pattern
|
||||
:" text to test the pattern on
|
||||
--- 7,13 ----
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:so mbyte.vim
|
||||
! :set nocp encoding=utf-8 viminfo+=nviminfo
|
||||
:" tl is a List of Lists with:
|
||||
:" regexp pattern
|
||||
:" text to test the pattern on
|
||||
***************
|
||||
*** 29,34 ****
|
||||
--- 29,43 ----
|
||||
:" this is not a normal "i" but 0xec
|
||||
:call add(tl, ['\p\+', 'ìa', 'ìa'])
|
||||
|
||||
+ :"""" Test recognition of some character classes
|
||||
+ :call add(tl, ['\i\+', '&*§xx ', 'xx'])
|
||||
+ :call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx'])
|
||||
+ :call add(tl, ['\f\+', '&*fname ', 'fname'])
|
||||
+ :call add(tl, ['\%#=1\i\+', '&*fname ', 'fname'])
|
||||
+
|
||||
+ :"""" Combining different tests and features
|
||||
+ :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd'])
|
||||
+
|
||||
:"""" Run the tests
|
||||
|
||||
:"
|
||||
*** ../vim-7.3.986/src/testdir/test95.ok 2013-05-21 12:34:13.000000000 +0200
|
||||
--- src/testdir/test95.ok 2013-05-21 13:24:23.000000000 +0200
|
||||
***************
|
||||
*** 5,7 ****
|
||||
--- 5,12 ----
|
||||
OK - [^ ]\+
|
||||
OK - [ม[:alpha:][=a=]]\+
|
||||
OK - \p\+
|
||||
+ OK - \i\+
|
||||
+ OK - \%#=1\i\+
|
||||
+ OK - \f\+
|
||||
+ OK - \%#=1\i\+
|
||||
+ OK - [^[=a=]]\+
|
||||
*** ../vim-7.3.986/src/version.c 2013-05-21 13:05:05.000000000 +0200
|
||||
--- src/version.c 2013-05-21 13:27:12.000000000 +0200
|
||||
***************
|
||||
*** 730,731 ****
|
||||
--- 730,733 ----
|
||||
{ /* Add new patch number below this line */
|
||||
+ /**/
|
||||
+ 987,
|
||||
/**/
|
||||
|
||||
--
|
||||
An SQL statement walks into a bar. He approaches two tables
|
||||
and says, "Mind if I join you?"
|
||||
|
||||
/// 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 ///
|
@ -976,3 +976,46 @@ Individual patches for Vim 7.3:
|
||||
5470 7.3.942 Python: SEGV in Buffer functions
|
||||
6867 7.3.943 Python: Negative indices were failing
|
||||
2283 7.3.944 external program receives the termrespone
|
||||
16738 7.3.945 Python: List of buffers is not very useful
|
||||
3029 7.3.946 sometimes keys starting with <Esc>[ ar not working
|
||||
17613 7.3.947 Python: No iterator for vim.list and vim.bufferlist
|
||||
11841 7.3.948 cannot build with Python 2.2
|
||||
25668 7.3.949 Python: no easy access to tabpages
|
||||
5750 7.3.950 Python: Stack trace printer can't handle messages
|
||||
15906 7.3.951 Python exceptions have problems
|
||||
5245 7.3.952 Python: It's not easy to change window/buffer/tabpage
|
||||
3924 7.3.953 Python: string exceptions are deprecated
|
||||
2374 7.3.954 No check if PyObject_IsTrue fails
|
||||
12291 7.3.955 Python: Not enough tests
|
||||
5261 7.3.956 Python vim.bindeval() causes SIGABRT
|
||||
9959 7.3.957 Python does not have a "do" command like Perl or Lua
|
||||
1772 7.3.958 Python: Iteration destructor not set
|
||||
2058 7.3.959 (after 7.3.957) missing error number
|
||||
1366 7.3.960 compiler warning for unused variable
|
||||
3054 7.3.961 tests 86 and 87 fail when using another language than English
|
||||
8389 7.3.962 Python tests are not portable
|
||||
18867 7.3.963 setting curbuf without curwin causes trouble
|
||||
13179 7.3.964 Python: not so easy to access tab pages
|
||||
8088 7.3.965 Python garbage collection not working properly
|
||||
10038 7.3.966 there is ":py3do" but no ":pydo"
|
||||
3304 7.3.967 (after 7.3.965) build fails on Mac OSX
|
||||
2100 7.3.968 multi-byte support is only available with "big" features
|
||||
1603 7.3.969 can't built with Python 3 and without Python 2
|
||||
184170 7.3.970 pattern matching is slow, include the NFA engine
|
||||
4337 7.3.971 no support for VS2012 static code analysis
|
||||
3720 7.3.972 cursor not restored properly after InsertEnter autocommand
|
||||
3881 7.3.973 (after 7.3.970) compiler warnings, crash on startup
|
||||
4775 7.3.974 can't build with ruby 1.8.5
|
||||
2301 7.3.975 (after 7.3.970) crash in regexp parsing
|
||||
2254 7.3.976 (after 7.3.970) can't build with HP-UX
|
||||
7028 7.3.977 compiler warnings, white space, uncommented for testing
|
||||
4535 7.3.978 regexp debug logs don't have a good name
|
||||
2268 7.3.979 complex NFA regexp doesn't work
|
||||
3597 7.3.980 regexp logs contain garbage; character classes don't work
|
||||
3105 7.3.981 old regexp engine fails on \i, \I, \f and \F with mbyte chars
|
||||
2800 7.3.982 \p does not work on multi-byte chars in new regexp engine
|
||||
2675 7.3.983 uneccessary temp variable
|
||||
1706 7.3.984 Visual mapping using CTRL-G works differently from Insert mode
|
||||
1691 7.3.985 GTK vim not started as gvim has WM_CLASS property wrong
|
||||
2113 7.3.986 test 95 doesn't pass when 'encoding' isn't utf-8
|
||||
6338 7.3.987 no easy to run an individual test; test 64 may fail
|
||||
|
218
vim.spec
218
vim.spec
@ -18,7 +18,7 @@
|
||||
#used for pre-releases:
|
||||
%define beta %{nil}
|
||||
%define vimdir vim73%{?beta}
|
||||
%define patchlevel 944
|
||||
%define patchlevel 987
|
||||
|
||||
Summary: The VIM editor
|
||||
URL: http://www.vim.org/
|
||||
@ -1000,6 +1000,49 @@ Patch941: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.941
|
||||
Patch942: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.942
|
||||
Patch943: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.943
|
||||
Patch944: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.944
|
||||
Patch945: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.945
|
||||
Patch946: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.946
|
||||
Patch947: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.947
|
||||
Patch948: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.948
|
||||
Patch949: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.949
|
||||
Patch950: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.950
|
||||
Patch951: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.951
|
||||
Patch952: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.952
|
||||
Patch953: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.953
|
||||
Patch954: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.954
|
||||
Patch955: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.955
|
||||
Patch956: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.956
|
||||
Patch957: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.957
|
||||
Patch958: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.958
|
||||
Patch959: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.959
|
||||
Patch960: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.960
|
||||
Patch961: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.961
|
||||
Patch962: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.962
|
||||
Patch963: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.963
|
||||
Patch964: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.964
|
||||
Patch965: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.965
|
||||
Patch966: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.966
|
||||
Patch967: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.967
|
||||
Patch968: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.968
|
||||
Patch969: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.969
|
||||
Patch970: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.970
|
||||
Patch971: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.971
|
||||
Patch972: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.972
|
||||
Patch973: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.973
|
||||
Patch974: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.974
|
||||
Patch975: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.975
|
||||
Patch976: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.976
|
||||
Patch977: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.977
|
||||
Patch978: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.978
|
||||
Patch979: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.979
|
||||
Patch980: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.980
|
||||
Patch981: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.981
|
||||
Patch982: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.982
|
||||
Patch983: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.983
|
||||
Patch984: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.984
|
||||
Patch985: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.985
|
||||
Patch986: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.986
|
||||
Patch987: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.987
|
||||
|
||||
Patch3000: vim-7.3-syntax.patch
|
||||
Patch3002: vim-7.1-nowarnings.patch
|
||||
@ -2090,6 +2133,49 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk
|
||||
%patch942 -p0
|
||||
%patch943 -p0
|
||||
%patch944 -p0
|
||||
%patch945 -p0
|
||||
%patch946 -p0
|
||||
%patch947 -p0
|
||||
%patch948 -p0
|
||||
%patch949 -p0
|
||||
%patch950 -p0
|
||||
%patch951 -p0
|
||||
%patch952 -p0
|
||||
%patch953 -p0
|
||||
%patch954 -p0
|
||||
%patch955 -p0
|
||||
%patch956 -p0
|
||||
%patch957 -p0
|
||||
%patch958 -p0
|
||||
%patch959 -p0
|
||||
%patch960 -p0
|
||||
%patch961 -p0
|
||||
%patch962 -p0
|
||||
%patch963 -p0
|
||||
%patch964 -p0
|
||||
%patch965 -p0
|
||||
%patch966 -p0
|
||||
%patch967 -p0
|
||||
%patch968 -p0
|
||||
%patch969 -p0
|
||||
%patch970 -p0
|
||||
%patch971 -p0
|
||||
%patch972 -p0
|
||||
%patch973 -p0
|
||||
%patch974 -p0
|
||||
%patch975 -p0
|
||||
%patch976 -p0
|
||||
%patch977 -p0
|
||||
%patch978 -p0
|
||||
%patch979 -p0
|
||||
%patch980 -p0
|
||||
%patch981 -p0
|
||||
%patch982 -p0
|
||||
%patch983 -p0
|
||||
%patch984 -p0
|
||||
%patch985 -p0
|
||||
%patch986 -p0
|
||||
%patch987 -p0
|
||||
|
||||
|
||||
# install spell files
|
||||
@ -2119,8 +2205,8 @@ autoconf
|
||||
sed -e "s+VIMRCLOC = \$(VIMLOC)+VIMRCLOC = /etc+" Makefile > Makefile.tmp
|
||||
mv -f Makefile.tmp Makefile
|
||||
|
||||
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2"
|
||||
export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2"
|
||||
export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2"
|
||||
export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2"
|
||||
|
||||
%configure --with-features=huge \
|
||||
--enable-pythoninterp=dynamic \
|
||||
@ -2198,15 +2284,15 @@ perl -pi -e "s/\/etc\/vimrc/\/etc\/virc/" os_unix.h
|
||||
make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/{after,autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/after/{autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
|
||||
rm -rf %{buildroot}
|
||||
mkdir -p %{buildroot}/%{_bindir}
|
||||
mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/{after,autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
|
||||
mkdir -p %{buildroot}/%{_datadir}/%{name}/vimfiles/after/{autoload,colors,compiler,doc,ftdetect,ftplugin,indent,keymap,lang,plugin,print,spell,syntax,tutor}
|
||||
cp -f %{SOURCE11} .
|
||||
%if %{?fedora}%{!?fedora:0} >= 16 || %{?rhel}%{!?rhel:0} >= 6
|
||||
cp -f %{SOURCE15} $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/template.spec
|
||||
cp -f %{SOURCE15} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec
|
||||
%else
|
||||
cp -f %{SOURCE14} $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/template.spec
|
||||
cp -f %{SOURCE14} %{buildroot}/%{_datadir}/%{name}/vimfiles/template.spec
|
||||
%endif
|
||||
cp runtime/doc/uganda.txt LICENSE
|
||||
# Those aren't Linux info files but some binary files for Amiga:
|
||||
@ -2214,29 +2300,29 @@ rm -f README*.info
|
||||
|
||||
|
||||
cd src
|
||||
make install DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}
|
||||
make installgtutorbin DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps
|
||||
install -m755 vim $RPM_BUILD_ROOT%{_bindir}/vi
|
||||
install -m755 enhanced-vim $RPM_BUILD_ROOT%{_bindir}/vim
|
||||
install -m755 gvim $RPM_BUILD_ROOT%{_bindir}/gvim
|
||||
make install DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}
|
||||
make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir}
|
||||
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps
|
||||
install -m755 vim %{buildroot}%{_bindir}/vi
|
||||
install -m755 enhanced-vim %{buildroot}%{_bindir}/vim
|
||||
install -m755 gvim %{buildroot}%{_bindir}/gvim
|
||||
install -p -m644 %{SOURCE7} \
|
||||
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/gvim.png
|
||||
%{buildroot}%{_datadir}/icons/hicolor/16x16/apps/gvim.png
|
||||
install -p -m644 %{SOURCE8} \
|
||||
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/gvim.png
|
||||
%{buildroot}%{_datadir}/icons/hicolor/32x32/apps/gvim.png
|
||||
install -p -m644 %{SOURCE9} \
|
||||
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/gvim.png
|
||||
%{buildroot}%{_datadir}/icons/hicolor/48x48/apps/gvim.png
|
||||
install -p -m644 %{SOURCE10} \
|
||||
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/64x64/apps/gvim.png
|
||||
%{buildroot}%{_datadir}/icons/hicolor/64x64/apps/gvim.png
|
||||
|
||||
( cd $RPM_BUILD_ROOT
|
||||
( cd %{buildroot}
|
||||
ln -sf vi ./%{_bindir}/rvi
|
||||
ln -sf vi ./%{_bindir}/rview
|
||||
ln -sf vi ./%{_bindir}/view
|
||||
ln -sf vi ./%{_bindir}/ex
|
||||
ln -sf vim ./%{_bindir}/rvim
|
||||
ln -sf vim ./%{_bindir}/vimdiff
|
||||
perl -pi -e "s,$RPM_BUILD_ROOT,," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1
|
||||
perl -pi -e "s,%{buildroot},," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1
|
||||
rm -f .%{_mandir}/man1/rvim.1
|
||||
ln -sf vim.1.gz .%{_mandir}/man1/vi.1.gz
|
||||
ln -sf vim.1.gz .%{_mandir}/man1/rvi.1.gz
|
||||
@ -2247,12 +2333,12 @@ install -p -m644 %{SOURCE10} \
|
||||
ln -sf gvim ./%{_bindir}/gvimdiff
|
||||
ln -sf gvim ./%{_bindir}/vimx
|
||||
%if "%{desktop_file}" == "1"
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/applications
|
||||
mkdir -p %{buildroot}/%{_datadir}/applications
|
||||
desktop-file-install \
|
||||
%if 0%{?fedora} && 0%{?fedora} < 19
|
||||
--vendor fedora \
|
||||
%endif
|
||||
--dir $RPM_BUILD_ROOT/%{_datadir}/applications \
|
||||
--dir %{buildroot}/%{_datadir}/applications \
|
||||
%{SOURCE3}
|
||||
# --add-category "Development;TextEditor;X-Red-Hat-Base" D\
|
||||
%else
|
||||
@ -2264,7 +2350,7 @@ install -p -m644 %{SOURCE10} \
|
||||
ln -sf menu_ja_jp.ujis.vim menu_ja_jp.eucjp.vim )
|
||||
)
|
||||
|
||||
pushd $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/tutor
|
||||
pushd %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tutor
|
||||
mkdir conv
|
||||
iconv -f CP1252 -t UTF8 tutor.ca > conv/tutor.ca
|
||||
iconv -f CP1252 -t UTF8 tutor.it > conv/tutor.it
|
||||
@ -2289,13 +2375,13 @@ rmdir conv
|
||||
popd
|
||||
|
||||
# Dependency cleanups
|
||||
chmod 644 $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \
|
||||
$RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/tools/*.pl \
|
||||
$RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/tools/vim132
|
||||
chmod 644 %{buildroot}/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \
|
||||
%{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/*.pl \
|
||||
%{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/vim132
|
||||
chmod 644 ../runtime/doc/vim2html.pl
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d
|
||||
cat >$RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/vim.sh <<EOF
|
||||
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
|
||||
cat >%{buildroot}/%{_sysconfdir}/profile.d/vim.sh <<EOF
|
||||
if [ -n "\$BASH_VERSION" -o -n "\$KSH_VERSION" -o -n "\$ZSH_VERSION" ]; then
|
||||
[ -x /%{_bindir}/id ] || return
|
||||
[ \`/%{_bindir}/id -u\` -le 200 ] && return
|
||||
@ -2303,17 +2389,17 @@ if [ -n "\$BASH_VERSION" -o -n "\$KSH_VERSION" -o -n "\$ZSH_VERSION" ]; then
|
||||
alias vi >/dev/null 2>&1 || alias vi=vim
|
||||
fi
|
||||
EOF
|
||||
cat >$RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/vim.csh <<EOF
|
||||
cat >%{buildroot}/%{_sysconfdir}/profile.d/vim.csh <<EOF
|
||||
if ( -x /usr/bin/id ) then
|
||||
if ( "\`/usr/bin/id -u\`" > 100 ) then
|
||||
alias vi vim
|
||||
endif
|
||||
endif
|
||||
EOF
|
||||
chmod 0644 $RPM_BUILD_ROOT/%{_sysconfdir}/profile.d/*
|
||||
install -p -m644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/vimrc
|
||||
install -p -m644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/virc
|
||||
(cd $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{vimdir}/doc;
|
||||
chmod 0644 %{buildroot}/%{_sysconfdir}/profile.d/*
|
||||
install -p -m644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/vimrc
|
||||
install -p -m644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/virc
|
||||
(cd %{buildroot}/%{_datadir}/%{name}/%{vimdir}/doc;
|
||||
gzip -9 *.txt
|
||||
gzip -d help.txt.gz version7.txt.gz sponsor.txt.gz
|
||||
cp %{SOURCE12} .
|
||||
@ -2328,35 +2414,39 @@ EOF
|
||||
LANG=C sort tags > tags.tmp; mv tags.tmp tags
|
||||
)
|
||||
(cd ../runtime; rm -rf doc; ln -svf ../../vim/%{vimdir}/doc docs;)
|
||||
rm -f $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/macros/maze/maze*.c
|
||||
rm -rf $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/tools
|
||||
rm -rf $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl
|
||||
rm -f $RPM_BUILD_ROOT/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~
|
||||
( cd $RPM_BUILD_ROOT/%{_mandir}
|
||||
rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/macros/maze/maze*.c
|
||||
rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/tools
|
||||
rm -rf %{buildroot}/%{_datadir}/vim/%{vimdir}/doc/vim2html.pl
|
||||
rm -f %{buildroot}/%{_datadir}/vim/%{vimdir}/tutor/tutor.gr.utf-8~
|
||||
( cd %{buildroot}/%{_mandir}
|
||||
for i in `find ??/ -type f`; do
|
||||
bi=`basename $i`
|
||||
iconv -f latin1 -t UTF8 $i > $RPM_BUILD_ROOT/$bi
|
||||
mv -f $RPM_BUILD_ROOT/$bi $i
|
||||
iconv -f latin1 -t UTF8 $i > %{buildroot}/$bi
|
||||
mv -f %{buildroot}/$bi $i
|
||||
done
|
||||
)
|
||||
|
||||
# Remove not UTF-8 manpages
|
||||
for i in pl.ISO8859-2 it.ISO8859-1 ru.KOI8-R fr.ISO8859-1; do
|
||||
rm -rf $RPM_BUILD_ROOT/%{_mandir}/$i
|
||||
rm -rf %{buildroot}/%{_mandir}/$i
|
||||
done
|
||||
|
||||
# use common man1/ru directory
|
||||
mv $RPM_BUILD_ROOT/%{_mandir}/ru.UTF-8 $RPM_BUILD_ROOT/%{_mandir}/ru
|
||||
mv %{buildroot}/%{_mandir}/ru.UTF-8 %{buildroot}/%{_mandir}/ru
|
||||
|
||||
# Remove duplicate man pages
|
||||
for i in fr.UTF-8 it.UTF-8 pl.UTF-8; do
|
||||
rm -rf $RPM_BUILD_ROOT/%{_mandir}/$i
|
||||
rm -rf %{buildroot}/%{_mandir}/$i
|
||||
done
|
||||
|
||||
for i in rvim.1 gvim.1 gvimdiff.1; do
|
||||
echo ".so man1/vim.1" > $RPM_BUILD_ROOT/%{_mandir}/man1/$i
|
||||
for i in rvim.1 gvim.1 gvimdiff.1 gex.1 gview.1 gvimtutor.1 vimx.1; do
|
||||
echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/$i
|
||||
done
|
||||
touch $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/doc/tags
|
||||
mkdir -p %{buildroot}/%{_mandir}/man5
|
||||
for i in virc.5 vimrc.5; do
|
||||
echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man5/$i
|
||||
done
|
||||
touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags
|
||||
|
||||
%post X11
|
||||
touch --no-create %{_datadir}/icons/hicolor
|
||||
@ -2373,7 +2463,7 @@ fi
|
||||
update-desktop-database &> /dev/null ||:
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%files common
|
||||
%defattr(-,root,root)
|
||||
@ -2440,13 +2530,21 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%lang(zh_CN.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.UTF-8
|
||||
%lang(zh_TW.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW.UTF-8
|
||||
/%{_bindir}/xxd
|
||||
%{_mandir}/man1/vim.*
|
||||
%{_mandir}/man1/ex.*
|
||||
%{_mandir}/man1/vi.*
|
||||
%{_mandir}/man1/view.*
|
||||
%{_mandir}/man1/gex.*
|
||||
%{_mandir}/man1/gview.*
|
||||
%{_mandir}/man1/gvim*
|
||||
%{_mandir}/man1/rvi.*
|
||||
%{_mandir}/man1/rview.*
|
||||
%{_mandir}/man1/rvim.*
|
||||
%{_mandir}/man1/vi.*
|
||||
%{_mandir}/man1/view.*
|
||||
%{_mandir}/man1/vim.*
|
||||
%{_mandir}/man1/vimdiff.*
|
||||
%{_mandir}/man1/vimtutor.*
|
||||
%{_mandir}/man1/vimx.*
|
||||
%{_mandir}/man1/xxd.*
|
||||
%{_mandir}/man5/vimrc.*
|
||||
%lang(fr) %{_mandir}/fr/man1/*
|
||||
%lang(it) %{_mandir}/it/man1/*
|
||||
%lang(pl) %{_mandir}/pl/man1/*
|
||||
@ -2517,6 +2615,13 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_bindir}/view
|
||||
%{_bindir}/rvi
|
||||
%{_bindir}/rview
|
||||
%{_mandir}/man1/vim.*
|
||||
%{_mandir}/man1/vi.*
|
||||
%{_mandir}/man1/ex.*
|
||||
%{_mandir}/man1/rvi.*
|
||||
%{_mandir}/man1/rview.*
|
||||
%{_mandir}/man1/view.*
|
||||
%{_mandir}/man5/virc.*
|
||||
|
||||
%files enhanced
|
||||
%defattr(-,root,root)
|
||||
@ -2525,9 +2630,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_bindir}/vimdiff
|
||||
%{_bindir}/vimtutor
|
||||
%config(noreplace) %{_sysconfdir}/profile.d/vim.*
|
||||
%{_mandir}/man1/rvim.*
|
||||
%{_mandir}/man1/vimdiff.*
|
||||
%{_mandir}/man1/vimtutor.*
|
||||
|
||||
%files filesystem
|
||||
%defattr(-,root,root)
|
||||
@ -2565,10 +2667,16 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_bindir}/vimx
|
||||
%{_bindir}/evim
|
||||
%{_mandir}/man1/evim.*
|
||||
%{_mandir}/man1/gvim*
|
||||
%{_datadir}/icons/hicolor/*/apps/*
|
||||
|
||||
%changelog
|
||||
* Tue May 21 2013 Karsten Hopp <karsten@redhat.com> 7.3.987-1
|
||||
- patchlevel 987
|
||||
|
||||
* Tue May 21 2013 Karsten Hopp <karsten@redhat.com> 7.3.944-2
|
||||
- consistent use of macros in spec file
|
||||
- add some links to man pages
|
||||
|
||||
* Tue May 14 2013 Karsten Hopp <karsten@redhat.com> 7.3.944-1
|
||||
- patchlevel 944
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user