Compare commits

...

72 Commits

Author SHA1 Message Date
Bram Moolenaar
fc714b35c6 updated for version 7.3.1069
Problem:    Python: memory leaks.
Solution:   Python patch 28: Purge out DICTKEY_CHECK_EMPTY macros. (ZyX)
2013-05-30 14:52:37 +02:00
Bram Moolenaar
018acca3bd updated for version 7.3.1068
Problem:    Python: Script is auto-loaded on function creation.
Solution:   Python patch 27. (ZyX)
2013-05-30 13:37:28 +02:00
Bram Moolenaar
305b2fde13 updated for version 7.3.1067
Problem:    Python: documentation lags behind.
Solution:   Python patch 26. (ZyX)
2013-05-30 13:32:30 +02:00
Bram Moolenaar
8600e40a67 updated for version 7.3.1066
Problem:    Python: Insufficient exception and error testing.
Solution:   Python patch 25. (ZyX)
2013-05-30 13:28:41 +02:00
Bram Moolenaar
bcb40977c3 updated for version 7.3.1065
Problem:    Python: key mapping is not standard.
Solution:   Puthon patch 24: use PyMapping_Keys. (ZyX)
2013-05-30 13:22:13 +02:00
Bram Moolenaar
494ff7e850 updated for version 7.3.1064
Problem:    Python: insufficient error checking.
Solution:   Python patch 23. (ZyX)
2013-05-30 13:17:17 +02:00
Bram Moolenaar
355fd9b468 updated for version 7.3.1063
Problem:    Python: Function is not standard.
Solution:   Python patch 22: make Function subclassable. (ZyX)
2013-05-30 13:14:13 +02:00
Bram Moolenaar
78cddbe271 updated for version 7.3.1062
Problem:    Python: List is not standard.
Solution:   Python patch 21: Add standard methods and fields. (ZyX)
2013-05-30 13:05:58 +02:00
Bram Moolenaar
a9922d62e6 updated for version 7.3.1061
Problem:    Python: Dictionary is not standard.
Solution:   Python patch 20: Add standard methods and fields. (ZyX)
2013-05-30 13:01:18 +02:00
Bram Moolenaar
a5b725c3f6 updated for version 7.3.1060
Problem:    Python: can't repr() a function.
Solution:   Python patch 19: add FunctionRepr(). (ZyX)
2013-05-30 12:43:54 +02:00
Bram Moolenaar
1a3b56953e updated for version 7.3.1059
Problem:    Python: Using fixed size buffers.
Solution:   Python patch 18: Use python's own formatter. (ZyX)
2013-05-30 12:40:39 +02:00
Bram Moolenaar
a1544c00c8 updated for version 7.3.1058
Problem:    Call of funcref does not succeed in other script.
Solution:   Python patch 17: add get_expanded_name(). (ZyX)
2013-05-30 12:35:52 +02:00
Bram Moolenaar
01a7a720ad updated for version 7.3.1057
Problem:    Python: not enough compatibilty.
Solution:   Python patch 16: Make OutputWritelines support any sequence object
            (ZyX) Note: tests fail
2013-05-30 12:26:58 +02:00
Bram Moolenaar
9bb77d6fe6 updated for version 7.3.1056
Problem:    Python: possible memory leaks.
Solution:   Python patch 15. (ZyX) Fix will follow later.
2013-05-30 12:14:49 +02:00
Bram Moolenaar
bad704fa04 updated for version 7.3.1055
Problem:    Negated collection does not match newline.
Solution:   Handle newline differently. (Hiroshi Shirosaki)
2013-05-30 11:51:08 +02:00
Bram Moolenaar
7e28384a9a updated for version 7.3.1054
Problem:    Can't build without the +autocmd feature. (Elimar Riesebieter)
Solution:   Fix use of buf and curbuf.
2013-05-30 11:43:15 +02:00
Bram Moolenaar
07b8864111 updated for version 7.3.1053
Problem:    Python: no flag for types with tp_traverse+tp_clear.
Solution:   Python patch 14: Add Py_TPFLAGS_HAVE_GC. (ZyX)
2013-05-29 22:58:32 +02:00
Bram Moolenaar
1bcabe19a2 updated for version 7.3.1052
Problem:    Python: possible SEGV and negative refcount.
Solution:   Python patch 13: Fix IterIter function. (ZyX)
2013-05-29 22:52:32 +02:00
Bram Moolenaar
a03e631120 updated for version 7.3.1051
Problem:    Python: possible memory leaks.
Solution:   Python patch 12: fix the leaks (ZyX)
2013-05-29 22:49:26 +02:00
Bram Moolenaar
c8366790e8 updated for version 7.3.1050
Problem:    Python: Typo in pyiter_to_tv.
Solution:   Python patch 11. (ZyX)
2013-05-29 22:46:26 +02:00
Bram Moolenaar
c37b6ecd60 updated for version 7.3.1049
Problem:    Python: no consistent naming
Solution:   Python patch 10: Rename DICTKEY_GET_NOTEMPTY to DICTKEY_GET. (ZyX)
2013-05-29 22:43:37 +02:00
Bram Moolenaar
b38caae26c updated for version 7.3.1048
Problem:    Python: no consistent naming.
Solution:   Python patch 9: Rename d to dict and lookupDict to lookup_dict.
            (ZyX)
2013-05-29 22:39:52 +02:00
Bram Moolenaar
dd8aca664d updated for version 7.3.1047
Problem:    Python: dir() does not work properly.
Solution:   Python patch 8.  Add __dir__ method to all objects with custom
            tp_getattr supplemented by __members__ attribute for at least
            python-2* versions.  __members__ is not mentioned in python-3*
            dir() output even if it is accessible. (ZyX)
2013-05-29 22:36:10 +02:00
Bram Moolenaar
432b09c84d updated for version 7.3.1046
Problem:    Python: Using Py_BuildValue for building strings.
Solution:   Python patch 7 and 7.5: Replace Py_BuildValue with
            PyString_FromString. (ZyX)
2013-05-29 22:26:18 +02:00
Bram Moolenaar
21642ed1b4 updated for version 7.3.1045
Problem:    Python: No error handling for VimToPython function.
Solution:   Python patch 6. (ZyX)
2013-05-29 22:20:01 +02:00
Bram Moolenaar
9e822c00b1 updated for version 7.3.1044
Problem:    Python: No {Buffer,TabPage,Window}.valid attributes.
Solution:   Python patch 5: add .valid (ZyX)
2013-05-29 22:15:30 +02:00
Bram Moolenaar
3e734ea2c7 updated for version 7.3.1043
Problem:    Python: Dynamic compilation with 2.3 fails.
Solution:   Python patch 4. (ZyX)
2013-05-29 22:05:55 +02:00
Bram Moolenaar
e9ba516be2 updated for version 7.3.1042
Problem:    Python: can't assign to vim.Buffer.name.
Solution:   Python patch 3. (ZyX)
2013-05-29 22:02:22 +02:00
Bram Moolenaar
1bc2428e1f updated for version 7.3.1041
Problem:    Python: Invalid read valgrind errors.
Solution:   Python patch 2: defer DICTKEY_UNREF until key is no longer needed.
            (ZyX)
2013-05-29 21:37:35 +02:00
Bram Moolenaar
0014a53ad1 updated for version 7.3.1040
Problem:    Python: Problems with debugging dynamic build.
Solution:   Python patch 1. (ZyX)
2013-05-29 21:33:39 +02:00
Bram Moolenaar
423532e10d updated for version 7.3.1039
Problem:    New regexp engine does not support \%23c, \%<23c and the like.
Solution:   Implement them. (partly by Yasuhiro Matsumoto)
2013-05-29 21:14:42 +02:00
Bram Moolenaar
28c2191949 updated for version 7.3.1038
Problem:    Crash when using Cscope.
Solution:   Avoid negative argument to vim_strncpy(). (Narendran
            Gopalakrishnan)
2013-05-29 19:18:00 +02:00
Bram Moolenaar
75eb1610e1 updated for version 7.3.1037
Problem:    Look-behind matching is very slow on long lines.
Solution:   Add a byte limit to how far back an attempt is made.
2013-05-29 18:45:11 +02:00
Bram Moolenaar
f9e56b2b03 updated for version 7.3.1036
Problem:    Can't build on HP-UX.
Solution:   Give the union a name. (John Marriott)
2013-05-28 22:52:16 +02:00
Bram Moolenaar
4ac6676cee updated for version 7.3.1035
Problem:    Compiler warning on 64 bit windows.
Solution:   Add type cast. (Mike Williams)
2013-05-28 22:31:46 +02:00
Bram Moolenaar
51a2983904 updated for version 7.3.1034
Problem:    New regexp code using strange multi-byte code.
Solution:   Use the normal code to advance and backup pointers.
2013-05-28 22:30:35 +02:00
Bram Moolenaar
5714b80032 updated for version 7.3.1033
Problem:    "\1" .. "\9" are not supported in the new regexp engine.
Solution:   Implement them.  Add a few more tests.
2013-05-28 22:03:20 +02:00
Bram Moolenaar
e0fea9c405 updated for version 7.3.1032
Problem:    "\ze" is not supported by the new regexp engine.
Solution:   Make "\ze" work.
2013-05-27 20:10:50 +02:00
Bram Moolenaar
eb3ecae23a updated for version 7.3.1031
Problem:    Compiler warnings for shadowed variable. (John Little)
Solution:   Move the variable declarations to the scope where they are used.
2013-05-27 11:22:04 +02:00
Bram Moolenaar
2cb8feb880 updated for version 7.3.1030
Problem:    Can't build for debugging.
Solution:   Fix struct member names.
2013-05-26 23:13:07 +02:00
Bram Moolenaar
26c2f3fc4e updated for version 7.3.1029
Problem:    New regexp performance: Unused position state being copied.
Solution:   Keep track of which positions are actually valid.
2013-05-26 22:56:19 +02:00
Bram Moolenaar
963fee2d69 updated for version 7.3.1028
Problem:    New regexp performance: Copying a lot of position state.
Solution:   Only copy the sub-expressions that are being used.
2013-05-26 21:47:28 +02:00
Bram Moolenaar
c4912e555b updated for version 7.3.1027
Problem:    New regexp performance: Calling no_Magic() very often.
Solution:   Remove magicness inline.
2013-05-26 19:19:52 +02:00
Bram Moolenaar
e23febdb85 updated for version 7.3.1026
Problem:    New regexp: pattern that includs a new-line matches too early.
            (john McGowan)
Solution:   Do not start searching in the second line.
2013-05-26 18:40:14 +02:00
Bram Moolenaar
61db8b5108 updated for version 7.3.1025
Problem:    New regexp: not matching newline in string. (Marc Weber)
Solution:   Check for "\n" character.
2013-05-26 17:45:49 +02:00
Bram Moolenaar
57a285b105 updated for version 7.3.1024
Problem:    New regexp: End of matching pattern not set correctly. (Cesar
            Romani)
Solution:   Quit the loop after finding the match.  Store nfa_has_zend in the
            program.
2013-05-26 16:57:28 +02:00
Bram Moolenaar
3451d66244 updated for version 7.3.1023
Problem:    Searching for composing char only and using \Z has different
            results.
Solution:   Make it match the composing char, matching everything is not
            useful.
2013-05-26 15:14:55 +02:00
Bram Moolenaar
7cd4d9c17c updated for version 7.3.1022
Problem:    Compiler warning for shadowed variable. (John Little)
Solution:   Move declaration, rename variables.
2013-05-26 14:54:12 +02:00
Bram Moolenaar
3f1682e808 updated for version 7.3.1021
Problem:    New regexp engine does not ignore order of composing chars.
Solution:   Ignore composing chars order.
2013-05-26 14:32:05 +02:00
Bram Moolenaar
fdb6dc1105 updated for version 7.3.1020
Problem:    Not all patterns are tested with auto / old / new engine.
Solution:   Test patterns with three values of 'regexpengine'.
2013-05-25 23:15:27 +02:00
Bram Moolenaar
47196581b8 updated for version 7.3.1019
Problem:    These do not work with the new regexp engine: \%o123, \%x123,
            \%d123, \%u123 and \%U123.
Solution:   Implement these items.
2013-05-25 22:04:23 +02:00
Bram Moolenaar
aae4883e01 updated for version 7.3.1018
Problem:    New regexp engine wastes memory.
Solution:   Allocate prog with actual number of states, not estimated maximum
            number of sates.
2013-05-25 21:18:34 +02:00
Bram Moolenaar
4b41706477 updated for version 7.3.1017
Problem:    Zero width match changes length of match.
Solution:   For a zero width match put new states in the current position in
            the state list.
2013-05-25 20:19:50 +02:00
Bram Moolenaar
f47ca63dbc updated for version 7.3.1016
Problem:    Unused field in nfa_state.
Solution:   Remove lastthread.
2013-05-25 15:31:05 +02:00
Bram Moolenaar
56d58d51bf updated for version 7.3.1015
Problem:    New regexp engine: Matching composing characters is wrong.
Solution:   Fix matching composing characters.
2013-05-25 14:42:03 +02:00
Bram Moolenaar
152e7890c1 updated for version 7.3.1014
Problem:    New regexp state dump is hard to read.
Solution:   Make the state dump more pretty. (Taro Muraoka)
2013-05-25 12:28:11 +02:00
Bram Moolenaar
d6c11cb3e0 updated for version 7.3.1013
Problem:    New regexp logging is a bit messy.
Solution:   Consistently use #defines, add explanatory comment. (Taro Muraoka)
2013-05-25 12:18:39 +02:00
Bram Moolenaar
fad8de084a updated for version 7.3.1012
Problem:    \Z does not work properly with the new regexp engine.
Solution:   Make \Z work.  Add tests.
2013-05-24 23:10:50 +02:00
Bram Moolenaar
3c577f26cd updated for version 7.3.1011
Problem:    New regexp engine is inefficient with multi-byte characters.
Solution:   Handle a character at a time instead of a byte at a time.  Also
            make \Z partly work.
2013-05-24 21:59:54 +02:00
Bram Moolenaar
1d814754c0 updated for version 7.3.1010
Problem:    New regexp: adding \Z makes every character match.
Solution:   Only apply ireg_icombine for composing characters.
            Alsl add missing change from patch 1008. (Ken Takata)
2013-05-24 20:25:33 +02:00
Bram Moolenaar
425154d888 updated for version 7.3.1009
Problem:    Compiler warning for ambiguous else.
Solution:   Add curly braces.
2013-05-24 18:58:43 +02:00
Bram Moolenaar
02e26d9807 updated for version 7.3.1008
Problem:    Test 95 fails on MS-Windows.
Solution:   Set 'nomore'. Change \i to \f.  Change multi-byte character to
            something that is not matching \i. (Ken Takata)
2013-05-23 22:43:08 +02:00
Bram Moolenaar
a03dbed9e9 updated for version 7.3.1007
Problem:    Can't build on Minix 3.2.1.
Solution:   Add a condition to an #ifdef. (Gautam Tirumala)
2013-05-23 22:27:03 +02:00
Bram Moolenaar
307d10a2fb updated for version 7.3.1006
Problem:    NFA engine not used for "\_[0-9]".
Solution:   Enable this, fixed in patch 1005.
2013-05-23 22:25:15 +02:00
Bram Moolenaar
35b2386a8e updated for version 7.3.1005
Problem:    Get stuck on regexp "\n*" and on "%s/^\n\+/\r".
Solution:   Fix handling of matching a line break. (idea by Hirohito Higashi)
2013-05-22 23:00:40 +02:00
Bram Moolenaar
c96ebe75e5 updated for version 7.3.1004
Problem:    No error when option could not be set.
Solution:   Report an error. (ZyX)
2013-05-21 22:38:18 +02:00
Bram Moolenaar
2a0f3d3fb2 updated for version 7.3.1003
Problem:    Python interface does not compile with Python 2.2
Solution:   Fix thread issues and True/False. (ZyX)
2013-05-21 22:23:56 +02:00
Bram Moolenaar
0b9aecc3a5 updated for version 7.3.1002
Problem:    Valgrind errors for Python interface.
Solution:   Fix memory leaks when running tests. (ZyX)
2013-05-21 22:13:41 +02:00
Bram Moolenaar
673af4d304 updated for version 7.3.1001
Problem:    Duplicate condition in if.
Solution:   Remove one condition.
2013-05-21 22:00:51 +02:00
Bram Moolenaar
2eec59e30b updated for version 7.3.1000
Problem:    Typo in char value causes out of bounds access.
Solution:   Fix character value.  (Klemens Baum)
2013-05-21 21:37:20 +02:00
Bram Moolenaar
f878bf0da2 updated for version 7.3.999
Problem:    New regexp engine sets curbuf temporarily.
Solution:   Use reg_buf instead, like the old engine.
2013-05-21 21:20:20 +02:00
Bram Moolenaar
e6ae6225b4 Updated runtime files, language files and translations. 2013-05-21 21:01:10 +02:00
55 changed files with 16139 additions and 4208 deletions

View File

@@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
" Date: Apr 16, 2013
" Version: 148
" Date: May 18, 2013
" Version: 149
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
@@ -22,7 +22,7 @@
if &cp || exists("g:loaded_netrw")
finish
endif
let g:loaded_netrw = "v148"
let g:loaded_netrw = "v149"
if v:version < 703 || (v:version == 703 && !has("patch465"))
echohl WarningMsg
echo "***warning*** this version of netrw needs vim 7.3.465 or later"
@@ -49,12 +49,12 @@ set cpo&vim
" 0=note = s:NOTE
" 1=warning = s:WARNING
" 2=error = s:ERROR
" Apr 02, 2013 : max errnum currently is 92
" May 01, 2013 : max errnum currently is 93
fun! netrw#ErrorMsg(level,msg,errnum)
" call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
if a:level < g:netrw_errorlvl
" call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g;netrw_errorlvl=".g:netrw_errorlvl)
" call Dret("netrw#ErrorMsg : suppressing level=".a:level." since g:netrw_errorlvl=".g:netrw_errorlvl)
return
endif
@@ -128,7 +128,7 @@ endfun
" NetrwInit: initializes variables if they haven't been defined {{{2
" Loosely, varname = value.
fun s:NetrwInit(varname,value)
" call Decho("varname<".a:varname."> value=".a:value)
" call Decho("varname<".a:varname."> value=".a:value)
if !exists(a:varname)
if type(a:value) == 0
exe "let ".a:varname."=".a:value
@@ -202,7 +202,20 @@ if !exists("g:netrw_http_cmd")
endif
call s:NetrwInit("g:netrw_rcp_cmd" , "rcp")
call s:NetrwInit("g:netrw_rsync_cmd", "rsync")
call s:NetrwInit("g:netrw_scp_cmd" , "scp -q")
if !exists("g:netrw_scp_cmd")
if executable("scp")
call s:NetrwInit("g:netrw_scp_cmd" , "scp -q")
elseif executable("pscp")
if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable('c:\private.ppk')
call s:NetrwInit("g:netrw_scp_cmd", 'pscp -i c:\private.ppk')
else
call s:NetrwInit("g:netrw_scp_cmd", 'pscp -q')
endif
else
call s:NetrwInit("g:netrw_scp_cmd" , "scp -q")
endif
endif
call s:NetrwInit("g:netrw_sftp_cmd" , "sftp")
call s:NetrwInit("g:netrw_ssh_cmd" , "ssh")
@@ -278,19 +291,23 @@ if !exists("g:netrw_ignorenetrc")
endif
call s:NetrwInit("g:netrw_keepdir",1)
if !exists("g:netrw_list_cmd")
if g:netrw_scp_cmd =~ '^pscp' && executable("pscp")
" provide a 'pscp' listing command
if (has("win32") || has("win95") || has("win64") || has("win16")) && filereadable("c:\\private.ppk")
" provide a pscp-based listing command
let g:netrw_scp_cmd ="pscp -i C:\\private.ppk"
endif
let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:"
elseif executable(g:netrw_ssh_cmd)
" provide a default listing command
" provide a scp-based default listing command
let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa"
else
" call Decho(g:netrw_ssh_cmd." is not executable")
let g:netrw_list_cmd= ""
endif
endif
call s:NetrwInit("g:netrw_list_hide","")
" Default values - lh-lz ---------- {{{3
@@ -474,7 +491,7 @@ endif
" NetrwBrowse.
" vt: normally its "w:" or "s:" (a variable type)
fun! s:NetrwOptionSave(vt)
" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$"))
" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")." mod=".&mod." ma=".&ma)
" call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist"))
if !exists("{a:vt}netrw_optionsave")
@@ -730,10 +747,16 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." modifiable=".&modifiable." a:0=".a:0." win#".winnr()." buf#".bufnr("%"))
if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd()
if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
let b:netrw_curdir= substitute(b:netrw_curdir,'\','/','g')
endif
" call Decho("(Explore) set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
endif
let curdir = simplify(b:netrw_curdir)
let curfiledir = substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e')
if !exists("g:netrw_cygwin") && (has("win32") || has("win95") || has("win64") || has("win16"))
let curdir= substitute(curdir,'\','/','g')
endif
" call Decho("(Explore) curdir<".curdir."> curfiledir<".curfiledir.">")
" save registers
@@ -793,7 +816,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
keepj norm! 0
if a:0 > 0
" call Decho("(Explore) case [a:0=".a:0."] > 0")
" call Decho("(Explore) case [a:0=".a:0."] > 0: a:1<".a:1.">")
if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin))
" call Decho("(Explore) ..case a:1<".a:1.">: starts with ~ and unix or cygwin")
let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),''))
@@ -809,7 +832,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("(Explore) ..case a:1<".a:1.">: matches ending $")
let dirname= simplify(expand(a:1))
" call Decho("(Explore) ..using user-specified dirname<".dirname."> with $env-var")
elseif a:1 !~ '^\*\{1,2}/'
elseif a:1 !~ '^\*\{1,2}/' && a:1 !~ '^\a\{3,}://'
" call Decho("(Explore) ..case a:1<".a:1.">: other, not pattern or filepattern")
let dirname= simplify(a:1)
" call Decho("(Explore) ..using user-specified dirname<".dirname.">")
@@ -835,7 +858,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
if dirname =~ '^\*//'
" starpat=1: Explore *//pattern (current directory only search for files containing pattern)
" call Decho("(Explore) case Explore *//pattern")
" call Decho("(Explore) case starpat=1: Explore *//pattern")
let pattern= substitute(dirname,'^\*//\(.*\)$','\1','')
let starpat= 1
" call Decho("(Explore) ..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">")
@@ -843,14 +866,14 @@ fun! netrw#Explore(indx,dosplit,style,...)
elseif dirname =~ '^\*\*//'
" starpat=2: Explore **//pattern (recursive descent search for files containing pattern)
" call Decho("(Explore) case Explore **//pattern")
" call Decho("(Explore) case starpat=2: Explore **//pattern")
let pattern= substitute(dirname,'^\*\*//','','')
let starpat= 2
" call Decho("(Explore) ..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">")
elseif dirname =~ '/\*\*/'
" handle .../**/.../filepat
" call Decho("(Explore) case Explore .../**/.../filepat")
" call Decho("(Explore) case starpat=4: Explore .../**/.../filepat")
let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','')
if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16")))
let b:netrw_curdir = prefixdir
@@ -863,32 +886,40 @@ fun! netrw#Explore(indx,dosplit,style,...)
" call Decho("(Explore) ..case Explore ../**/../filepat (starpat=".starpat.")")
elseif dirname =~ '^\*/'
" starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
" case starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
let starpat= 3
" call Decho("(Explore) case Explore */filepat (starpat=".starpat.")")
" call Decho("(Explore) case starpat=3: Explore */filepat (starpat=".starpat.")")
elseif dirname=~ '^\*\*/'
" starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat)
let starpat= 4
" call Decho("(Explore) case Explore **/filepat (starpat=".starpat.")")
" call Decho("(Explore) case starpat=4: Explore **/filepat (starpat=".starpat.")")
else
let starpat= 0
" call Decho("(Explore) default case: starpat=".starpat)
" call Decho("(Explore) case starpat=0: default")
endif
if starpat == 0 && a:indx >= 0
" [Explore Hexplore Vexplore Sexplore] [dirname]
" call Decho("(Explore) case starpat==0 && a:indx=".a:indx.": dirname<".dirname."> Explore Hexplore Vexplore Sexplore")
" call Decho("(Explore) case starpat==0 && a:indx=".a:indx.": dirname<".dirname.">, handles Explore Hexplore Vexplore Sexplore")
if dirname == ""
let dirname= curfiledir
" call Decho("(Explore) ..empty dirname, using current file's directory<".dirname.">")
endif
if dirname =~ '^scp:' || dirname =~ '^ftp:'
" call Decho("(Explore) ..calling NetrwBrowse(0,dirname<".dirname.">)")
call s:NetrwBrowse(0,dirname)
if dirname =~ '^scp://' || dirname =~ '^ftp://'
call netrw#Nread(2,dirname)
"call s:NetrwBrowse(0,dirname)
else
if dirname == ""|let dirname= getcwd()|endif
if dirname == ""
let dirname= getcwd()
elseif (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
if dirname !~ '^[a-zA-Z]:'
let dirname= b:netrw_curdir."/".dirname
endif
elseif dirname !~ '^/'
let dirname= b:netrw_curdir."/".dirname
endif
" call Decho("(Explore) ..calling LocalBrowseCheck(dirname<".dirname.">)")
call netrw#LocalBrowseCheck(dirname)
" call Decho("(Explore) win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
@@ -1508,7 +1539,7 @@ endfun
" =2 replace with remote file
" =3 obtain file, but leave in temporary format
fun! netrw#NetRead(mode,...)
" call Dfunc("netrw#NetRead(mode=".a:mode.",...) a:0=".a:0." ".g:loaded_netrw)
" call Dfunc("netrw#NetRead(mode=".a:mode.",...) a:0=".a:0." ".g:loaded_netrw.((a:0 > 0)? " a:1<".a:1.">" : ""))
" NetRead: save options {{{3
call s:NetrwOptionSave("w:")
@@ -2404,7 +2435,6 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
" call Decho("detect filetype of local version of remote file")
let iskkeep= &l:isk
setl isk-=/
" filetype detect " COMBAK - trying filetype detect in NetrwOptionRestore Jan 24, 2013
let &l:isk= iskkeep
" call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!")
let line1 = 1
@@ -2611,8 +2641,7 @@ fun! s:NetrwMethod(choice)
" call Decho("has -s: : s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">")
" call Decho(" g:netrw_ftp_cmd<".g:netrw_ftp_cmd.">")
if g:netrw_ftp_cmd =~ '-[sS]:\S*MACHINE\>'
let machine = substitute(g:netrw_machine,'\([^.]\+\)\.\S*','\1','')
let s:netrw_ftp_cmd= substitute(g:netrw_ftp_cmd,'\<MACHINE\>',machine.".ftp",'')
let s:netrw_ftp_cmd= substitute(g:netrw_ftp_cmd,'\<MACHINE\>',g:netrw_machine,'')
" call Decho("s:netrw_ftp_cmd<".s:netrw_ftp_cmd.">")
endif
let b:netrw_method= 2
@@ -3477,7 +3506,6 @@ fun! s:NetrwBrowse(islocal,dirname)
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%")."> win#".winnr())
" call Decho("(NetrwBrowse) tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
" call Dredir("ls!")
" s:NetrwBrowse: initialize history {{{3
if !exists("s:netrw_initbookhist")
keepj call s:NetrwBookHistRead()
@@ -3759,6 +3787,7 @@ endfun
" 1=re-used buffer
fun! s:NetrwGetBuffer(islocal,dirname)
" call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle)
" call Decho("(NetrwGetBuffer) modiable=".&mod." modifiable=".&ma." readonly=".&ro)
let dirname= a:dirname
" re-use buffer if possible {{{3
@@ -3767,8 +3796,9 @@ fun! s:NetrwGetBuffer(islocal,dirname)
" find NetrwTreeList buffer if there is one
" call Decho("(NetrwGetBuffer) case liststyle=treelist: find NetrwTreeList buffer if there is one")
if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0
" call Decho("(NetrwGetBuffer) re-use w:netrw_treebufnr=".w:netrw_treebufnr)
sil keepj %d
" call Decho("(NetrwGetBuffer) re-using w:netrw_treebufnr=".w:netrw_treebufnr)
setl mod
sil! keepj %d
let eikeep= &ei
set ei=all
exe "sil! keepalt b ".w:netrw_treebufnr
@@ -3782,7 +3812,6 @@ fun! s:NetrwGetBuffer(islocal,dirname)
else
" find buffer number of buffer named precisely the same as dirname {{{3
" call Decho("(NetrwGetBuffer) case listtyle not treelist: find buffer numnber of buffer named precisely the same as dirname--")
" call Dredir("ls!")
" get dirname and associated buffer number
let bufnum = bufnr(escape(dirname,'\'))
@@ -4079,7 +4108,6 @@ fun! s:NetrwListSettings(islocal)
if g:netrw_use_noswf
setl noswf
endif
" call Dredir("ls!")
" call Decho("(NetrwListSettings) exe setl ts=".(g:netrw_maxfilenamelen+1))
exe "setl ts=".(g:netrw_maxfilenamelen+1)
setl isk+=.,~,-
@@ -4211,14 +4239,14 @@ fun! s:NetrwBookmarkMenu()
if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != [] && g:netrw_dirhistmax > 0
let cnt= 1
for bmd in g:netrw_bookmarklist
" call Decho('sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmd.' :e '.bmd)
let bmd= escape(bmd,g:netrw_menu_escape)
let ebmd= escape(bmd,g:netrw_menu_escape)
" call Decho('sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.ebmd.' :e '.bmd)
" show bookmarks for goto menu
exe 'sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmd.' :e '.bmd."\<cr>"
exe 'sil! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.ebmd.' :e '.bmd."\<cr>"
" show bookmarks for deletion menu
exe 'sil! menu '.g:NetrwMenuPriority.".8.2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete.'.bmd.' '.cnt."mB"
exe 'sil! menu '.g:NetrwMenuPriority.".8.2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete.'.ebmd.' '.cnt."mB"
let cnt= cnt + 1
endfor
@@ -4264,7 +4292,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
let @@= ykeep
" call Decho("(NetrwBrowseChgDir) b:netrw_curdir doesn't exist!")
" call Decho("(NetrwBrowseChgDir) getcwd<".getcwd().">")
" call Dredir("ls!")
" call Dret("s:NetrwBrowseChgDir")
return
endif
@@ -5467,8 +5494,13 @@ endfun
" directories. Uses the local-buffer marked file list.
" Returns 1=success (used by NetrwMarkFileMove())
" 0=failure
fun! s:NetrwMarkFileCopy(islocal)
" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---').">")
fun! s:NetrwMarkFileCopy(islocal,...)
" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---')."> a:0=".a:0)
if !exists("b:netrw_curdir")
let b:netrw_curdir= getcwd()
" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
endif
let curdir = b:netrw_curdir
let curbufnr = bufnr("%")
@@ -5495,8 +5527,45 @@ fun! s:NetrwMarkFileCopy(islocal)
" call Dfunc("s:NetrwMarkFileMove : g:netrw_localcopycmd<".g:netrw_localcopycmd."> n/a!")
return
endif
let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)"))
let tgt = shellescape(s:netrwmftgt)
" copy marked files while within the same directory (ie. allow renaming)
if simplify(s:netrwmftgt) == simplify(b:netrw_curdir)
if len(s:netrwmarkfilelist_{bufnr('%')}) == 1
" only one marked file
let args = shellescape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0])
let oldname = s:netrwmarkfilelist_{bufnr('%')}[0]
elseif a:0 == 1
" this happens when the next case was used to recursively call s:NetrwMarkFileCopy()
let args = shellescape(b:netrw_curdir."/".a:1)
let oldname = a:1
else
" copy multiple marked files inside the same directory
let s:recursive= 1
for oldname in s:netrwmarkfilelist_{bufnr("%")}
let ret= s:NetrwMarkFileCopy(a:islocal,oldname)
if ret == 0
break
endif
endfor
unlet s:recursive
call s:NetrwUnmarkList(curbufnr,curdir)
" call Dret("s:NetrwMarkFileCopy ".ret)
return ret
endif
call inputsave()
let newname= input("Copy ".oldname." to : ",oldname,"file")
call inputrestore()
if newname == ""
" call Dret("s:NetrwMarkFileCopy 0")
return 0
endif
let args= shellescape(oldname)
let tgt = shellescape(s:netrwmftgt.'/'.newname)
else
let args= join(map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),"shellescape(b:netrw_curdir.\"/\".v:val)"))
let tgt = shellescape(s:netrwmftgt)
endif
if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
let args= substitute(args,'/','\\','g')
let tgt = substitute(tgt, '/','\\','g')
@@ -5525,10 +5594,12 @@ fun! s:NetrwMarkFileCopy(islocal)
keepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
elseif !a:islocal && s:netrwmftgt_islocal
" Copy marked files, remote directory to local directory
" call Decho("copy from remote to local")
keepj call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
elseif !a:islocal && !s:netrwmftgt_islocal
" Copy marked files, remote directory to remote directory
" call Decho("copy from remote to remote")
let curdir = getcwd()
let tmpdir = s:GetTempfile("")
@@ -5570,10 +5641,11 @@ fun! s:NetrwMarkFileCopy(islocal)
" -------
" cleanup
" -------
" call Decho("cleanup")
" remove markings from local buffer
call s:NetrwUnmarkList(curbufnr,curdir)
" call Decho("cleanup")
if !exists("s:recursive")
" remove markings from local buffer
call s:NetrwUnmarkList(curbufnr,curdir)
endif
" refresh buffers
if !s:netrwmftgt_islocal
@@ -5861,7 +5933,6 @@ fun! s:NetrwMarkFileVimCmd(islocal)
exe cmd
exe "sil! keepalt wq!"
else
" COMBAK -- not supported yet
" call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET")
echo "sorry, \"mX\" not supported yet for remote files"
endif
@@ -7489,11 +7560,20 @@ fun! s:NetrwWideListing()
sil! let @*= keepregstar
exe "sil! keepj ".w:netrw_bannercnt.',$s/\s\+$//e'
keepj call histdel("/",-1)
exe "nmap <buffer> <silent> w /^\\\\|\\s\\s\\zs\\S/\<cr>"
exe "nmap <buffer> <silent> b ?^\\\\|\\s\\s\\zs\\S?\<cr>"
" call Decho("NetrwWideListing) setl noma nomod ro")
setl noma nomod ro
" call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
" call Dret("NetrwWideListing")
return
else
if hasmapto("w","n")
sil! nunmap <buffer> w
endif
if hasmapto("b","n")
sil! nunmap <buffer> b
endif
endif
endfun
@@ -7537,7 +7617,11 @@ fun! s:PerformListing(islocal)
" call Decho("(PerformListing) set up banner")
keepj call setline(1,'" ============================================================================')
keepj call setline(2,'" Netrw Directory Listing (netrw '.g:loaded_netrw.')')
keepj call setline(3,'" '.b:netrw_curdir)
if exists("g:netrw_bannerbackslash") && g:netrw_bannerbackslash
keepj call setline(3,'" '.substitute(b:netrw_curdir,'/','\\','g'))
else
keepj call setline(3,'" '.b:netrw_curdir)
endif
let w:netrw_bannercnt= 3
keepj exe "sil! keepj ".w:netrw_bannercnt
else
@@ -7606,7 +7690,7 @@ fun! s:PerformListing(islocal)
if g:netrw_banner
let w:netrw_bannercnt= w:netrw_bannercnt + 1
exe "sil! keepj ".w:netrw_bannercnt
" call Decho("(PerformListing) bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
" call Decho("(PerformListing) w:netrw_bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
endif
" get list of files
@@ -7616,12 +7700,13 @@ fun! s:PerformListing(islocal)
else " remote
keepj call s:NetrwRemoteListing()
endif
" call Decho("(PerformListing) g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)")
" manipulate the directory listing (hide, sort) {{{3
if !exists("w:netrw_bannercnt")
let w:netrw_bannercnt= 0
endif
" call Decho("(PerformListing) g:netrw_banner=".g:netrw_banner." w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)")
if !g:netrw_banner || line("$") >= w:netrw_bannercnt
" call Decho("(PerformListing) manipulate directory listing (hide)")
" call Decho("(PerformListing) g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
@@ -7763,10 +7848,18 @@ fun! s:NetrwRemoteListing()
" call Dfunc("s:NetrwRemoteListing() b:netrw_curdir<".b:netrw_curdir.">)")
call s:RemotePathAnalysis(b:netrw_curdir)
" call Decho("b:netrw_method#".(exists("b:netrw_method")? b:netrw_method : 'n/a'))
" call Decho("g:netrw_list_cmd<".(exists("g:netrw_list_cmd")? g:netrw_list_cmd : 'n/a').">")
" call Decho("ssh is ".(executable("ssh")? "" : "not ")."executable")
" call Decho("ftp is ".(executable("ftp")? "" : "not ")."executable")
" call Decho("sftp is ".(executable("sftp")? "" : "not ")."executable")
" sanity check:
if exists("b:netrw_method") && b:netrw_method =~ '[235]'
" call Decho("b:netrw_method=".b:netrw_method)
" b:netrw_method = 2: ftp+.netrc
" b:netrw_method = 3: ftp+machine,id,p/w,filename (ie. no .netrc)
" b:netrw_method = 5: wget (http)
" call Decho("b:netrw_method=".b:netrw_method." (for ".s:method.")")
if !executable("ftp")
if !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ftp",18)
@@ -7776,10 +7869,11 @@ fun! s:NetrwRemoteListing()
return
endif
elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
elseif s:method == "scp" && (!exists("g:netrw_list_cmd") || g:netrw_list_cmd == '')
" call Decho("g:netrw_list_cmd<".(exists("g:netrw_list_cmd")? g:netrw_list_cmd : 'n/a').">")
if !exists("g:netrw_quiet")
if g:netrw_list_cmd == ""
keepj call netrw#ErrorMsg(s:ERROR,g:netrw_ssh_cmd." is not executable on your system",47)
if !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ""
keepj call netrw#ErrorMsg(s:ERROR,"neither ssh nor ftp"." is executable on your system",47)
else
keepj call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
endif
@@ -7791,15 +7885,15 @@ fun! s:NetrwRemoteListing()
endif " (remote handling sanity check)
if exists("b:netrw_method")
" call Decho("setting w:netrw_method<".b:netrw_method.">")
" call Decho("setting w:netrw_method to b:netrw_method<".b:netrw_method.">")
let w:netrw_method= b:netrw_method
endif
if s:method == "ftp"
" use ftp to get remote file listing {{{3
" call Decho("use ftp to get remote file listing")
let s:method = "ftp"
let listcmd = g:netrw_ftp_list_cmd
let s:method = "ftp"
let listcmd = g:netrw_ftp_list_cmd
if g:netrw_sort_by =~ '^t'
let listcmd= g:netrw_ftp_timelist_cmd
elseif g:netrw_sort_by =~ '^s'
@@ -7822,15 +7916,14 @@ fun! s:NetrwRemoteListing()
sil! keepj %s/\r$//e
keepj call histdel("/",-1)
" if there's no ../ listed, then put ./ and ../ in
" if there's no ../ listed, then put ../ in
let line1= line(".")
exe "sil! keepj ".w:netrw_bannercnt
let line2= search('\.\.\/\%(\s\|$\)','cnW')
" call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2." w:netrw_bannercnt=".w:netrw_bannercnt)
if line2 == 0
" call Decho("netrw is putting ./ and ../ into listing")
" call Decho("netrw is putting ../ into listing")
sil! keepj put='../'
sil! keepj put='./'
endif
exe "sil! keepj ".line1
sil! keepj norm! 0
@@ -7899,13 +7992,12 @@ fun! s:NetrwRemoteListing()
while getline('.') =~ g:netrw_ftp_browse_reject
sil! keepj d
endwhile
" if there's no ../ listed, then put ./ and ../ in
" if there's no ../ listed, then put ../ in
let line1= line(".")
sil! keepj 1
sil! keepj call search('^\.\.\/\%(\s\|$\)','W')
let line2= line(".")
if line2 == 0
exe 'sil! keepj '.w:netrw_bannercnt."put='./'"
if b:netrw_curdir != '/'
exe 'sil! keepj '.w:netrw_bannercnt."put='../'"
endif
@@ -8103,8 +8195,17 @@ endfun
" and reverse sorts will be requested of the server but not otherwise
" enforced here.
fun! s:NetrwRemoteFtpCmd(path,listcmd)
" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) netrw_method=".w:netrw_method)
" call Decho("line($)=".line("$")." bannercnt=".w:netrw_bannercnt)
" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) w:netrw_method=".(exists("w:netrw_method")? w:netrw_method : (exists("b:netrw_method")? b:netrw_method : "???")))
" call Decho("line($)=".line("$")." w:netrw_bannercnt=".w:netrw_bannercnt)
if !exists("w:netrw_method")
if exists("b:netrw_method")
let w:netrw_method= b:netrw_method
else
call netrw#ErrorMsg(2,"(s:NetrwRemoteFtpCmd) internal netrw error",93)
" call Dret("NetrwRemoteFtpCmd")
return
endif
endif
" because WinXX ftp uses unix style input
let ffkeep= &ff
@@ -8359,7 +8460,7 @@ fun! netrw#LocalBrowseCheck(dirname)
" call Dredir("LocalBrowseCheck","ls!")|redraw!|sleep 3
let ykeep= @@
if isdirectory(a:dirname)
" call Decho("(LocalBrowseCheck) ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse)
" call Decho("(LocalBrowseCheck) is-directory ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse)
let svposn= netrw#NetrwSavePosn()
if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) || g:netrw_fastbrowse <= 1
sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
@@ -8407,9 +8508,11 @@ fun! s:LocalListing()
let filelist = filelist + glob(s:ComposePath(dirname,".*"),0,1)
" call Decho("(LocalListing) filelist=".filelist)
if index(filelist,'..') == -1 && b:netrw_curdir != '/'
if g:netrw_cygwin == 0 && (has("win32") || has("win95") || has("win64") || has("win16"))
" call Decho("(LocalListing) filelist=".string(filelist))
elseif index(filelist,'..') == -1 && b:netrw_curdir !~ '/'
" include ../ in the glob() entry if its missing
" call Decho("(LocalListing) forcibly tacking on \"..\"")
" call Decho("(LocalListing) forcibly including on \"..\"")
let filelist= filelist+[s:ComposePath(b:netrw_curdir,"../")]
" call Decho("(LocalListing) filelist=".string(filelist))
endif
@@ -8903,6 +9006,26 @@ endfun
" ---------------------------------------------------------------------
" Support Functions: {{{1
" ---------------------------------------------------------------------
" netrw#WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2
fun! netrw#WinPath(path)
" call Dfunc("netrw#WinPath(path<".a:path.">)")
if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && (has("win32") || has("win95") || has("win64") || has("win16"))
" remove cygdrive prefix, if present
let path = substitute(a:path,'/cygdrive/\(.\)','\1:','')
" remove trailing slash (Win95)
let path = substitute(path, '\(\\\|/\)$', '', 'g')
" remove escaped spaces
let path = substitute(path, '\ ', ' ', 'g')
" convert slashes to backslashes
let path = substitute(path, '/', '\', 'g')
else
let path= a:path
endif
" call Dret("netrw#WinPath <".path.">")
return path
endfun
" ---------------------------------------------------------------------
" netrw#NetrwRestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2
fun! netrw#NetrwRestorePosn(...)
@@ -8968,6 +9091,21 @@ fun! netrw#NetrwSavePosn()
return ret
endfun
" ---------------------------------------------------------------------
" netrw#NetrwAccess: intended to provide access to variable values for netrw's test suite {{{2
" 0: marked file list of current buffer
" 1: marked file target
fun! netrw#NetrwAccess(ilist)
if a:ilist == 0
if exists("s:netrwmarkfilelist_".bufnr('%'))
return s:netrwmarkfilelist_{bufnr('%')}
else
return "no-list-buf#".bufnr('%')
endif
elseif a:ilist == 1
return s:netrwmftgt
endfun
" ------------------------------------------------------------------------
" netrw#RFC2396: converts %xx into characters {{{2
fun! netrw#RFC2396(fname)
@@ -9223,7 +9361,7 @@ endfun
" ---------------------------------------------------------------------
" s:RestoreCursorline: restores cursorline/cursorcolumn to original user settings {{{2
fun! s:RestoreCursorline()
" call Dfunc("s:RestoreCursorline() currently, cul=".&l:cursorline." cuc=".&l:cursorcolumn." win#".winnr()." buf#".bufnr("%"))
" call Dfunc("s:RestoreCursorline() currently, cul=".&l:cursorline." cuc=".&l:cursorcolumn." win#".winnr()." buf#".bufnr("%")." mod=".&mod)
if exists("s:netrw_usercul")
let &l:cursorline = s:netrw_usercul
endif
@@ -9292,11 +9430,7 @@ fun! s:NetrwEnew(...)
keepj call s:NetrwOptionRestore("w:")
" call Decho("generate a buffer with keepjumps keepalt enew!")
let netrw_keepdiff= &l:diff
" COMBAK: Benzinger: using tree mode, vim -o Foo/ file shows Foo/ Foo/ instead. Place return here, problem goes away (beeps result, but who knows)
" call Dredir("Benzinger 1:","ls!")
keepj keepalt enew!
" call Dredir("Benzinger 2:","ls!")
" COMBAK: Benzinger: using tree mode, vim -o Foo/ file shows Foo/ Foo/ instead. Place return here, problem remains.
let &l:diff= netrw_keepdiff
" call Decho("bufnr($)=".bufnr("$"))
keepj call s:NetrwOptionSave("w:")
@@ -9715,27 +9849,7 @@ fun! s:UseBufWinVars()
endfun
" ---------------------------------------------------------------------
" netrw#WinPath: tries to insure that the path is windows-acceptable, whether cygwin is used or not {{{2
fun! netrw#WinPath(path)
" call Dfunc("netrw#WinPath(path<".a:path.">)")
if (!g:netrw_cygwin || &shell !~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$') && (has("win32") || has("win95") || has("win64") || has("win16"))
" remove cygdrive prefix, if present
let path = substitute(a:path,'/cygdrive/\(.\)','\1:','')
" remove trailing slash (Win95)
let path = substitute(path, '\(\\\|/\)$', '', 'g')
" remove escaped spaces
let path = substitute(path, '\ ', ' ', 'g')
" convert slashes to backslashes
let path = substitute(path, '/', '\', 'g')
else
let path= a:path
endif
" call Dret("netrw#WinPath <".path.">")
return path
endfun
" ---------------------------------------------------------------------
" Settings Restoration: {{{2
" Settings Restoration: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo

View File

@@ -1,8 +1,8 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell
" Date: Mar 14, 2012
" Version: 11a
" Date: May 03, 2013
" Version: 11b ASTRO-ONLY
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@@ -20,7 +20,7 @@
if exists("g:loaded_netrwFileHandlers") || &cp
finish
endif
let g:loaded_netrwFileHandlers= "v11a"
let g:loaded_netrwFileHandlers= "v11b"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
@@ -34,10 +34,10 @@ set cpo&vim
" netrwFileHandlers#Invoke: {{{1
fun! netrwFileHandlers#Invoke(exten,fname)
" call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)")
let fname= a:fname
let exten= a:exten
" list of supported special characters. Consider rcs,v --- that can be
" supported with a NFH_rcsCOMMAv() handler
if a:fname =~ '[@:,$!=\-+%?;~]'
if exten =~ '[@:,$!=\-+%?;~]'
let specials= {
\ '@' : 'AT',
\ ':' : 'COLON',
@@ -51,18 +51,18 @@ fun! netrwFileHandlers#Invoke(exten,fname)
\ '?' : 'QUESTION',
\ ';' : 'SEMICOLON',
\ '~' : 'TILDE'}
let fname= substitute(a:fname,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge')
let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge')
" call Decho('fname<'.fname.'> done with dictionary')
endif
if a:exten != "" && exists("*NFH_".a:exten)
if a:exten != "" && exists("*NFH_".exten)
" support user NFH_*() functions
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
exe "let ret= NFH_".a:exten.'("'.fname.'")'
elseif a:exten != "" && exists("*s:NFH_".a:exten)
exe "let ret= NFH_".exten.'("'.a:fname.'")'
elseif a:exten != "" && exists("*s:NFH_".exten)
" use builtin-NFH_*() functions
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
exe "let ret= s:NFH_".a:exten.'("'.fname.'")'
exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")'
endif
" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)

View File

@@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler
" Date: Sep 03, 2008
" Date: May 03, 2013
" Maintainer: Charles E Campbell <drchipNOSPAM at campbellfamily dot biz>
" Version: 13
" Version: 14a ASTRO-ONLY
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@@ -19,7 +19,7 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
let g:loaded_netrwSettings = "v13"
let g:loaded_netrwSettings = "v14a"
if v:version < 700
echohl WarningMsg
echo "***warning*** this version of netrwSettings needs vim 7.0"
@@ -88,6 +88,7 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
put = 'let g:netrw_sshport = '.g:netrw_sshport
put = 'let g:netrw_silent = '.g:netrw_silent
put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp
let s:netrw_xfer_stop= line(".")
@@ -99,27 +100,50 @@ fun! netrwSettings#NetrwSettings()
put ='+ Netrw Browser Control'
put = 'let g:netrw_alto = '.g:netrw_alto
put = 'let g:netrw_altv = '.g:netrw_altv
put = 'let g:netrw_banner = '.g:netrw_banner
if exists("g:netrw_bannerbackslash")
put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash
else
put = '\" let g:netrw_bannerbackslash = (not defined)'
endif
put = 'let g:netrw_browse_split = '.g:netrw_browse_split
if exists("g:netrw_browsex_viewer")
put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
else
put = 'let g:netrw_browsex_viewer = (not defined)'
put = '\" let g:netrw_browsex_viewer = (not defined)'
endif
put = 'let g:netrw_compress = '.g:netrw_compress
if exists("g:Netrw_corehandler")
put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler
else
put = '\" let g:Netrw_corehandler = (not defined)'
endif
put = 'let g:netrw_ctags = '.g:netrw_ctags
put = 'let g:netrw_cursor = '.g:netrw_cursor
let decompressline= line("$")
put ='let g:netrw_decompress...'
put = 'let g:netrw_decompress = '.string(g:netrw_decompress)
if exists("g:netrw_dynamic_maxfilenamelen")
put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen
else
put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)'
endif
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl
put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
let fnameescline= line("$")
put = 'let g:netrw_fname_escape...'
put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape)
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd
put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd
let globescline= line("$")
put ='let g:netrw_glob_escape...'
put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape)
put = 'let g:netrw_hide = '.g:netrw_hide
if exists("g:netrw_home")
put = 'let g:netrw_home = '.g:netrw_home
else
put = '\" let g:netrw_home = (not defined)'
endif
put = 'let g:netrw_keepdir = '.g:netrw_keepdir
put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
@@ -127,23 +151,30 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd
put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir
put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd
put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir
put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
put = 'let g:netrw_menu = '.g:netrw_menu
put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
if exists("g:netrw_nobeval")
put = 'let g:netrw_nobeval = '.g:netrw_nobeval
else
put = '\" let g:netrw_nobeval = (not defined)'
endif
put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir
put = 'let g:netrw_preview = '.g:netrw_preview
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
put = 'let g:netrw_retmap = '.g:netrw_retmap
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
put = 'let g:netrw_silent = '.g:netrw_silent
put = 'let g:netrw_sort_by = '.g:netrw_sort_by
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
put = 'let g:netrw_sort_options = '.g:netrw_sort_options
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
put = 'let g:netrw_scpport = '.g:netrw_scpport
put = 'let g:netrw_sepchr = '.g:netrw_sepchr
put = 'let g:netrw_sshport = '.g:netrw_sshport

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.3. Last change: 2013 Mar 19
*autocmd.txt* For Vim version 7.3. Last change: 2013 May 19
VIM REFERENCE MANUAL by Bram Moolenaar

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.3. Last change: 2013 May 17
*eval.txt* For Vim version 7.3. Last change: 2013 May 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1297,7 +1297,7 @@ v:beval_winnr The number of the window, over which the mouse pointer is. Only
*v:char* *char-variable*
v:char Argument for evaluating 'formatexpr' and used for the typed
character when using <expr> in an abbreviation |:map-<expr>|.
It is also used by the |InsertCharPre| event.
It is also used by the |InsertCharPre| and |InsertEnter| events.
*v:charconvert_from* *charconvert_from-variable*
v:charconvert_from
@@ -4639,7 +4639,7 @@ pumvisible() *pumvisible()*
This can be used to avoid some things that would remove the
popup menu.
*E860* *E861*
*E860*
py3eval({expr}) *py3eval()*
Evaluate Python expression {expr} and return its result
converted to Vim data structures.

View File

@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 7.3. Last change: 2013 May 17
*if_pyth.txt* For Vim version 7.3. Last change: 2013 May 21
VIM REFERENCE MANUAL by Paul Moore
@@ -12,9 +12,10 @@ The Python Interface to Vim *python* *Python*
4. Range objects |python-range|
5. Window objects |python-window|
6. Tab page objects |python-tabpage|
7. pyeval(), py3eval() Vim functions |python-pyeval|
8. Dynamic loading |python-dynamic|
9. Python 3 |python3|
7. vim.bindeval objects |python-bindeval-objects|
8. pyeval(), py3eval() Vim functions |python-pyeval|
9. Dynamic loading |python-dynamic|
10. Python 3 |python3|
{Vi does not have any of these commands}
@@ -171,47 +172,9 @@ vim.eval(str) *python-eval*
'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}]
vim.bindeval(str) *python-bindeval*
Like |python-eval|, but
1. if expression evaluates to |List| or |Dictionary| it is returned as
vimlist or vimdictionary python type that are connected to original
list or dictionary. Thus modifications to these objects imply
modifications of the original.
Additionally, vim.List and vim.Dictionary type have read-write
`.locked` attribute that returns
Value Meaning ~
zero Variable is not locked
vim.VAR_LOCKED Variable is locked, but can be unlocked
vim.VAR_FIXED Variable is locked and can't be unlocked
integer constants. If variable is not fixed, you can do
`var.locked=True` to lock it and `var.locked=False` to unlock.
There is no recursive locking like |:lockvar|! does. There is also
no way to lock a specific key or check whether it is locked (in any
case these locks are ignored by anything except |:let|: |extend()|
does not care, neither does python interface).
vim.Dictionary type also supports `.scope` attribute which is one
of
Value Meaning ~
zero Dictionary is not a scope one
vim.VAR_DEF_SCOPE Function-local or global scope dictionary
vim.VAR_SCOPE Other scope dictionary
2. if expression evaluates to a function reference, then it returns
callable vim.Function object. Use self keyword argument to assign
|self| object for dictionary functions.
Note: this function has the same behavior as |lua-eval| (except that
lua does not support running vim functions), |python-eval| is
kept for backwards compatibility in order not to make scripts
relying on outputs of vim.eval() being a copy of original or
vim.eval("1") returning a string.
You can use "List", "Dictionary" and "Function" vim module attributes
to test whether object has given type. These types are currently not
subclassable, neither they contain constructors, so you can use them
only for checks like `isinstance(obj, vim.List)`.
Like |python-eval|, but returns special objects described in
|python-bindeval-objects|. These python objects let you modify (|List|
or |Dictionary|) or call (|Funcref|) vim objecs.
Error object of the "vim" module
@@ -250,7 +213,7 @@ vim.windows *python-windows*
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.
they will not lose their properties in this case.
vim.tabpages *python-tabpages*
A sequence object providing access to the list of vim tab pages. The
@@ -361,6 +324,11 @@ The buffer object attributes are:
this object will raise KeyError. If option is
|global-local| and local value is missing getting it
will return None.
b.name String, RW. Contains buffer name (full path).
Note: when assigning to b.name |BufFilePre| and
|BufFilePost| autocommands are launched.
b.number Buffer number. Can be used as |python-buffers| key.
Read-only.
The buffer object methods are:
b.append(str) Append a line to the buffer
@@ -492,13 +460,119 @@ Tab page attributes are:
TabPage object type is available using "TabPage" attribute of vim module.
==============================================================================
7. pyeval() and py3eval() Vim functions *python-pyeval*
7. vim.bindeval objects *python-bindeval-objects*
vim.Dictionary object *python-Dictionary*
Dictionary-like object providing access to vim |Dictionary| type.
Attributes:
Attribute Description ~
locked One of *python-.locked*
Value Description ~
zero Variable is not locked
vim.VAR_LOCKED Variable is locked, but can be unlocked
vim.VAR_FIXED Variable is locked and can't be unlocked
Read-write. You can unlock locked variable by assigning
`True` or `False` to this attribute. No recursive locking
is supported.
scope One of
Value Description ~
zero Dictionary is not a scope one
vim.VAR_DEF_SCOPE |g:| or |l:| dictionary
vim.VAR_SCOPE Other scope dictionary,
see |internal-variables|
Methods (note: methods do not support keyword arguments):
Method Description ~
keys() Returns a list with dictionary keys.
values() Returns a list with dictionary values.
items() Returns a list of 2-tuples with dictionary contents.
update(iterable), update(dictionary), update(**kwargs)
Adds keys to dictionary.
get(key[, default=None])
Obtain key from dictionary, returning the default if it is
not present.
pop(key[, default])
Remove specified key from dictionary and return
corresponding value. If key is not found and default is
given returns the default, otherwise raises KeyError.
popitem(key)
Remove specified key from dictionary and return a pair
with it and the corresponding value. Returned key is a new
object.
has_key(key)
Check whether dictionary contains specified key, similar
to `key in dict`.
__new__(), __new__(iterable), __new__(dictionary), __new__(update)
You can use `vim.Dictionary()` to create new vim
dictionaries. `d=vim.Dictionary(arg)` is the same as
`d=vim.bindeval('{}');d.update(arg)`. Without arguments
constructs empty dictionary.
Examples: >
d = vim.Dictionary(food="bar") # Constructor
d['a'] = 'b' # Item assignment
print d['a'] # getting item
d.update({'c': 'd'}) # .update(dictionary)
d.update(e='f') # .update(**kwargs)
d.update((('g', 'h'), ('i', 'j'))) # .update(iterable)
for key in d.keys(): # .keys()
for val in d.values(): # .values()
for key, val in d.items(): # .items()
print isinstance(d, vim.Dictionary) # True
for key in d: # Iteration over keys
class Dict(vim.Dictionary): # Subclassing
<
Note: when iterating over keys you should not modify dictionary.
vim.List object *python-List*
Sequence-like object providing access to vim |List| type.
Supports `.locked` attribute, see |python-.locked|. Also supports the
following methods:
Method Description ~
extend(item) Add items to the list.
__new__(), __new__(iterable)
You can use `vim.List()` to create new vim lists.
`l=vim.List(iterable)` is the same as
`l=vim.bindeval('[]');l.extend(iterable)`. Without
arguments constructs empty list.
Examples: >
l = vim.List("abc") # Constructor, result: ['a', 'b', 'c']
l.extend(['abc', 'def']) # .extend() method
print l[1:] # slicing
l[:0] = ['ghi', 'jkl'] # slice assignment
print l[0] # getting item
l[0] = 'mno' # assignment
for i in l: # iteration
print isinstance(l, vim.List) # True
class List(vim.List): # Subclassing
vim.Function object *python-Function*
Function-like object, acting like vim |Funcref| object. Supports `.name`
attribute and is callable. Accepts special keyword argument `self`, see
|Dictionary-function|. You can also use `vim.Function(name)` constructor,
it is the same as `vim.bindeval('function(%s)'%json.dumps(name))`.
Examples: >
f = vim.Function('tr') # Constructor
print f('abc', 'a', 'b') # Calls tr('abc', 'a', 'b')
vim.command('''
function DictFun() dict
return self
endfunction
''')
f = vim.bindeval('function("DictFun")')
print f(self={}) # Like call('DictFun', [], {})
print isinstance(f, vim.Function) # True
==============================================================================
8. pyeval() and py3eval() Vim functions *python-pyeval*
To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
functions to evaluate Python expressions and pass their values to VimL.
==============================================================================
8. Dynamic loading *python-dynamic*
9. Dynamic loading *python-dynamic*
On MS-Windows the Python library can be loaded dynamically. The |:version|
output then includes |+python/dyn|.
@@ -515,7 +589,7 @@ Currently the name is "python24.dll". That is for Python 2.4. To know for
sure edit "gvim.exe" and search for "python\d*.dll\c".
==============================================================================
9. Python 3 *python3*
10. Python 3 *python3*
*:py3* *:python3*
The `:py3` and `:python3` commands work similar to `:python`. A simple check

View File

@@ -1,4 +1,4 @@
*indent.txt* For Vim version 7.3. Last change: 2012 Aug 30
*indent.txt* For Vim version 7.3. Last change: 2013 May 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -740,12 +740,12 @@ those useless characters first with a command like: >
:%s /\r$//g
Or, you can simply |:let| the variable PHP_removeCRwhenUnix to 1 and the
script will silently remove them when Vim loads a PHP file (at each|BufRead|).
script will silently remove them when Vim loads a PHP file (at each |BufRead|).
OPTIONS: ~
PHP indenting can be altered in several ways by modifying the values of some
variables:
global variables:
*php-comment*
To not enable auto-formating of comments by default (if you want to use your
@@ -753,10 +753,21 @@ own 'formatoptions'): >
:let g:PHP_autoformatcomment = 0
Else, 't' will be removed from the 'formatoptions' string and "qrowcb" will be
added, see|fo-table|for more information.
added, see |fo-table| for more information.
-------------
To add an extra indent to every PHP lines with N being the number of
To add extra indentation to single-line comments: >
:let g:PHP_outdentSLComments = N
With N being the number of 'shiftwidth' to add.
Only single-line comments will be affected such as: >
# Comment
// Comment
/* Comment */
-------------
To add extra indentation to every PHP lines with N being the number of
'shiftwidth' to add: >
:let g:PHP_default_indenting = N
@@ -772,7 +783,7 @@ For example, with N = 1, this will give:
$command_hist = TRUE;
?>
(Notice the extra indent between the PHP container markers and the code)
(Notice the extra indentation between the PHP container markers and the code)
-------------
To indent PHP tags as the surrounding code: >
@@ -804,8 +815,10 @@ NOTE: Indenting will be a bit slower if this option is used because some
To indent 'case:' and 'default:' statements in switch() blocks: >
:let g:PHP_vintage_case_default_indent = 1
(Since in PHP braces are not required inside 'case/default' blocks, by default they are indented at the same level than the 'switch()' to avoid
unnecessary indentation)
In PHP braces are not required inside 'case/default' blocks therefore 'case:'
and 'default:' are indented at the same level than the 'switch()' to avoid
meaningless indentation. You can use the above option to return to the
traditional way.
PYTHON *ft-python-indent*

View File

@@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.3. Last change: 2012 Oct 06
*mbyte.txt* For Vim version 7.3. Last change: 2013 May 18
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -48,9 +48,9 @@ COMPILING
If you already have a compiled Vim program, check if the |+multi_byte| feature
is included. The |:version| command can be used for this.
If +multi_byte is not included, you should compile Vim with "big" features.
You can further tune what features are included. See the INSTALL files in the
source directory.
If +multi_byte is not included, you should compile Vim with "normal", "big" or
"huge" features. You can further tune what features are included. See the
INSTALL files in the source directory.
LOCALE

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.3. Last change: 2013 Apr 27
*options.txt* For Vim version 7.3. Last change: 2013 May 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5516,6 +5516,19 @@ A jump table for the options with a short description can be found at |Q_op|.
matches will be highlighted. This is used to avoid that Vim hangs
when using a very complicated pattern.
*'regexpengine''* *'re'*
'regexpengine' 're' number (default 0)
global
{not in Vi}
This selects the default regexp engine. |two-engines|
The possible values are:
0 automatic selection
1 old engine
2 NFA engine
Note that when using the NFA engine and the pattern contains something
that is not supported the pattern will not match. This is only useful
for debugging the regexp engine.
*'relativenumber'* *'rnu'* *'norelativenumber'* *'nornu'*
'relativenumber' 'rnu' boolean (default off)
local to window

View File

@@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.3. Last change: 2013 Apr 19
*pi_netrw.txt* For Vim version 7.3. Last change: 2013 May 18
------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell
@@ -146,13 +146,13 @@ and has lines resembling >
<
Windows' ftp doesn't support .netrc; however, one may have in one's .vimrc: >
let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\Myself\MACHINE'
let g:netrw_ftp_cmd= 'c:\Windows\System32\ftp -s:C:\Users\MyUserName\MACHINE'
<
Netrw will substitute the host's machine name for MACHINE from the url it is
Netrw will substitute the host's machine name for "MACHINE" from the url it is
attempting to open, and so one may specify >
userid
password
for each site in a separate file in c:\Users\Myself\.
for each site in a separate file: c:\Users\MyUserName\MachineName.
Now about browsing -- when you just want to look around before editing a
file. For browsing on your current host, just "edit" a directory: >
@@ -321,6 +321,8 @@ CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
:call NetUserPass("uid") -- prompts for password
:call NetUserPass("uid","password") -- sets global uid and password
(Related topics: |ftp| |netrw-userpass| |netrw-start|)
NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
(Also see:
|netrw-browser-var| : netrw browser option variables
@@ -927,6 +929,7 @@ itself:
endfunction
endif
>
(Related topics: |ftp| |netrw-userpass| |netrw-start|)
==============================================================================
9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
@@ -2125,6 +2128,10 @@ your browsing preferences. (see also: |netrw-settings|)
NOTE: suppressing the banner is a new feature
which may cause problems.
*g:netrw_bannerbackslash* if this variable exists and is not zero, the
banner will be displayed with backslashes
rather than forward slashes.
*g:netrw_browse_split* when browsing, <cr> will open the file by:
=0: re-using the same window
=1: horizontally splitting the window first
@@ -2306,14 +2313,14 @@ your browsing preferences. (see also: |netrw-settings|)
Copies marked files (|netrw-mf|) to target
directory (|netrw-mt|, |netrw-mc|)
*g:netrw_localmkdir* command for making a local directory
default: "mkdir"
*g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
="move" Windows
Moves marked files (|netrw-mf|) to target
directory (|netrw-mt|, |netrw-mm|)
*g:netrw_localmkdir* command for making a local directory
default: "mkdir"
*g:netrw_localrmdir* remove directory command (rmdir)
default: "rmdir"
@@ -2416,11 +2423,6 @@ your browsing preferences. (see also: |netrw-settings|)
< into one's <.vimrc> to use one's own
preferences.
*g:netrw_ssh_cmd* One may specify an executable command
to use instead of ssh for remote actions
such as listing, file removal, etc.
default: ssh
*g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
messages, banners, and whatnot that one doesn't
want masquerading as "directories" and "files".
@@ -2428,6 +2430,11 @@ your browsing preferences. (see also: |netrw-settings|)
messages. By default its value is:
'^total\s\+\d\+$'
*g:netrw_ssh_cmd* One may specify an executable command
to use instead of ssh for remote actions
such as listing, file removal, etc.
default: ssh
*g:netrw_tmpfile_escape* =' &;'
escape() is applied to all temporary files
@@ -2990,6 +2997,19 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
12. History *netrw-history* {{{1
v149: Apr 18, 2013 * in wide listing format, now have maps for
w and b to move to next/previous file
Apr 26, 2013 * one may now copy files in the same
directory; netrw will issue requests for
what names the files should be copied under
Apr 29, 2013 * Trying Benzinger's problem again. Seems
that commenting out the BufEnter and
installing VimEnter (only) works. Weird
problem! (tree listing, vim -O Dir1 Dir2)
May 01, 2013 * :Explore ftp://... wasn't working. Fixed.
May 02, 2013 * introduced |g:netrw_bannerbackslash| as
requested by Paul Domaskis.
May 18, 2013 * More fixes for windows (not cygwin)
v148: Apr 16, 2013 * changed Netrw's Style menu to allow direct
choice of listing style, hiding style, and
sorting style

View File

@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 7.3. Last change: 2013 Apr 05
*quickref.txt* For Vim version 7.3. Last change: 2013 May 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -824,6 +824,7 @@ Short explanation of each option: *option-list*
'quoteescape' 'qe' escape characters used in a string
'readonly' 'ro' disallow writing the buffer
'redrawtime' 'rdt' timeout for 'hlsearch' and |:match| highlighting
'regexpengine' 're' default regexp engine to use
'relativenumber' 'rnu' show relative line number in front of each line
'remap' allow mappings to work recursively
'report' threshold for reporting nr. of lines changed

View File

@@ -1,4 +1,4 @@
*starting.txt* For Vim version 7.3. Last change: 2012 Mar 16
*starting.txt* For Vim version 7.3. Last change: 2013 May 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -438,6 +438,8 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
option should be used when Vim is started by a program that
will wait for the edit session to finish (e.g., mail or
readnews). See |amiga-window|.
MS-Windows: This option is not always supported.
{not in Vi}

View File

@@ -4261,7 +4261,6 @@ E858 eval.txt /*E858*
E859 eval.txt /*E859*
E86 windows.txt /*E86*
E860 eval.txt /*E860*
E861 eval.txt /*E861*
E862 eval.txt /*E862*
E863 if_pyth.txt /*E863*
E864 pattern.txt /*E864*
@@ -5903,6 +5902,7 @@ g:html_whole_filler syntax.txt /*g:html_whole_filler*
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
g:netrw_banner pi_netrw.txt /*g:netrw_banner*
g:netrw_bannerbackslash pi_netrw.txt /*g:netrw_bannerbackslash*
g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split*
g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer*
g:netrw_bufsettings pi_netrw.txt /*g:netrw_bufsettings*

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.3. Last change: 2013 May 17
*todo.txt* For Vim version 7.3. Last change: 2013 May 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -34,8 +34,18 @@ not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Rename src/Makefile and create a new one like toplevel Makefile that creates
auto/config.mk when it's not there? (Ben Schmidt, 2011 Feb 11)
--- Python interface
Python: thread with refactoring patches. (ZyX, May 19, 16:46 and later)
9
10
11
Configure doesn't find Python 3 on Ubuntu 13.04. (Ken Takata, Apr 13)
Python SystemExit exception is not handled properly. Patch to catch the
exception and give an error. (Yasuhiro Matsumoto)
Does not work, tests fail.
@@ -45,9 +55,10 @@ Patch to print the result of a :python command. (Maxim Philippov
Patch no longer applies.
":python os.chdir('/tmp')" makes short buffer names invalid. (Xavier de Gaye)
Check directory and call shorten_fnames()? Better: make os.chdir()
invoke the interal :cd implementation, that takes care of all side
effects.
Patch to make os.chdir() handle side effects. (Xavier de Gaye, 2013 May 17)
Update May 19, also for os.fchdir().
Adds a $VIMRUNTIME/python directory.
ZyX: OK to add python and python3 directory.
Mac: OS/X 10.4 with Python 2.5 installed: configure finds an extra argument
that breaks the build. (Brian Victor, 2008 Sep 1)
@@ -65,34 +76,74 @@ Vim script. Requires converting the arguments and return value.
--- runtime files
Syntax file for protocol buffers. (Feng Xiao, 2013 May 9)
Has an ugly copyright notice. No conflict with Vim license?
Has an ugly copyright notice.
Add statement that it does not conflict with Vim license.
Patch for JavaScript syntax. (Kevin Locke, 2013 May 9)
Claudio didn't respond yet.
--- Fast regexp engine
Including NFA regexp code. Latest version probably is:
https://code.google.com/p/vim-soc2008-regexp/source/browse/trunk/vim72-re/src/regexp_nfa.c
Patch updated by Ken Takata. (May 13)
Duplicate condition in line 1094. (Ken Takata) Should be 'r'?
To be able to run tests:
- set defaultre=old / nfa / auto
- In pattern use "\%#= to set the engine: 0 = automatic, 1 = old 2 = nfa
Multi-byte problem? Marc Weber
echo matchlist('1', '\%#=1\o{\?Ä\Z')
echo matchlist('1', '\%#=2\o{\?Ä\Z')
Difference in matching this pattern: (Marc Weber)
echo matchlist("t", '\%#=1ú\Z')
echo matchlist("t", '\%#=2ú\Z')
Difference in matching this pattern:
echo matchlist('google', '\%#=1\<go*\|go')
echo matchlist('google', '\%#=2\<go*\|go')
Difference in matching this pattern: (Marc Weber)
echo matchlist("\na", '\%#=1\_F')
echo matchlist("\na", '\%#=0\_F')
echo matchlist("\na", '\%#=2\_F')
Don't set curbuf, use reg_buf.
Estimation of number of items is wrong, can be much larger.
When running out of space, retry with more space?
nfa_regcomp() should not use nstate_max but the actual number of states for
allocating the prog?
Get example files for many languages. Compare syntax highlighting with old and
new regexp, find regexp constructs where NFA does not work correctly.
Idea for comparing output: use format.vim (ZyX, 2013 May 12)
MakeSynChk from Charles Campbell. (May 14)
source ~/vim/regexp/runold.vim to update the "old" files.
source ~/vim/regexp/runnew.vim to update the "new" files
source ~/vim/regexp/diff.vim to find differences
Diffs in these files:
- csh02: line 2, "13" is not highlighted after -misc-fixed-bold-r-normal-
as cshNumber
- csh02: line 7, similar problem.
- tst28.tex line 8 \alpha in texStatement instead of texGreek
It's very slow compared to the old engine...
Performance tests:
- ~/vim/test/veryslow.js (file from Daniel Fetchinson)
- ~/vim/test/veryslow.js display last line (file from Daniel Fetchinson)
- ~/vim/test/slowsearch
- ~/vim/test/rgb.vim
- ~/vim/text/FeiqCfg.xml (file from Netjune)
- ~/vim/text/edl.svg (also XML)
- search for a.*e*exn in the vim executable. Go to last line to use
'hlsearch'.
- Slow combination of folding and PHP syntax highlighting. Script to
reproduce it. Caused by "syntax sync fromstart" in combination with patch
7.2.274. (Christian Brabandt, 2010 May 27) Generally, folding with
'foldmethod' set to "syntax" is slow. Do profiling to find out why.
- Does not use any of the optimizations, such as required start pattern.
- When lists are empty in nfa_regmatch() and match is true, it keeps looping
without doing anything.
"\ze" is currently disabled for NFA, can this be fixed?
"\_[0-9]\?\>" does not match at end of line, disabled.
Items with \%u, \%x, \%o, \%d do not work with the new engine.
--- bug fixes
@@ -145,6 +196,12 @@ Patch by Christian Brabandt, Feb 16.
'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt,
2012 Apr 2.
When someone does a silly thing such as setting rows and columns to 65535,
handle the out-of-memory and set them to sane values? (jimmywang, 2013 May 17)
InsertEnter doesn't prevent the cursor from moving when it goes to another
line.
--- slightly incompatible changes
Patch to load ~/.vim/vimrc when ~/.vimrc isn't found. (Lech Lorens, 2013 Apr
@@ -203,9 +260,11 @@ Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May
5)
Patch to add the bufferlist() function. (Yegappan Lakshmanan, 2013 May 5)
May 17: with winlist() and tabpagelist().
May 19: with local variables.
Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 11)
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
28) With tests: Oct 9.
@@ -779,12 +838,6 @@ Problem with stop directory in findfile(). (Adam Simpkins, 2009 Aug 26)
Using ']' as the end of a range in a pattern requires double escaping:
/[@-\\]] (Andy Wokula, 2011 Jun 28)
Slow combination of folding and PHP syntax highlighting. Script to reproduce
it. Caused by "syntax sync fromstart" in combination with patch 7.2.274.
(Christian Brabandt, 2010 May 27)
Generally, folding with 'foldmethod' set to "syntax" is slow. Do profiling to
find out why.
Syntax priority problem. (Charles Campbell, 2011 Sep 15)
When completion inserts the first match, it may trigger the line to be folded.
@@ -1737,10 +1790,8 @@ Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler,
2010 Jun 30)
At next release 7.4:
At next release:
- Build a huge version by default.
- Rename src/Makefile and create a new one like toplevel Makefile that
creates auto/config.mk when it's not there? (Ben Schmidt, 2011 Feb 11)
- Improve plugin handling: Automatic updates, handle dependencies?
E.g. Vundle: https://github.com/gmarik/vundle

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 7.3. Last change: 2012 Dec 06
*various.txt* For Vim version 7.3. Last change: 2013 May 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -368,7 +368,7 @@ N *+mouse_sysmouse* Unix only: *BSD console mouse handling |sysmouse|
B *+mouse_sgr* Unix only: sgr mouse handling |sgr-mouse|
B *+mouse_urxvt* Unix only: urxvt mouse handling |urxvt-mouse|
N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse|
B *+multi_byte* 16 and 32 bit characters |multibyte|
N *+multi_byte* 16 and 32 bit characters |multibyte|
*+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
N *+multi_lang* non-English language support |multi-lang|
m *+mzscheme* Mzscheme interface |mzscheme|

View File

@@ -2,21 +2,23 @@
" Language: PHP
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
" Last Change: 2010 Jully 26th
" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
" Version: 1.33
" Home: https://github.com/2072/PHP-Indenting-for-VIm
" Last Change: 2013 May 10th
" Version: 1.37
"
"
" If you find a bug, please report it on GitHub:
" http://github.com/2072/PHP-Indenting-for-VIm/issues
" with an example of code that breaks the algorithm.
" Type :help php-indent for available options
"
" A fully commented version of this file is available on github
"
"
" Thanks a lot for using this script.
"
" If you find a bug, please open a ticket on github.org
" ( https://github.com/2072/PHP-Indenting-for-VIm/issues ) with an example of
" code that breaks the algorithm.
"
" NOTE: This script must be used with PHP syntax ON and with the php syntax
" script by Lutz Eymers (http://www.ipdienste.net/data/php.vim ) or with the
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the
" script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 )
" the later is bunbdled by default with Vim 7.
"
@@ -26,7 +28,7 @@
" script will automatically put HereDoc end identifiers at col 1 if
" they are followed by a ';').
"
"
" NOTE: If you are editing files in Unix file format and that (by accident)
" there are '\r' before new lines, this script won't be able to proceed
" correctly and will make many mistakes because it won't be able to match
@@ -38,8 +40,6 @@
" or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will
" silently remove them when VIM load this script (at each bufread).
"
" Options: See :help php-indent for available options.
if exists("b:did_indent")
finish
@@ -50,12 +50,19 @@ let b:did_indent = 1
let php_sync_method = 0
if exists("PHP_default_indenting")
let b:PHP_default_indenting = PHP_default_indenting * &sw
else
let b:PHP_default_indenting = 0
endif
if exists("PHP_outdentSLComments")
let b:PHP_outdentSLComments = PHP_outdentSLComments * &sw
else
let b:PHP_outdentSLComments = 0
endif
if exists("PHP_BracesAtCodeLevel")
let b:PHP_BracesAtCodeLevel = PHP_BracesAtCodeLevel
else
@@ -116,13 +123,20 @@ endif
if exists("*GetPhpIndent")
call ResetPhpOptions()
finish
finish " XXX -- comment this line for easy dev
endif
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
function! DebugPrintReturn(scriptLine)
echo "debug:" . a:scriptLine
call getchar()
endfunction
function! GetLastRealCodeLNum(startline) " {{{
let lnum = a:startline
@@ -189,8 +203,6 @@ function! GetLastRealCodeLNum(startline) " {{{
let b:InPHPcode_and_script = 0
endif
return lnum
endfunction " }}}
@@ -198,11 +210,11 @@ function! Skippmatch2()
let line = getline(".")
if line =~ '\%(".*\)\@<=/\*\%(.*"\)\@=' || line =~ '\%(\%(//\|#\).*\)\@<=/\*'
return 1
else
return 0
endif
if line =~ "\\([\"']\\).*/\\*.*\\1" || line =~ '\%(//\|#\).*/\*'
return 1
else
return 0
endif
endfun
function! Skippmatch() " {{{
@@ -314,7 +326,7 @@ function! IslinePHP (lnum, tofind) " {{{
endif
endfunction " }}}
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|else\)'
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\)'
let s:autoresetoptions = 0
@@ -361,14 +373,12 @@ function! GetPhpIndent()
if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast
if b:PHP_indentbeforelast
let b:PHP_indentinghuge = 1
echom 'Large indenting detected, speed optimizations engaged (v1.33)'
endif
let b:PHP_indentbeforelast = b:PHP_lastindented
endif
if b:InPHPcode_checked && prevnonblank(v:lnum - 1) != b:PHP_lastindented
if b:PHP_indentinghuge
echom 'Large indenting deactivated'
let b:PHP_indentinghuge = 0
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
endif
@@ -425,7 +435,7 @@ function! GetPhpIndent()
else
let b:InPHPcode = 0
let b:UserIsTypingComment = 0
let b:InPHPcode_tofind = '<?\%(.*?>\)\@!\|<script.*>'
let b:InPHPcode_tofind = s:PHP_startindenttag
endif
endif "!b:InPHPcode_checked }}}
@@ -493,7 +503,9 @@ function! GetPhpIndent()
endif
" Indent successive // or # comment the same way the first is {{{
let addSpecial = 0
if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
let addSpecial = b:PHP_outdentSLComments
if b:PHP_LastIndentedWasComment == 1
return indent(real_PHP_lastindented)
endif
@@ -550,7 +562,7 @@ function! GetPhpIndent()
endif
if lnum == 0
return b:PHP_default_indenting
return b:PHP_default_indenting + addSpecial
endif
@@ -577,17 +589,17 @@ function! GetPhpIndent()
endif
if last_line =~ '[;}]'.endline && last_line !~ '^)' && last_line !~# s:defaultORcase
if last_line =~ '[;}]'.endline && last_line !~ '^[)\]]' && last_line !~# s:defaultORcase
if ind==b:PHP_default_indenting
return b:PHP_default_indenting
return b:PHP_default_indenting + addSpecial
elseif b:PHP_indentinghuge && ind==b:PHP_CurrentIndentLevel && cline !~# '^\s*\%(else\|\%(case\|default\).*:\|[})];\=\)' && last_line !~# '^\s*\%(\%(}\s*\)\=else\)' && getline(GetLastRealCodeLNum(lnum - 1))=~';'.endline
return b:PHP_CurrentIndentLevel
return b:PHP_CurrentIndentLevel + addSpecial
endif
endif
let LastLineClosed = 0
let terminated = '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline
let terminated = '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.endline
let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
@@ -618,19 +630,23 @@ function! GetPhpIndent()
endwhile
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
let ind = ind + &sw
return ind
let ind = ind + &sw " we indent one level further when the preceding line is not stated
return ind + addSpecial
elseif (ind != b:PHP_default_indenting || last_line =~ '^)' ) && last_line =~ terminated
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated " Added || last_line =~ '^)' on 2007-12-30 (array indenting problem broke other things)
let previous_line = last_line
let last_line_num = lnum
let LastLineClosed = 1
while 1
if previous_line =~ '^\s*}'
let last_line_num = FindOpenBracket(last_line_num)
if previous_line =~ '^\s*}\|;\s*}'.endline " XXX
if getline(last_line_num) =~ '^\s*{'
call cursor(last_line_num, 1)
call search('}\|;\s*}'.endline, 'W')
let oldLastLine = last_line_num
let last_line_num = searchpair('{', '', '}', 'bW', 'Skippmatch()')
if oldLastLine == last_line_num || getline(last_line_num) =~ '^\s*{'
let last_line_num = GetLastRealCodeLNum(last_line_num - 1)
endif
@@ -674,7 +690,7 @@ function! GetPhpIndent()
let ind = indent(last_match)
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
return ind
return ind + addSpecial
endif
endif
@@ -693,7 +709,7 @@ function! GetPhpIndent()
if !LastLineClosed
if last_line =~# '[{(]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline
if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{'
let ind = ind + &sw
@@ -702,7 +718,7 @@ function! GetPhpIndent()
if b:PHP_BracesAtCodeLevel || b:PHP_vintage_case_default_indent == 1
let b:PHP_CurrentIndentLevel = ind
return ind
return ind + addSpecial
endif
elseif last_line =~ '\S\+\s*),'.endline
@@ -712,22 +728,21 @@ function! GetPhpIndent()
if openedparent != lnum
let ind = indent(openedparent)
endif
elseif last_line =~ '^\s*'.s:blockstart
let ind = ind + &sw
elseif AntepenultimateLine =~ '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . s:defaultORcase
elseif AntepenultimateLine =~ '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . s:defaultORcase
let ind = ind + &sw
endif
endif
if cline =~ '^\s*);\='
if cline =~ '^\s*[)\]];\='
let ind = ind - &sw
endif
let b:PHP_CurrentIndentLevel = ind
return ind
return ind + addSpecial
endfunction

View File

@@ -2,9 +2,9 @@
"
" Menu Translations: Japanese (EUC-JP)
" Translated By: MURAOKA Taro <koron.kaoriya@gmail.com>
" Last Change: 24-Feb-2013.
" Last Change: 12-May-2013.
"
" Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com>
" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
" Quit when menu translations have already been done.
@@ -299,50 +299,6 @@ menutrans Co&lor\ test
menutrans &Highlight\ test <09>ϥ<EFBFBD><EFBFBD><EFBFBD>ȥƥ<EFBFBD><EFBFBD><EFBFBD>(&H)
menutrans &Convert\ to\ HTML HTML<EFBFBD>إ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD>(&C)
" Japanese specific menu
" <20><><EFBFBD>ݤ<EFBFBD>iconv<6E><76><EFBFBD>衢ɬ<E8A1A2><C9AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA4B7><EFBFBD><EFBFBD><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɤˤʤ<CBA4><CAA4><EFBFBD>ǤϤʤ<CFA4><CAA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>
if has('iconv')
" iconv<6E>ΥС<CEA5><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD>
let s:support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0
" <20>ɤ߹<C9A4><DFB9><EFBFBD>
an 10.395 &File.-SEPICONV- <Nop>
an 10.396.100.100 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD><EFBFBD>(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR>
if !s:support_jisx0213
an 10.396.100.110 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD><EFBFBD>(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR>
an 10.396.100.120 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD><EFBFBD>(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR>
else
an 10.396.100.110 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD><EFBFBD>(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR>
an 10.396.100.120 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD><EFBFBD>(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR>
endif
an 10.396.100.130 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD><EFBFBD>(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR>
" <20><><EFBFBD>ɹ<EFBFBD>
an 10.396.110.100 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD>ɹ<EFBFBD>(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR>
if !s:support_jisx0213
an 10.396.110.110 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD>ɹ<EFBFBD>(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR>
an 10.396.110.120 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD>ɹ<EFBFBD>(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR>
else
an 10.396.110.110 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD>ɹ<EFBFBD>(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR>
an 10.396.110.120 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD>ɹ<EFBFBD>(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR>
endif
an 10.396.110.130 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><><EFBFBD>ɹ<EFBFBD>(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR>
" <20><>¸
an 10.396.115 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..-SEP1- <Nop>
an 10.396.120.100 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><>¸(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR>
if !s:support_jisx0213
an 10.396.120.110 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><>¸(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR>
an 10.396.120.120 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><>¸(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR>
else
an 10.396.120.110 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><>¸(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR>
an 10.396.120.120 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><>¸(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR>
endif
an 10.396.120.130 &File.<2E><><EFBFBD>󥳡<EFBFBD><F3A5B3A1>ɻ<EFBFBD><EFBFBD><EFBFBD>(&E)\.\.\..<2E><>¸(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR>
unlet s:support_jisx0213
endif
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -2,9 +2,9 @@
"
" Menu Translations: Japanese (UTF-8)
" Translated By: MURAOKA Taro <koron.kaoriya@gmail.com>
" Last Change: 24-Feb-2013.
" Last Change: 12-May-2013.
"
" Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com>
" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
" Quit when menu translations have already been done.
@@ -299,50 +299,6 @@ menutrans Co&lor\ test カラーテスト(&L)
menutrans &Highlight\ test ハイライトテスト(&H)
menutrans &Convert\ to\ HTML HTMLへコンバート(&C)
" Japanese specific menu
" 成否はiconv次第、必ずしも指定したエンコードになるわけではないことに注意
if has('iconv')
" iconvのバージョン判定
let s:support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0
" 読み込み
an 10.395 &File.-SEPICONV- <Nop>
an 10.396.100.100 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR>
if !s:support_jisx0213
an 10.396.100.110 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR>
an 10.396.100.120 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR>
else
an 10.396.100.110 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR>
an 10.396.100.120 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR>
endif
an 10.396.100.130 &File.エンコード指定(&E)\.\.\..開く(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR>
" 再読込
an 10.396.110.100 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR>
if !s:support_jisx0213
an 10.396.110.110 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR>
an 10.396.110.120 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR>
else
an 10.396.110.110 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR>
an 10.396.110.120 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR>
endif
an 10.396.110.130 &File.エンコード指定(&E)\.\.\..再読込(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR>
" 保存
an 10.396.115 &File.エンコード指定(&E)\.\.\..-SEP1- <Nop>
an 10.396.120.100 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR>
if !s:support_jisx0213
an 10.396.120.110 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR>
an 10.396.120.120 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR>
else
an 10.396.120.110 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR>
an 10.396.120.120 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR>
endif
an 10.396.120.130 &File.エンコード指定(&E)\.\.\..保存(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR>
unlet s:support_jisx0213
endif
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -2,9 +2,9 @@
"
" Menu Translations: Japanese (CP932)
" Translated By: MURAOKA Taro <koron.kaoriya@gmail.com>
" Last Change: 24-Feb-2013.
" Last Change: 12-May-2013.
"
" Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com>
" Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
" THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
" Quit when menu translations have already been done.
@@ -299,50 +299,6 @@ menutrans Co&lor\ test
menutrans &Highlight\ test <09>n<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>C<EFBFBD>g<EFBFBD>e<EFBFBD>X<EFBFBD>g(&H)
menutrans &Convert\ to\ HTML HTML<EFBFBD>փR<EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>[<5B>g(&C)
" Japanese specific menu
" <20><><EFBFBD>ۂ<EFBFBD>iconv<6E><76><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>K<EFBFBD><4B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>w<EFBFBD><EFBFBD><E882B5><EFBFBD>G<EFBFBD><47><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>ɂȂ<C982><C882><EFBFBD>ł͂Ȃ<CD82><C882><EFBFBD><EFBFBD>Ƃɒ<C682><C992><EFBFBD>
if has('iconv')
" iconv<6E>̃o<CC83>[<5B>W<EFBFBD><57><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
let s:support_jisx0213 = (iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb") ? 1 : 0
" <20>ǂݍ<C782><DD8D><EFBFBD>
an 10.395 &File.-SEPICONV- <Nop>
an 10.396.100.100 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>J<EFBFBD><EFBFBD>(&O)\.\.\..SJIS(&S)<Tab>fenc=cp932 :browse confirm e ++enc=cp932<CR>
if !s:support_jisx0213
an 10.396.100.110 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>J<EFBFBD><EFBFBD>(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jp :browse confirm e ++enc=euc-jp<CR>
an 10.396.100.120 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>J<EFBFBD><EFBFBD>(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :browse confirm e ++enc=iso-2022-jp<CR>
else
an 10.396.100.110 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>J<EFBFBD><EFBFBD>(&O)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :browse confirm e ++enc=euc-jisx0213<CR>
an 10.396.100.120 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>J<EFBFBD><EFBFBD>(&O)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :browse confirm e ++enc=iso-2022-jp-3<CR>
endif
an 10.396.100.130 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>J<EFBFBD><EFBFBD>(&O)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :browse confirm e ++enc=utf-8<CR>
" <20>ēǍ<C493>
an 10.396.110.100 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ēǍ<EFBFBD>(&R)\.\.\..SJIS(&S)<Tab>fenc=cp932 :e ++enc=cp932<CR>
if !s:support_jisx0213
an 10.396.110.110 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ēǍ<EFBFBD>(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jp :e ++enc=euc-jp<CR>
an 10.396.110.120 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ēǍ<EFBFBD>(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :e ++enc=iso-2022-jp<CR>
else
an 10.396.110.110 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ēǍ<EFBFBD>(&R)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :e ++enc=euc-jisx0213<CR>
an 10.396.110.120 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ēǍ<EFBFBD>(&R)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :e ++enc=iso-2022-jp-3<CR>
endif
an 10.396.110.130 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ēǍ<EFBFBD>(&R)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :e ++enc=utf-8<CR>
" <20>ۑ<EFBFBD>
an 10.396.115 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..-SEP1- <Nop>
an 10.396.120.100 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ۑ<EFBFBD>(&S)\.\.\..SJIS(&S)<Tab>fenc=cp932 :set fenc=cp932 \| w<CR>
if !s:support_jisx0213
an 10.396.120.110 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ۑ<EFBFBD>(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jp :set fenc=euc-jp \| w<CR>
an 10.396.120.120 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ۑ<EFBFBD>(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp :set fenc=iso-2022-jp \| w<CR>
else
an 10.396.120.110 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ۑ<EFBFBD>(&S)\.\.\..EUC(&E)<Tab>fenc=euc-jisx0213 :set fenc=euc-jisx0213 \| w<CR>
an 10.396.120.120 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ۑ<EFBFBD>(&S)\.\.\..JIS(&J)<Tab>fenc=iso-2022-jp-3 :set fenc=iso-2022-jp-3 \| w<CR>
endif
an 10.396.120.130 &File.<2E>G<EFBFBD><EFBFBD><EFBFBD>R<EFBFBD>[<5B>h<EFBFBD>w<EFBFBD><EFBFBD>(&E)\.\.\..<2E>ۑ<EFBFBD>(&S)\.\.\..UTF-8(&8)<Tab>fenc=utf-8 :set fenc=utf-8 \| w<CR>
unlet s:support_jisx0213
endif
let &cpo = s:keepcpo
unlet s:keepcpo

View File

@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2013 Apr 05
" Last Change: 2013 May 20
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
@@ -258,6 +258,8 @@ call append("$", "incsearch\tshow match for partly typed search command")
call <SID>BinOptionG("is", &is)
call append("$", "magic\tchange the way backslashes are used in search patterns")
call <SID>BinOptionG("magic", &magic)
call append("$", "regexpengine\tselect the default regexp engine used")
call <SID>OptionG("re", &re)
call append("$", "ignorecase\tignore case when using a search pattern")
call <SID>BinOptionG("ic", &ic)
call append("$", "smartcase\toverride 'ignorecase' when pattern has upper case characters")

View File

@@ -1,6 +1,6 @@
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
" PLUGIN SECTION
" Date: Dec 06, 2012
" Date: Apr 30, 2013
" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
@@ -20,13 +20,15 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
let g:loaded_netrwPlugin = "v148"
"DechoTabOn
let g:loaded_netrwPlugin = "v149"
if v:version < 702
echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None
finish
endif
let s:keepcpo = &cpo
set cpo&vim
"DechoTabOn
" ---------------------------------------------------------------------
" Public Interface: {{{1
@@ -34,9 +36,7 @@ set cpo&vim
" Local Browsing: {{{2
augroup FileExplorer
au!
" au BufReadCmd *[/\\] sil! call s:LocalBrowse(expand("<amatch>"))
" au BufEnter *[^/\\] sil! call s:LocalBrowse(expand("<amatch>"))
" au VimEnter *[^/\\] sil! call s:VimEnter(expand("<amatch>"))
" SEE Benzinger problem...
au BufEnter * sil! call s:LocalBrowse(expand("<amatch>"))
au VimEnter * sil! call s:VimEnter(expand("<amatch>"))
if has("win32") || has("win95") || has("win64") || has("win16")
@@ -47,7 +47,7 @@ augroup END
" Network Browsing Reading Writing: {{{2
augroup Network
au!
au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
@@ -92,27 +92,37 @@ fun! s:LocalBrowse(dirname)
" unfortunate interaction -- debugging calls can't be used here;
" the BufEnter event causes triggering when attempts to write to
" the DBG buffer are made.
if !exists("s:vimentered")
return
endif
" call Decho("s:LocalBrowse(dirname<".a:dirname.">){")
" echomsg "dirname<".a:dirname.">"
if has("amiga")
" The check against '' is made for the Amiga, where the empty
" string is the current directory and not checking would break
" things such as the help command.
" call Decho("(LocalBrowse) dirname<".a:dirname."> (amiga)")
if a:dirname != '' && isdirectory(a:dirname)
sil! call netrw#LocalBrowseCheck(a:dirname)
endif
elseif isdirectory(a:dirname)
" echomsg "dirname<".dirname."> isdir"
" call Decho("(LocalBrowse) dirname<".a:dirname."> (not amiga)")
sil! call netrw#LocalBrowseCheck(a:dirname)
endif
" not a directory, ignore it
" call Decho("|return s:LocalBrowse }")
endfun
" ---------------------------------------------------------------------
" s:VimEnter: {{{2
fun! s:VimEnter(dirname)
let curwin= winnr()
" call Decho("VimEnter(dirname<".a:dirname.">){")
let curwin = winnr()
let s:vimentered = 1
windo if a:dirname != expand("%")|call s:LocalBrowse(expand("%:p"))|endif
exe curwin."wincmd w"
" call Decho("|return VimEnter }")
endfun
" ---------------------------------------------------------------------

View File

@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2012 Dec 31
" Last Change: 2013 May 05
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim
" Standard syntax initialization
@@ -38,7 +38,7 @@ syn match debcontrolDmUpload contained "\cyes"
syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
syn match debcontrolVcsCvs contained "\v%(\-d *)?:pserver:[^@]+\@[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?:/[^[:space:]]*%( [^[:space:]]+)?$"
syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?%(\s+-b\s+[^ ~^:?*[\\]+)?$"
" An email address
syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"

View File

@@ -1,9 +1,9 @@
" Vim syntax file
" Language: fstab file
" Maintaner: Radu Dineiu <radu.dineiu@gmail.com>
" URL: http://ld.yi.org/vim/fstab.vim
" Last Change: 2009 Feb 04
" Version: 0.93
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
" URL: https://raw.github.com/rid9/vim-fstab/master/fstab.vim
" Last Change: 2013 May 21
" Version: 1.0
"
" Credits:
" David Necas (Yeti) <yeti@physics.muni.cz>
@@ -11,10 +11,13 @@
" Georgi Georgiev <chutz@gg3.net>
" James Vega <jamessan@debian.org>
" Elias Probst <mail@eliasprobst.eu>
"
" Options:
" let fstab_unknown_fs_errors = 1
" highlight unknown filesystems as errors
"
" let fstab_unknown_device_errors = 0
" do not highlight unknown devices as errors
if version < 600
syntax clear
@@ -22,15 +25,18 @@ elseif exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" General
syn cluster fsGeneralCluster contains=fsComment
syn match fsComment /\s*#.*/
syn match fsComment /\s*#.*/ contains=@Spell
syn match fsOperator /[,=:#]/
" Device
syn cluster fsDeviceCluster contains=fsOperator,fsDeviceKeyword,fsDeviceError
syn match fsDeviceError /\%([^a-zA-Z0-9_\/#@:\.-]\|^\w\{-}\ze\W\)/ contained
syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts sysfs usbfs
syn keyword fsDeviceKeyword contained none proc linproc tmpfs devpts devtmpfs sysfs usbfs
syn keyword fsDeviceKeyword contained LABEL nextgroup=fsDeviceLabel
syn keyword fsDeviceKeyword contained UUID nextgroup=fsDeviceUUID
syn keyword fsDeviceKeyword contained sshfs nextgroup=fsDeviceSshfs
@@ -47,7 +53,7 @@ syn keyword fsMountPointKeyword contained none swap
" Type
syn cluster fsTypeCluster contains=fsTypeKeyword,fsTypeUnknown
syn match fsTypeUnknown /\s\+\zs\w\+/ contained
syn keyword fsTypeKeyword contained adfs ados affs atfs audiofs auto autofs befs bfs cd9660 cfs cifs coda cramfs devfs devpts e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse hfs hpfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix msdos ncpfs nfs none ntfs null nwfs overlay ovlfs portal proc procfs ptyfs qnx4 reiserfs romfs shm smbfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xfs zisofs
syn keyword fsTypeKeyword contained adfs ados affs anon_inodefs atfs audiofs auto autofs bdev befs bfs btrfs binfmt_misc cd9660 cfs cgroup cifs coda configfs cpuset cramfs devfs devpts devtmpfs e2compr efs ext2 ext2fs ext3 ext4 fdesc ffs filecore fuse fuseblk fusectl hfs hpfs hugetlbfs iso9660 jffs jffs2 jfs kernfs lfs linprocfs mfs minix mqueue msdos ncpfs nfs nfsd nilfs2 none ntfs null nwfs overlay ovlfs pipefs portal proc procfs pstore ptyfs qnx4 reiserfs ramfs romfs securityfs shm smbfs squashfs sockfs sshfs std subfs swap sysfs sysv tcfs tmpfs udf ufs umap umsdos union usbfs userfs vfat vs3fs vxfs wrapfs wvfs xenfs xfs zisofs
" Options
" -------
@@ -71,6 +77,11 @@ syn match fsOptionsKeywords contained /\<\%(prefix\|volume\|root\)=/ nextgroup=f
syn match fsOptionsKeywords contained /\<bs=/ nextgroup=fsOptionsSize
syn keyword fsOptionsKeywords contained protect usemp verbose
" Options: btrfs
syn match fsOptionsKeywords contained /\<\%(subvol\|subvolid\|subvolrootid\|device\|compress\|compress-force\|fatal_errors\)=/ nextgroup=fsOptionsString
syn match fsOptionsKeywords contained /\<\%(max_inline\|alloc_start\|thread_pool\|metadata_ratio\|check_int_print_mask\)=/ nextgroup=fsOptionsNumber
syn keyword fsOptionsKeywords contained degraded nodatasum nodatacow nobarrier ssd ssd_spread noacl notreelog flushoncommit space_cache nospace_cache clear_cache user_subvol_rm_allowed autodefrag inode_cache enospc_debug recovery check_int check_int_data skip_balance discard
" Options: cd9660
syn keyword fsOptionsKeywords contained extatt gens norrip nostrictjoilet
@@ -84,7 +95,7 @@ syn match fsOptionsKeywords contained /\<\%(res[gu]id\|sb\)=/ nextgroup=fsOption
syn keyword fsOptionsExt2Check contained none normal strict
syn keyword fsOptionsExt2Errors contained continue panic
syn match fsOptionsExt2Errors contained /\<remount-ro\>/
syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf noacl nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr
syn keyword fsOptionsKeywords contained acl bsddf minixdf debug grpid bsdgroups minixdf nocheck nogrpid oldalloc orlov sysvgroups nouid32 nobh user_xattr nouser_xattr
" Options: ext3
syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt3Journal
@@ -92,7 +103,7 @@ syn match fsOptionsKeywords contained /\<data=/ nextgroup=fsOptionsExt3Data
syn match fsOptionsKeywords contained /\<commit=/ nextgroup=fsOptionsNumber
syn keyword fsOptionsExt3Journal contained update inum
syn keyword fsOptionsExt3Data contained journal ordered writeback
syn keyword fsOptionsKeywords contained noload user_xattr nouser_xattr acl noacl
syn keyword fsOptionsKeywords contained noload user_xattr nouser_xattr acl
" Options: ext4
syn match fsOptionsKeywords contained /\<journal=/ nextgroup=fsOptionsExt4Journal
@@ -216,7 +227,7 @@ syn match fsOptions /\s\+.\{-}\s/me=e-1 nextgroup=fsFreqPass contains=@fsOptions
syn match fsFreqPass /\s\+.\{-}$/ contains=@fsFreqPassCluster,@fsGeneralCluster contained
" Whole line comments
syn match fsCommentLine /^#.*$/
syn match fsCommentLine /^#.*$/ contains=@Spell
if version >= 508 || !exists("did_config_syntax_inits")
if version < 508
@@ -241,7 +252,10 @@ if version >= 508 || !exists("did_config_syntax_inits")
HiLink fsTypeUnknown Error
endif
HiLink fsDeviceError Error
if !exists('fstab_unknown_device_errors') || fstab_unknown_device_errors == 1
HiLink fsDeviceError Error
endif
HiLink fsMountPointError Error
HiLink fsMountPointKeyword Keyword
HiLink fsFreqPassError Error
@@ -277,4 +291,7 @@ endif
let b:current_syntax = "fstab"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8 ft=vim

View File

@@ -102,12 +102,11 @@ syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
syn match rOperator "&"
syn match rOperator '-'
syn match rOperator '*'
syn match rOperator '\*'
syn match rOperator '+'
syn match rOperator '='
syn match rOperator "[|!<>^~`/:@]"
syn match rOperator "%\{2}\|%\*%\|%\/%\|%in%\|%o%\|%x%"
syn match rOpError '*\{3}'
syn match rOpError '//'
syn match rOpError '&&&'
syn match rOpError '|||'

View File

@@ -1,10 +1,13 @@
" Vim syntax file
" Language: resolver configuration file
" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
" Original Maintaner: Radu Dineiu <littledragon@altern.org>
" License: This file can be redistributed and/or modified under the same terms
" as Vim itself.
" Last Change: 2012-05-24
" Maintainer: Radu Dineiu <radu.dineiu@gmail.com>
" URL: https://raw.github.com/rid9/vim-resolv/master/resolv.vim
" Last Change: 2013 May 21
" Version: 1.0
"
" Credits:
" David Necas (Yeti) <yeti@physics.muni.cz>
" Stefano Zacchiroli <zack@debian.org>
if version < 600
syntax clear
@@ -14,18 +17,18 @@ endif
" Errors, comments and operators
syn match resolvError /./
syn match resolvComment /\s*[#;].*$/ contains=@Spell
syn match resolvOperator /[/:]/ contained
syn match resolvComment /\s*[#;].*$/
syn match resolvOperator /[\/:]/ contained
" IP
syn cluster resolvIPCluster contains=resolvIPError,resolvIPSpecial
syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[.0-9]*/ contained
syn match resolvIPError /\%(\d\{4,}\|25[6-9]\|2[6-9]\d\|[3-9]\d\{2}\)[\.0-9]*/ contained
syn match resolvIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained
" General
syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPCluster
syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster
syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_.]*/
syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_\.]*/
" Particular
syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\+/ contains=@resolvIPCluster
@@ -41,8 +44,6 @@ syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skip
syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite
" Options
" FIXME: The manual page and the source code do not exactly agree on the set
" of allowed options
syn match resolvOption /\<\%(debug\|no_tld_query\|rotate\|no-check-names\|inet6\)\>/ contained nextgroup=resolvOption skipwhite
syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contains=resolvOperator nextgroup=resolvOption skipwhite

View File

@@ -412,7 +412,6 @@ static int get_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
static int rettv_list_alloc __ARGS((typval_T *rettv));
static void listitem_free __ARGS((listitem_T *item));
static long list_len __ARGS((list_T *l));
static int list_equal __ARGS((list_T *l1, list_T *l2, int ic, int recursive));
static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic, int recursive));
@@ -428,7 +427,6 @@ static int list_join_inner __ARGS((garray_T *gap, list_T *l, char_u *sep, int ec
static int list_join __ARGS((garray_T *gap, list_T *l, char_u *sep, int echo, int copyID));
static int free_unref_items __ARGS((int copyID));
static int rettv_dict_alloc __ARGS((typval_T *rettv));
static void dict_free __ARGS((dict_T *d, int recurse));
static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID));
@@ -832,10 +830,6 @@ static int compare_func_name __ARGS((const void *s1, const void *s2));
static void sortFunctions __ARGS(());
#endif
/* Character used as separated in autoload function/variable names. */
#define AUTOLOAD_CHAR '#'
/*
* Initialize the global and v: variables.
*/
@@ -5955,7 +5949,7 @@ listitem_alloc()
/*
* Free a list item. Also clears the value. Does not notify watchers.
*/
static void
void
listitem_free(item)
listitem_T *item;
{
@@ -7031,7 +7025,7 @@ dict_unref(d)
* Free a Dictionary, including all items it contains.
* Ignores the reference count.
*/
static void
void
dict_free(d, recurse)
dict_T *d;
int recurse; /* Free Lists and Dictionaries recursively. */
@@ -8353,7 +8347,7 @@ get_func_tv(name, len, rettv, arg, firstline, lastline, doesrange,
/*
* Call a function with its resolved parameters
* Return OK when the function can't be called, FAIL otherwise.
* Return FAIL when the function can't be called, OK otherwise.
* Also returns OK when an error was encountered while executing the function.
*/
static int
@@ -10159,6 +10153,62 @@ f_expand(argvars, rettv)
}
}
/*
* Go over all entries in "d2" and add them to "d1".
* When "action" is "error" then a duplicate key is an error.
* When "action" is "force" then a duplicate key is overwritten.
* Otherwise duplicate keys are ignored ("action" is "keep").
*/
void
dict_extend(d1, d2, action)
dict_T *d1;
dict_T *d2;
char_u *action;
{
dictitem_T *di1;
hashitem_T *hi2;
int todo;
todo = (int)d2->dv_hashtab.ht_used;
for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2)
{
if (!HASHITEM_EMPTY(hi2))
{
--todo;
di1 = dict_find(d1, hi2->hi_key, -1);
if (d1->dv_scope != 0)
{
/* Disallow replacing a builtin function in l: and g:.
* Check the key to be valid when adding to any
* scope. */
if (d1->dv_scope == VAR_DEF_SCOPE
&& HI2DI(hi2)->di_tv.v_type == VAR_FUNC
&& var_check_func_name(hi2->hi_key,
di1 == NULL))
break;
if (!valid_varname(hi2->hi_key))
break;
}
if (di1 == NULL)
{
di1 = dictitem_copy(HI2DI(hi2));
if (di1 != NULL && dict_add(d1, di1) == FAIL)
dictitem_free(di1);
}
else if (*action == 'e')
{
EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
break;
}
else if (*action == 'f' && HI2DI(hi2) != di1)
{
clear_tv(&di1->di_tv);
copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
}
}
}
}
/*
* "extend(list, list [, idx])" function
* "extend(dict, dict [, action])" function
@@ -10209,12 +10259,9 @@ f_extend(argvars, rettv)
}
else if (argvars[0].v_type == VAR_DICT && argvars[1].v_type == VAR_DICT)
{
dict_T *d1, *d2;
dictitem_T *di1;
char_u *action;
int i;
hashitem_T *hi2;
int todo;
dict_T *d1, *d2;
char_u *action;
int i;
d1 = argvars[0].vval.v_dict;
d2 = argvars[1].vval.v_dict;
@@ -10241,46 +10288,7 @@ f_extend(argvars, rettv)
else
action = (char_u *)"force";
/* Go over all entries in the second dict and add them to the
* first dict. */
todo = (int)d2->dv_hashtab.ht_used;
for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2)
{
if (!HASHITEM_EMPTY(hi2))
{
--todo;
di1 = dict_find(d1, hi2->hi_key, -1);
if (d1->dv_scope != 0)
{
/* Disallow replacing a builtin function in l: and g:.
* Check the key to be valid when adding to any
* scope. */
if (d1->dv_scope == VAR_DEF_SCOPE
&& HI2DI(hi2)->di_tv.v_type == VAR_FUNC
&& var_check_func_name(hi2->hi_key,
di1 == NULL))
break;
if (!valid_varname(hi2->hi_key))
break;
}
if (di1 == NULL)
{
di1 = dictitem_copy(HI2DI(hi2));
if (di1 != NULL && dict_add(d1, di1) == FAIL)
dictitem_free(di1);
}
else if (*action == 'e')
{
EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
break;
}
else if (*action == 'f' && HI2DI(hi2) != di1)
{
clear_tv(&di1->di_tv);
copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
}
}
}
dict_extend(d1, d2, action);
copy_tv(&argvars[0], rettv);
}
@@ -10948,16 +10956,25 @@ f_function(argvars, rettv)
typval_T *rettv;
{
char_u *s;
char_u *name = NULL;
s = get_tv_string(&argvars[0]);
if (s == NULL || *s == NUL || VIM_ISDIGIT(*s))
EMSG2(_(e_invarg2), s);
/* Don't check an autoload name for existence here. */
else if (vim_strchr(s, AUTOLOAD_CHAR) == NULL && !function_exists(s))
/* Don't check an autoload name for existence here, but still expand it
* checking for validity */
else if ((name = get_expanded_name(s, vim_strchr(s, AUTOLOAD_CHAR) == NULL))
== NULL)
EMSG2(_("E700: Unknown function: %s"), s);
else
{
rettv->vval.v_string = vim_strsave(s);
if (name == NULL)
/* Autoload function, need to copy string */
rettv->vval.v_string = vim_strsave(s);
else
/* Function found by get_expanded_name, string allocated by
* trans_function_name: no need to copy */
rettv->vval.v_string = name;
rettv->v_type = VAR_FUNC;
}
}
@@ -21913,6 +21930,15 @@ free_all_functions()
}
#endif
int
translated_function_exists(name)
char_u *name;
{
if (builtin_function(name))
return find_internal_func(name) >= 0;
return find_func(name) != NULL;
}
/*
* Return TRUE if a function "name" exists.
*/
@@ -21930,16 +21956,29 @@ function_exists(name)
/* Only accept "funcname", "funcname ", "funcname (..." and
* "funcname(...", not "funcname!...". */
if (p != NULL && (*nm == NUL || *nm == '('))
{
if (builtin_function(p))
n = (find_internal_func(p) >= 0);
else
n = (find_func(p) != NULL);
}
n = translated_function_exists(p);
vim_free(p);
return n;
}
char_u *
get_expanded_name(name, check)
char_u *name;
int check;
{
char_u *nm = name;
char_u *p;
p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET, NULL);
if (p != NULL && *nm == NUL)
if (!check || translated_function_exists(p))
return p;
vim_free(p);
return NULL;
}
/*
* Return TRUE if "name" looks like a builtin function name: starts with a
* lower case letter and doesn't contain a ':' or AUTOLOAD_CHAR.

View File

@@ -784,6 +784,7 @@ do_move(line1, line2, dest)
*/
last_line = curbuf->b_ml.ml_line_count;
mark_adjust(line1, line2, last_line - line2, 0L);
changed_lines(last_line - num_lines + 1, 0, last_line + 1, num_lines);
if (dest >= line2)
{
mark_adjust(line2 + 1, dest, -num_lines, 0L);
@@ -799,6 +800,7 @@ do_move(line1, line2, dest)
curbuf->b_op_start.col = curbuf->b_op_end.col = 0;
mark_adjust(last_line - num_lines + 1, last_line,
-(last_line - dest - extra), 0L);
changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra);
/*
* Now we delete the original text -- webb
@@ -2414,6 +2416,59 @@ print_line(lnum, use_number, list)
info_message = FALSE;
}
int
rename_buffer(new_fname)
char_u *new_fname;
{
char_u *fname, *sfname, *xfname;
buf_T *buf;
#ifdef FEAT_AUTOCMD
buf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
/* buffer changed, don't change name now */
if (buf != curbuf)
return FAIL;
# ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return FAIL;
# endif
#endif
/*
* The name of the current buffer will be changed.
* A new (unlisted) buffer entry needs to be made to hold the old file
* name, which will become the alternate file name.
* But don't set the alternate file name if the buffer didn't have a
* name.
*/
fname = curbuf->b_ffname;
sfname = curbuf->b_sfname;
xfname = curbuf->b_fname;
curbuf->b_ffname = NULL;
curbuf->b_sfname = NULL;
if (setfname(curbuf, new_fname, NULL, TRUE) == FAIL)
{
curbuf->b_ffname = fname;
curbuf->b_sfname = sfname;
return FAIL;
}
curbuf->b_flags |= BF_NOTEDITED;
if (xfname != NULL && *xfname != NUL)
{
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
if (buf != NULL && !cmdmod.keepalt)
curwin->w_alt_fnum = buf->b_fnum;
}
vim_free(fname);
vim_free(sfname);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
#endif
/* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR
return OK;
}
/*
* ":file[!] [fname]".
*/
@@ -2421,9 +2476,6 @@ print_line(lnum, use_number, list)
ex_file(eap)
exarg_T *eap;
{
char_u *fname, *sfname, *xfname;
buf_T *buf;
/* ":0file" removes the file name. Check for illegal uses ":3file",
* "0file name", etc. */
if (eap->addr_count > 0
@@ -2437,49 +2489,8 @@ ex_file(eap)
if (*eap->arg != NUL || eap->addr_count == 1)
{
#ifdef FEAT_AUTOCMD
buf = curbuf;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
/* buffer changed, don't change name now */
if (buf != curbuf)
if (rename_buffer(eap->arg) == FAIL)
return;
# ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
return;
# endif
#endif
/*
* The name of the current buffer will be changed.
* A new (unlisted) buffer entry needs to be made to hold the old file
* name, which will become the alternate file name.
* But don't set the alternate file name if the buffer didn't have a
* name.
*/
fname = curbuf->b_ffname;
sfname = curbuf->b_sfname;
xfname = curbuf->b_fname;
curbuf->b_ffname = NULL;
curbuf->b_sfname = NULL;
if (setfname(curbuf, eap->arg, NULL, TRUE) == FAIL)
{
curbuf->b_ffname = fname;
curbuf->b_sfname = sfname;
return;
}
curbuf->b_flags |= BF_NOTEDITED;
if (xfname != NULL && *xfname != NUL)
{
buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
if (buf != NULL && !cmdmod.keepalt)
curwin->w_alt_fnum = buf->b_fnum;
}
vim_free(fname);
vim_free(sfname);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
#endif
/* Change directories when the 'acd' option is set. */
DO_AUTOCHDIR
}
/* print full file name if :cd used */
fileinfo(FALSE, FALSE, eap->forceit);

View File

@@ -2460,13 +2460,13 @@ cs_reset(eap)
/*
* PRIVATE: cs_resolve_file
*
* construct the full pathname to a file found in the cscope database.
* Construct the full pathname to a file found in the cscope database.
* (Prepends ppath, if there is one and if it's not already prepended,
* otherwise just uses the name found.)
*
* we need to prepend the prefix because on some cscope's (e.g., the one that
* We need to prepend the prefix because on some cscope's (e.g., the one that
* ships with Solaris 2.6), the output never has the prefix prepended.
* contrast this with my development system (Digital Unix), which does.
* Contrast this with my development system (Digital Unix), which does.
*/
static char *
cs_resolve_file(i, name)
@@ -2493,14 +2493,12 @@ cs_resolve_file(i, name)
if (csdir != NULL)
{
vim_strncpy(csdir, (char_u *)csinfo[i].fname,
gettail((char_u *)csinfo[i].fname) - 1 - (char_u *)csinfo[i].fname);
gettail((char_u *)csinfo[i].fname)
- (char_u *)csinfo[i].fname);
len += (int)STRLEN(csdir);
}
}
if ((fullname = (char *)alloc(len)) == NULL)
return NULL;
/* Note/example: this won't work if the cscope output already starts
* "../.." and the prefix path is also "../..". if something like this
* happens, you are screwed up and need to fix how you're using cscope. */
@@ -2511,16 +2509,20 @@ cs_resolve_file(i, name)
&& name[0] != '\\' && name[1] != ':'
#endif
)
(void)sprintf(fullname, "%s/%s", csinfo[i].ppath, name);
else if (csdir != NULL && csinfo[i].fname != NULL && STRLEN(csdir) > 0)
{
if ((fullname = (char *)alloc(len)) != NULL)
(void)sprintf(fullname, "%s/%s", csinfo[i].ppath, name);
}
else if (csdir != NULL && csinfo[i].fname != NULL && *csdir != NUL)
{
/* Check for csdir to be non empty to avoid empty path concatenated to
* cscope output. TODO: avoid the unnecessary alloc/free of fullname. */
vim_free(fullname);
* cscope output. */
fullname = (char *)concat_fnames(csdir, (char_u *)name, TRUE);
}
else
(void)sprintf(fullname, "%s", name);
{
fullname = (char *)vim_strsave((char_u *)name);
}
vim_free(csdir);
return fullname;

File diff suppressed because it is too large Load Diff

View File

@@ -21,6 +21,15 @@
#include <limits.h>
/* uncomment this if used with the debug version of python.
* Checked on 2.7.4. */
/* #define Py_DEBUG */
/* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting
*/
/* uncomment this if used with the debug version of python, but without its
* allocator */
/* #define Py_DEBUG_NO_PYMALLOC */
/* Python.h defines _POSIX_THREADS itself (if needed) */
#ifdef _POSIX_THREADS
# undef _POSIX_THREADS
@@ -94,6 +103,7 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyIntIntObjArgProc intintobjargproc
# define Py_ssize_t_fmt "i"
#endif
#define Py_bytes_fmt "s"
/* Parser flags */
#define single_input 256
@@ -178,6 +188,7 @@ struct PyMethodDef { Py_ssize_t a; };
# define PySequence_Check dll_PySequence_Check
# define PySequence_Size dll_PySequence_Size
# define PySequence_GetItem dll_PySequence_GetItem
# define PySequence_Fast dll_PySequence_Fast
# define PyTuple_Size dll_PyTuple_Size
# define PyTuple_GetItem dll_PyTuple_GetItem
# define PyTuple_Type (*dll_PyTuple_Type)
@@ -185,11 +196,13 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyDict_New dll_PyDict_New
# define PyDict_GetItemString dll_PyDict_GetItemString
# define PyDict_Next dll_PyDict_Next
# ifdef PyMapping_Items
# define PY_NO_MAPPING_ITEMS
# define PyDict_Type (*dll_PyDict_Type)
# ifdef PyMapping_Keys
# define PY_NO_MAPPING_KEYS
# else
# define PyMapping_Items dll_PyMapping_Items
# define PyMapping_Keys dll_PyMapping_Keys
# endif
# define PyObject_GetItem dll_PyObject_GetItem
# define PyObject_CallMethod dll_PyObject_CallMethod
# define PyMapping_Check dll_PyMapping_Check
# define PyIter_Next dll_PyIter_Next
@@ -197,11 +210,13 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyRun_SimpleString dll_PyRun_SimpleString
# define PyRun_String dll_PyRun_String
# define PyObject_GetAttrString dll_PyObject_GetAttrString
# define PyObject_HasAttrString dll_PyObject_HasAttrString
# 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
# define PyString_FromFormat dll_PyString_FromFormat
# define PyString_FromStringAndSize dll_PyString_FromStringAndSize
# define PyString_Size dll_PyString_Size
# define PyString_Type (*dll_PyString_Type)
@@ -216,6 +231,7 @@ struct PyMethodDef { Py_ssize_t a; };
# define PySys_SetArgv dll_PySys_SetArgv
# define PyType_Type (*dll_PyType_Type)
# define PyType_Ready (*dll_PyType_Ready)
# define PyType_GenericAlloc dll_PyType_GenericAlloc
# define Py_BuildValue dll_Py_BuildValue
# define Py_FindMethod dll_Py_FindMethod
# define Py_InitModule4 dll_Py_InitModule4
@@ -225,8 +241,14 @@ struct PyMethodDef { Py_ssize_t a; };
# define Py_IsInitialized dll_Py_IsInitialized
# define _PyObject_New dll__PyObject_New
# define _PyObject_GC_New dll__PyObject_GC_New
# define PyObject_GC_Del dll_PyObject_GC_Del
# define PyObject_GC_UnTrack dll_PyObject_GC_UnTrack
# ifdef PyObject_GC_Del
# define Py_underscore_GC
# define _PyObject_GC_Del dll__PyObject_GC_Del
# define _PyObject_GC_UnTrack dll__PyObject_GC_UnTrack
# else
# define PyObject_GC_Del dll_PyObject_GC_Del
# define PyObject_GC_UnTrack dll_PyObject_GC_UnTrack
# endif
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
# define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented)
# endif
@@ -238,10 +260,20 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyObject_IsTrue dll_PyObject_IsTrue
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
# define PyType_IsSubtype dll_PyType_IsSubtype
# ifdef Py_DEBUG
# define _Py_NegativeRefcount dll__Py_NegativeRefcount
# define _Py_RefTotal (*dll__Py_RefTotal)
# define _Py_Dealloc dll__Py_Dealloc
# endif
# endif
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
# define PyObject_Malloc dll_PyObject_Malloc
# define PyObject_Free dll_PyObject_Free
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
# define _PyObject_DebugMalloc dll__PyObject_DebugMalloc
# define _PyObject_DebugFree dll__PyObject_DebugFree
# else
# define PyObject_Malloc dll_PyObject_Malloc
# define PyObject_Free dll_PyObject_Free
# endif
# endif
# ifdef PY_USE_CAPSULE
# define PyCapsule_New dll_PyCapsule_New
@@ -291,16 +323,19 @@ static PyTypeObject* dll_PyList_Type;
static int (*dll_PySequence_Check)(PyObject *);
static PyInt(*dll_PySequence_Size)(PyObject *);
static PyObject*(*dll_PySequence_GetItem)(PyObject *, PyInt);
static PyObject*(*dll_PySequence_Fast)(PyObject *, const char *);
static PyInt(*dll_PyTuple_Size)(PyObject *);
static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt);
static PyTypeObject* dll_PyTuple_Type;
static PyObject*(*dll_PyImport_ImportModule)(const char *);
static PyObject*(*dll_PyDict_New)(void);
static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *);
static int (*dll_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **);
# ifndef PY_NO_MAPPING_ITEMS
static PyObject* (*dll_PyMapping_Items)(PyObject *);
static int (*dll_PyDict_Next)(PyObject *, PyInt *, PyObject **, PyObject **);
static PyTypeObject* dll_PyDict_Type;
# ifndef PY_NO_MAPPING_KEYS
static PyObject* (*dll_PyMapping_Keys)(PyObject *);
# endif
static PyObject* (*dll_PyObject_GetItem)(PyObject *, PyObject *);
static PyObject* (*dll_PyObject_CallMethod)(PyObject *, char *, PyObject *);
static int (*dll_PyMapping_Check)(PyObject *);
static PyObject* (*dll_PyIter_Next)(PyObject *);
@@ -308,11 +343,13 @@ 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 int (*dll_PyObject_HasAttrString)(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 *);
static PyObject*(*dll_PyString_FromFormat)(const char *, ...);
static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt);
static PyInt(*dll_PyString_Size)(PyObject *);
static PyTypeObject* dll_PyString_Type;
@@ -325,6 +362,7 @@ static int(*dll_PySys_SetObject)(char *, PyObject *);
static int(*dll_PySys_SetArgv)(int, char **);
static PyTypeObject* dll_PyType_Type;
static int (*dll_PyType_Ready)(PyTypeObject *type);
static PyObject* (*dll_PyType_GenericAlloc)(PyTypeObject *type, PyInt nitems);
static PyObject*(*dll_Py_BuildValue)(char *, ...);
static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *);
static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int);
@@ -335,8 +373,13 @@ static void(*dll_Py_Finalize)(void);
static int(*dll_Py_IsInitialized)(void);
static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
static PyObject*(*dll__PyObject_GC_New)(PyTypeObject *);
# ifdef Py_underscore_GC
static void(*dll__PyObject_GC_Del)(void *);
static void(*dll__PyObject_GC_UnTrack)(void *);
# else
static void(*dll_PyObject_GC_Del)(void *);
static void(*dll_PyObject_GC_UnTrack)(void *);
# endif
static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
static PyObject* (*dll_PyObject_GetIter)(PyObject *);
static int (*dll_PyObject_IsTrue)(PyObject *);
@@ -348,10 +391,20 @@ static PyObject* _Py_ZeroStruct;
static PyObject* dll__Py_TrueStruct;
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
# ifdef Py_DEBUG
static void (*dll__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
static PyInt* dll__Py_RefTotal;
static void (*dll__Py_Dealloc)(PyObject *obj);
# endif
# endif
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
static void (*dll__PyObject_DebugFree)(void*);
static void* (*dll__PyObject_DebugMalloc)(size_t);
# else
static void* (*dll_PyObject_Malloc)(size_t);
static void (*dll_PyObject_Free)(void*);
# endif
# endif
# ifdef PY_USE_CAPSULE
static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
@@ -431,9 +484,10 @@ static struct
{"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem},
{"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size},
{"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type},
{"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem},
{"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size},
{"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check},
{"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem},
{"PySequence_Fast", (PYTHON_PROC*)&dll_PySequence_Fast},
{"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem},
{"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size},
{"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type},
@@ -441,9 +495,11 @@ static struct
{"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString},
{"PyDict_Next", (PYTHON_PROC*)&dll_PyDict_Next},
{"PyDict_New", (PYTHON_PROC*)&dll_PyDict_New},
# ifndef PY_NO_MAPPING_ITEMS
{"PyMapping_Items", (PYTHON_PROC*)&dll_PyMapping_Items},
{"PyDict_Type", (PYTHON_PROC*)&dll_PyDict_Type},
# ifndef PY_NO_MAPPING_KEYS
{"PyMapping_Keys", (PYTHON_PROC*)&dll_PyMapping_Keys},
# endif
{"PyObject_GetItem", (PYTHON_PROC*)&dll_PyObject_GetItem},
{"PyObject_CallMethod", (PYTHON_PROC*)&dll_PyObject_CallMethod},
{"PyMapping_Check", (PYTHON_PROC*)&dll_PyMapping_Check},
{"PyIter_Next", (PYTHON_PROC*)&dll_PyIter_Next},
@@ -451,11 +507,13 @@ static struct
{"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString},
{"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String},
{"PyObject_GetAttrString", (PYTHON_PROC*)&dll_PyObject_GetAttrString},
{"PyObject_HasAttrString", (PYTHON_PROC*)&dll_PyObject_HasAttrString},
{"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},
{"PyString_FromFormat", (PYTHON_PROC*)&dll_PyString_FromFormat},
{"PyString_FromStringAndSize", (PYTHON_PROC*)&dll_PyString_FromStringAndSize},
{"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size},
{"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type},
@@ -468,21 +526,21 @@ static struct
{"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv},
{"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
{"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
{"PyType_GenericAlloc", (PYTHON_PROC*)&dll_PyType_GenericAlloc},
{"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
&& SIZEOF_SIZE_T != SIZEOF_INT
{"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
# else
{"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
# endif
{"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome},
{"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
{"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
{"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized},
{"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
{"_PyObject_GC_New", (PYTHON_PROC*)&dll__PyObject_GC_New},
# ifdef Py_underscore_GC
{"_PyObject_GC_Del", (PYTHON_PROC*)&dll__PyObject_GC_Del},
{"_PyObject_GC_UnTrack", (PYTHON_PROC*)&dll__PyObject_GC_UnTrack},
# else
{"PyObject_GC_Del", (PYTHON_PROC*)&dll_PyObject_GC_Del},
{"PyObject_GC_UnTrack", (PYTHON_PROC*)&dll_PyObject_GC_UnTrack},
# endif
{"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
{"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter},
{"PyObject_IsTrue", (PYTHON_PROC*)&dll_PyObject_IsTrue},
@@ -493,11 +551,35 @@ static struct
{"_Py_ZeroStruct", (PYTHON_PROC*)&dll__Py_ZeroStruct},
{"_Py_TrueStruct", (PYTHON_PROC*)&dll__Py_TrueStruct},
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
# ifdef Py_DEBUG
{"_Py_NegativeRefcount", (PYTHON_PROC*)&dll__Py_NegativeRefcount},
{"_Py_RefTotal", (PYTHON_PROC*)&dll__Py_RefTotal},
{"_Py_Dealloc", (PYTHON_PROC*)&dll__Py_Dealloc},
# endif
{"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
# endif
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
{"_PyObject_DebugFree", (PYTHON_PROC*)&dll__PyObject_DebugFree},
{"_PyObject_DebugMalloc", (PYTHON_PROC*)&dll__PyObject_DebugMalloc},
# else
{"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
{"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
# endif
# endif
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
&& SIZEOF_SIZE_T != SIZEOF_INT
# ifdef Py_DEBUG
{"Py_InitModule4TraceRefs_64", (PYTHON_PROC*)&dll_Py_InitModule4},
# else
{"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
# endif
# else
# ifdef Py_DEBUG
{"Py_InitModule4TraceRefs", (PYTHON_PROC*)&dll_Py_InitModule4},
# else
{"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
# endif
# endif
# ifdef PY_USE_CAPSULE
{"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New},
@@ -629,19 +711,7 @@ get_exceptions(void)
static int initialised = 0;
#define PYINITIALISED initialised
#define DICTKEY_GET(err) \
if (!PyString_Check(keyObject)) \
{ \
PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \
return err; \
} \
if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \
return err;
#define DICTKEY_UNREF
#define DICTKEY_DECL
#define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self);
#define DESTRUCTOR_FINISH(self) self->ob_type->tp_free((PyObject*)self);
#define WIN_PYTHON_REF(win) win->w_python_ref
#define BUF_PYTHON_REF(buf) buf->b_python_ref
@@ -656,6 +726,17 @@ static PyObject *DictionaryGetattr(PyObject *, char*);
static PyObject *ListGetattr(PyObject *, char *);
static PyObject *FunctionGetattr(PyObject *, char *);
#ifndef Py_VISIT
# define Py_VISIT(obj) visit(obj, arg)
#endif
#ifndef Py_CLEAR
# define Py_CLEAR(obj) \
{ \
Py_XDECREF(obj); \
obj = NULL; \
}
#endif
/*
* Include the code shared with if_python3.c
*/
@@ -870,7 +951,7 @@ DoPyCommand(const char *cmd, rangeinitializer init_range, runner run, void *arg)
else
{
/* Need to make a copy, value may change when setting new locale. */
saved_locale = (char *)vim_strsave((char_u *)saved_locale);
saved_locale = (char *) PY_STRSAVE(saved_locale);
(void)setlocale(LC_NUMERIC, "C");
}
#endif
@@ -881,7 +962,11 @@ DoPyCommand(const char *cmd, rangeinitializer init_range, runner run, void *arg)
Python_RestoreThread(); /* enter python */
#endif
run((char *) cmd, arg, &pygilstate);
run((char *) cmd, arg
#ifdef PY_CAN_RECURSE
, &pygilstate
#endif
);
#ifdef PY_CAN_RECURSE
PyGILState_Release(pygilstate);
@@ -893,7 +978,7 @@ DoPyCommand(const char *cmd, rangeinitializer init_range, runner run, void *arg)
if (saved_locale != NULL)
{
(void)setlocale(LC_NUMERIC, saved_locale);
vim_free(saved_locale);
PyMem_Free(saved_locale);
}
#endif
@@ -997,6 +1082,8 @@ OutputGetattr(PyObject *self, char *name)
{
if (strcmp(name, "softspace") == 0)
return PyInt_FromLong(((OutputObject *)(self))->softspace);
else if (strcmp(name, "__members__") == 0)
return ObjectDir(NULL, OutputAttrs);
return Py_FindMethod(OutputMethods, self, name);
}
@@ -1042,10 +1129,8 @@ static PySequenceMethods BufferAsSeq = {
(PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */
(PyIntIntObjArgProc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */
(objobjproc) 0,
#if PY_MAJOR_VERSION >= 2
(binaryfunc) 0,
0,
#endif
};
/* Buffer object - Implementation
@@ -1056,6 +1141,9 @@ BufferGetattr(PyObject *self, char *name)
{
PyObject *r;
if ((r = BufferAttrValid((BufferObject *)(self), name)))
return r;
if (CheckBuffer((BufferObject *)(self)))
return NULL;
@@ -1105,6 +1193,8 @@ RangeGetattr(PyObject *self, char *name)
return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->start - 1);
else if (strcmp(name, "end") == 0)
return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->end - 1);
else if (strcmp(name, "__members__") == 0)
return ObjectDir(NULL, RangeAttrs);
else
return Py_FindMethod(RangeMethods, self, name);
}
@@ -1137,6 +1227,9 @@ TabPageGetattr(PyObject *self, char *name)
{
PyObject *r;
if ((r = TabPageAttrValid((TabPageObject *)(self), name)))
return r;
if (CheckTabPage((TabPageObject *)(self)))
return NULL;
@@ -1155,6 +1248,9 @@ WindowGetattr(PyObject *self, char *name)
{
PyObject *r;
if ((r = WindowAttrValid((WindowObject *)(self), name)))
return r;
if (CheckWindow((WindowObject *)(self)))
return NULL;
@@ -1318,6 +1414,8 @@ DictionaryGetattr(PyObject *self, char *name)
return PyInt_FromLong(this->dict->dv_lock);
else if (strcmp(name, "scope") == 0)
return PyInt_FromLong(this->dict->dv_scope);
else if (strcmp(name, "__members__") == 0)
return ObjectDir(NULL, DictionaryAttrs);
return Py_FindMethod(DictionaryMethods, self, name);
}
@@ -1342,6 +1440,8 @@ ListGetattr(PyObject *self, char *name)
{
if (strcmp(name, "locked") == 0)
return PyInt_FromLong(((ListObject *)(self))->list->lv_lock);
else if (strcmp(name, "__members__") == 0)
return ObjectDir(NULL, ListAttrs);
return Py_FindMethod(ListMethods, self, name);
}
@@ -1353,6 +1453,8 @@ FunctionGetattr(PyObject *self, char *name)
if (strcmp(name, "name") == 0)
return PyString_FromString((char *)(this->name));
else if (strcmp(name, "__members__") == 0)
return ObjectDir(NULL, FunctionAttrs);
else
return Py_FindMethod(FunctionMethods, self, name);
}

View File

@@ -24,6 +24,11 @@
/* uncomment this if used with the debug version of python */
/* #define Py_DEBUG */
/* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting
*/
/* uncomment this if used with the debug version of python, but without its
* allocator */
/* #define Py_DEBUG_NO_PYMALLOC */
#include "vim.h"
@@ -85,11 +90,13 @@
#define PyString_AsString(obj) PyBytes_AsString(obj)
#define PyString_Size(obj) PyBytes_GET_SIZE(bytes)
#define PyString_FromString(repr) PyUnicode_FromString(repr)
#define PyString_FromFormat PyUnicode_FromFormat
#define PyString_AsStringAndSize(obj, buffer, len) PyBytes_AsStringAndSize(obj, buffer, len)
#define PyInt_Check(obj) PyLong_Check(obj)
#define PyInt_FromLong(i) PyLong_FromLong(i)
#define PyInt_AsLong(obj) PyLong_AsLong(obj)
#define Py_ssize_t_fmt "n"
#define Py_bytes_fmt "y"
#if defined(DYNAMIC_PYTHON3) || defined(PROTO)
@@ -143,6 +150,7 @@
# define PySequence_Check py3_PySequence_Check
# define PySequence_Size py3_PySequence_Size
# define PySequence_GetItem py3_PySequence_GetItem
# define PySequence_Fast py3_PySequence_Fast
# define PyTuple_Size py3_PyTuple_Size
# define PyTuple_GetItem py3_PyTuple_GetItem
# define PySlice_GetIndicesEx py3_PySlice_GetIndicesEx
@@ -152,9 +160,10 @@
# define PyDict_GetItemString py3_PyDict_GetItemString
# define PyDict_Next py3_PyDict_Next
# define PyMapping_Check py3_PyMapping_Check
# define PyMapping_Items py3_PyMapping_Items
# define PyMapping_Keys py3_PyMapping_Keys
# define PyIter_Next py3_PyIter_Next
# define PyObject_GetIter py3_PyObject_GetIter
# define PyObject_GetItem py3_PyObject_GetItem
# define PyObject_IsTrue py3_PyObject_IsTrue
# define PyModule_GetDict py3_PyModule_GetDict
#undef PyRun_SimpleString
@@ -162,6 +171,7 @@
#undef PyRun_String
# define PyRun_String py3_PyRun_String
# define PyObject_GetAttrString py3_PyObject_GetAttrString
# define PyObject_HasAttrString py3_PyObject_HasAttrString
# define PyObject_SetAttrString py3_PyObject_SetAttrString
# define PyObject_CallFunctionObjArgs py3_PyObject_CallFunctionObjArgs
# define PyEval_GetLocals py3_PyEval_GetLocals
@@ -207,6 +217,11 @@
# define _Py_NegativeRefcount py3__Py_NegativeRefcount
# define _Py_RefTotal (*py3__Py_RefTotal)
# define _Py_Dealloc py3__Py_Dealloc
# define PyModule_Create2TraceRefs py3_PyModule_Create2TraceRefs
# else
# define PyModule_Create2 py3_PyModule_Create2
# endif
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
# define _PyObject_DebugMalloc py3__PyObject_DebugMalloc
# define _PyObject_DebugFree py3__PyObject_DebugFree
# else
@@ -218,16 +233,25 @@
# define PyObject_GC_UnTrack py3_PyObject_GC_UnTrack
# define PyType_GenericAlloc py3_PyType_GenericAlloc
# define PyType_GenericNew py3_PyType_GenericNew
# define PyModule_Create2 py3_PyModule_Create2
# undef PyUnicode_FromString
# define PyUnicode_FromString py3_PyUnicode_FromString
# ifndef PyUnicode_FromFormat
# define PyUnicode_FromFormat py3_PyUnicode_FromFormat
# else
# define Py_UNICODE_USE_UCS_FUNCTIONS
# ifdef Py_UNICODE_WIDE
# define PyUnicodeUCS4_FromFormat py3_PyUnicodeUCS4_FromFormat
# else
# define PyUnicodeUCS2_FromFormat py3_PyUnicodeUCS2_FromFormat
# endif
# endif
# undef PyUnicode_Decode
# define PyUnicode_Decode py3_PyUnicode_Decode
# define PyType_IsSubtype py3_PyType_IsSubtype
# define PyCapsule_New py3_PyCapsule_New
# define PyCapsule_GetPointer py3_PyCapsule_GetPointer
# ifdef Py_DEBUG
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
# undef PyObject_NEW
# define PyObject_NEW(type, typeobj) \
( (type *) PyObject_Init( \
@@ -249,10 +273,11 @@ static Py_ssize_t (*py3_PyList_Size)(PyObject *);
static int (*py3_PySequence_Check)(PyObject *);
static Py_ssize_t (*py3_PySequence_Size)(PyObject *);
static PyObject* (*py3_PySequence_GetItem)(PyObject *, Py_ssize_t);
static PyObject* (*py3_PySequence_Fast)(PyObject *, const char *);
static Py_ssize_t (*py3_PyTuple_Size)(PyObject *);
static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
static int (*py3_PyMapping_Check)(PyObject *);
static PyObject* (*py3_PyMapping_Items)(PyObject *);
static PyObject* (*py3_PyMapping_Keys)(PyObject *);
static int (*py3_PySlice_GetIndicesEx)(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength);
static PyObject* (*py3_PyErr_NoMemory)(void);
@@ -262,6 +287,7 @@ 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 int (*py3_PyObject_HasAttrString)(PyObject *, const char *);
static PyObject* (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *);
static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...);
static PyObject* (*py3_PyEval_GetGlobals)();
@@ -279,11 +305,21 @@ static PyObject* (*py3_PyLong_FromLong)(long);
static PyObject* (*py3_PyDict_New)(void);
static PyObject* (*py3_PyIter_Next)(PyObject *);
static PyObject* (*py3_PyObject_GetIter)(PyObject *);
static PyObject* (*py3_PyObject_GetItem)(PyObject *, 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);
static PyObject* (*py3_PyUnicode_FromString)(const char *u);
# ifndef Py_UNICODE_USE_UCS_FUNCTIONS
static PyObject* (*py3_PyUnicode_FromFormat)(const char *u, ...);
# else
# ifdef Py_UNICODE_WIDE
static PyObject* (*py3_PyUnicodeUCS4_FromFormat)(const char *u, ...);
# else
static PyObject* (*py3_PyUnicodeUCS2_FromFormat)(const char *u, ...);
# endif
# endif
static PyObject* (*py3_PyUnicode_Decode)(const char *u, Py_ssize_t size,
const char *encoding, const char *errors);
static long (*py3_PyLong_AsLong)(PyObject *);
@@ -317,7 +353,6 @@ static PyObject* (*py3_PyBytes_FromString)(char *str);
static PyObject* (*py3_PyFloat_FromDouble)(double num);
static double (*py3_PyFloat_AsDouble)(PyObject *);
static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
static PyTypeObject* py3_PyType_Type;
@@ -328,14 +363,19 @@ static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject
static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
# ifdef Py_DEBUG
static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
static Py_ssize_t* py3__Py_RefTotal;
static void (*py3__Py_Dealloc)(PyObject *obj);
static void (*py3__PyObject_DebugFree)(void*);
static void* (*py3__PyObject_DebugMalloc)(size_t);
static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
static Py_ssize_t* py3__Py_RefTotal;
static void (*py3__Py_Dealloc)(PyObject *obj);
static PyObject* (*py3_PyModule_Create2TraceRefs)(struct PyModuleDef* module, int module_api_version);
# else
static void (*py3_PyObject_Free)(void*);
static void* (*py3_PyObject_Malloc)(size_t);
static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
# endif
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
static void (*py3__PyObject_DebugFree)(void*);
static void* (*py3__PyObject_DebugMalloc)(size_t);
# else
static void (*py3_PyObject_Free)(void*);
static void* (*py3_PyObject_Malloc)(size_t);
# endif
static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *);
static void(*py3_PyObject_GC_Del)(void *);
@@ -392,6 +432,7 @@ static struct
{"PySequence_Check", (PYTHON_PROC*)&py3_PySequence_Check},
{"PySequence_Size", (PYTHON_PROC*)&py3_PySequence_Size},
{"PySequence_GetItem", (PYTHON_PROC*)&py3_PySequence_GetItem},
{"PySequence_Fast", (PYTHON_PROC*)&py3_PySequence_Fast},
{"PyTuple_Size", (PYTHON_PROC*)&py3_PyTuple_Size},
{"PyTuple_GetItem", (PYTHON_PROC*)&py3_PyTuple_GetItem},
{"PySlice_GetIndicesEx", (PYTHON_PROC*)&py3_PySlice_GetIndicesEx},
@@ -402,6 +443,7 @@ static struct
{"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString},
{"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String},
{"PyObject_GetAttrString", (PYTHON_PROC*)&py3_PyObject_GetAttrString},
{"PyObject_HasAttrString", (PYTHON_PROC*)&py3_PyObject_HasAttrString},
{"PyObject_SetAttrString", (PYTHON_PROC*)&py3_PyObject_SetAttrString},
{"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&py3_PyObject_CallFunctionObjArgs},
{"PyEval_GetGlobals", (PYTHON_PROC*)&py3_PyEval_GetGlobals},
@@ -416,9 +458,10 @@ static struct
{"PyDict_GetItemString", (PYTHON_PROC*)&py3_PyDict_GetItemString},
{"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next},
{"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check},
{"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items},
{"PyMapping_Keys", (PYTHON_PROC*)&py3_PyMapping_Keys},
{"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
{"PyObject_GetItem", (PYTHON_PROC*)&py3_PyObject_GetItem},
{"PyObject_IsTrue", (PYTHON_PROC*)&py3_PyObject_IsTrue},
{"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
{"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
@@ -444,6 +487,15 @@ static struct
{"PyUnicode_AsUTF8", (PYTHON_PROC*)&py3_PyUnicode_AsUTF8},
# else
{"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString},
# endif
# ifndef Py_UNICODE_USE_UCS_FUNCTIONS
{"PyUnicode_FromFormat", (PYTHON_PROC*)&py3_PyUnicode_FromFormat},
# else
# ifdef Py_UNICODE_WIDE
{"PyUnicodeUCS4_FromFormat", (PYTHON_PROC*)&py3_PyUnicodeUCS4_FromFormat},
# else
{"PyUnicodeUCS2_FromFormat", (PYTHON_PROC*)&py3_PyUnicodeUCS2_FromFormat},
# endif
# endif
{"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
{"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize},
@@ -451,7 +503,6 @@ static struct
{"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
{"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
{"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr},
{"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
{"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
{"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
{"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
@@ -463,6 +514,11 @@ static struct
{"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
{"_Py_RefTotal", (PYTHON_PROC*)&py3__Py_RefTotal},
{"_Py_Dealloc", (PYTHON_PROC*)&py3__Py_Dealloc},
{"PyModule_Create2TraceRefs", (PYTHON_PROC*)&py3_PyModule_Create2TraceRefs},
# else
{"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
# endif
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
{"_PyObject_DebugFree", (PYTHON_PROC*)&py3__PyObject_DebugFree},
{"_PyObject_DebugMalloc", (PYTHON_PROC*)&py3__PyObject_DebugMalloc},
# else
@@ -621,32 +677,6 @@ static int py3initialised = 0;
#define PYINITIALISED py3initialised
#define DICTKEY_DECL PyObject *bytes = NULL;
#define DICTKEY_GET(err) \
if (PyBytes_Check(keyObject)) \
{ \
if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \
return err; \
} \
else if (PyUnicode_Check(keyObject)) \
{ \
bytes = PyString_AsBytes(keyObject); \
if (bytes == NULL) \
return err; \
if (PyString_AsStringAndSize(bytes, (char **) &key, NULL) == -1) \
return err; \
} \
else \
{ \
PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \
return err; \
}
#define DICTKEY_UNREF \
if (bytes != NULL) \
Py_XDECREF(bytes);
#define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self)
#define WIN_PYTHON_REF(win) win->w_python3_ref
@@ -656,7 +686,7 @@ static int py3initialised = 0;
static void
call_PyObject_Free(void *p)
{
#ifdef Py_DEBUG
#if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
_PyObject_DebugFree(p);
#else
PyObject_Free(p);
@@ -675,10 +705,10 @@ call_PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
return PyType_GenericAlloc(type,nitems);
}
static PyObject *BufferDir(PyObject *);
static PyObject *OutputGetattro(PyObject *, PyObject *);
static int OutputSetattro(PyObject *, PyObject *, PyObject *);
static PyObject *BufferGetattro(PyObject *, PyObject *);
static int BufferSetattro(PyObject *, PyObject *, PyObject *);
static PyObject *TabPageGetattro(PyObject *, PyObject *);
static PyObject *WindowGetattro(PyObject *, PyObject *);
static int WindowSetattro(PyObject *, PyObject *, PyObject *);
@@ -693,6 +723,8 @@ static PyObject *FunctionGetattro(PyObject *, PyObject *);
static struct PyModuleDef vimmodule;
#define PY_CAN_RECURSE
/*
* Include the code shared with if_python.c
*/
@@ -1073,12 +1105,15 @@ static PyMappingMethods BufferAsMapping = {
*/
static PyObject *
BufferGetattro(PyObject *self, PyObject*nameobj)
BufferGetattro(PyObject *self, PyObject *nameobj)
{
PyObject *r;
GET_ATTR_STRING(name, nameobj);
if ((r = BufferAttrValid((BufferObject *)(self), name)))
return r;
if (CheckBuffer((BufferObject *)(self)))
return NULL;
@@ -1089,11 +1124,12 @@ BufferGetattro(PyObject *self, PyObject*nameobj)
return PyObject_GenericGetAttr(self, nameobj);
}
static PyObject *
BufferDir(PyObject *self UNUSED)
static int
BufferSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
{
return Py_BuildValue("[sssss]", "name", "number",
"append", "mark", "range");
GET_ATTR_STRING(name, nameobj);
return BufferSetattr((BufferObject *)(self), name, val);
}
/******************/
@@ -1281,6 +1317,9 @@ TabPageGetattro(PyObject *self, PyObject *nameobj)
GET_ATTR_STRING(name, nameobj);
if ((r = TabPageAttrValid((TabPageObject *)(self), name)))
return r;
if (CheckTabPage((TabPageObject *)(self)))
return NULL;
@@ -1301,6 +1340,9 @@ WindowGetattro(PyObject *self, PyObject *nameobj)
GET_ATTR_STRING(name, nameobj);
if ((r = WindowAttrValid((WindowObject *)(self), name)))
return r;
if (CheckWindow((WindowObject *)(self)))
return NULL;
@@ -1356,8 +1398,11 @@ static PySequenceMethods WinListAsSeq = {
static PyObject *
CurrentGetattro(PyObject *self, PyObject *nameobj)
{
PyObject *r;
GET_ATTR_STRING(name, nameobj);
return CurrentGetattr(self, name);
if (!(r = CurrentGetattr(self, name)))
return PyObject_GenericGetAttr(self, nameobj);
return r;
}
static int

View File

@@ -127,7 +127,7 @@ mf_open(fname, flags)
{
memfile_T *mfp;
off_t size;
#if defined(STATFS) && defined(UNIX) && !defined(__QNX__)
#if defined(STATFS) && defined(UNIX) && !defined(__QNX__) && !defined(__minix)
# define USE_FSTATFS
struct STATFS stf;
#endif

View File

@@ -3018,7 +3018,7 @@ static long_u *insecure_flag __ARGS((int opt_idx, int opt_flags));
# define insecure_flag(opt_idx, opt_flags) (&options[opt_idx].flags)
#endif
static void set_string_option_global __ARGS((int opt_idx, char_u **varp));
static void set_string_option __ARGS((int opt_idx, char_u *value, int opt_flags));
static char_u *set_string_option __ARGS((int opt_idx, char_u *value, int opt_flags));
static char_u *did_set_string_option __ARGS((int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char_u *errbuf, int opt_flags));
static char_u *set_chars_option __ARGS((char_u **varp));
#ifdef FEAT_SYN_HL
@@ -5600,8 +5600,10 @@ set_string_option_global(opt_idx, varp)
/*
* Set a string option to a new value, and handle the effects.
*
* Returns NULL on success or error message on error.
*/
static void
static char_u *
set_string_option(opt_idx, value, opt_flags)
int opt_idx;
char_u *value;
@@ -5610,9 +5612,10 @@ set_string_option(opt_idx, value, opt_flags)
char_u *s;
char_u **varp;
char_u *oldval;
char_u *r = NULL;
if (options[opt_idx].var == NULL) /* don't set hidden option */
return;
return NULL;
s = vim_strsave(value);
if (s != NULL)
@@ -5624,10 +5627,11 @@ set_string_option(opt_idx, value, opt_flags)
: opt_flags);
oldval = *varp;
*varp = s;
if (did_set_string_option(opt_idx, varp, TRUE, oldval, NULL,
opt_flags) == NULL)
if ((r = did_set_string_option(opt_idx, varp, TRUE, oldval, NULL,
opt_flags)) == NULL)
did_set_option(opt_idx, opt_flags, TRUE);
}
return r;
}
/*
@@ -8969,8 +8973,10 @@ get_option_value_strict(name, numval, stringval, opt_type, from)
/*
* Set the value of option "name".
* Use "string" for string options, use "number" for other options.
*
* Returns NULL on success or error message on error.
*/
void
char_u *
set_option_value(name, number, string, opt_flags)
char_u *name;
long number;
@@ -8992,11 +8998,11 @@ set_option_value(name, number, string, opt_flags)
if (sandbox > 0 && (flags & P_SECURE))
{
EMSG(_(e_sandbox));
return;
return NULL;
}
#endif
if (flags & P_STRING)
set_string_option(opt_idx, string, opt_flags);
return set_string_option(opt_idx, string, opt_flags);
else
{
varp = get_varp_scope(&(options[opt_idx]), opt_flags);
@@ -9017,19 +9023,20 @@ set_option_value(name, number, string, opt_flags)
* num option using a string. */
EMSG3(_("E521: Number required: &%s = '%s'"),
name, string);
return; /* do nothing as we hit an error */
return NULL; /* do nothing as we hit an error */
}
}
if (flags & P_NUM)
(void)set_num_option(opt_idx, varp, number,
return set_num_option(opt_idx, varp, number,
NULL, 0, opt_flags);
else
(void)set_bool_option(opt_idx, varp, (int)number,
return set_bool_option(opt_idx, varp, (int)number,
opt_flags);
}
}
}
return NULL;
}
/*

View File

@@ -37,6 +37,7 @@ LANGUAGES = \
CONVERTED = \
cs.cp1250 \
ja.sjis \
ja.euc-jp \
pl.cp1250 \
pl.UTF-8 \
ru.cp1251 \
@@ -77,6 +78,7 @@ MOFILES = \
MOCONVERTED = \
cs.cp1250.mo \
ja.sjis.mo \
ja.euc-jp.mo \
pl.cp1250.mo \
pl.UTF-8.mo \
ru.cp1251.mo \
@@ -115,6 +117,7 @@ CHECKFILES = \
zh_TW.ck \
cs.cp1250.ck \
ja.sjis.ck \
ja.euc-jp.ck \
pl.cp1250.ck \
pl.UTF-8.ck \
ru.cp1251.ck \
@@ -193,11 +196,15 @@ nb.po: no.po
ja.sjis.po: ja.po
@$(MAKE) sjiscorr
rm -f ja.sjis.po
iconv -f euc-jp -t cp932 ja.po | ./sjiscorr > ja.sjis.po
iconv -f utf-8 -t cp932 ja.po | ./sjiscorr > ja.sjis.po
sjiscorr: sjiscorr.c
$(CC) -o sjiscorr sjiscorr.c
ja.euc-jp.po: ja.po
iconv -f utf-8 -t euc-jp ja.po | \
sed -e 's/charset=utf-8/charset=euc-jp/' -e 's/# Original translations/# Generated from ja.po, DO NOT EDIT/' > ja.euc-jp.po
# Convert cs.po to create cs.cp1250.po.
cs.cp1250.po: cs.po
rm -f cs.cp1250.po

View File

@@ -107,3 +107,25 @@ language.
make xx.mo
Look out for syntax errors and fix them.
USING GETTEXT WITHOUT ICONV
When using gettext which doesn't support iconv, the encoding of the .mo file
must match your active encoding. For that you must convert and change
encoding of *.po file in advance of generating the *.mo file. For example, to
convert ja.po to EUC-JP (supposed as your system encoding):
(1) Convert the file encoding:
mv ja.po ja.po.orig
iconv -f utf-8 -t euc-jp ja.po.orig > ja.po
(2) Rewrite charset declaration in the file:
Open ja.po find this line:
"Content-Type: text/plain; charset=utf-8\n"
You should change "charset" like this:
"Content-Type: text/plain; charset=euc-jp\n"
There are examples in the Makefile for the conversions already supported.

6683
src/po/ja.euc-jp.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,17 +3,19 @@
# Do ":help uganda" in Vim to read copying and usage conditions.
# Do ":help credits" in Vim to see a list of people who contributed.
#
# Last Change: 17-Apr-2013.
# Last Change: 2013 May 19
#
# Copyright (C) 2001-12 MURAOKA Taro <koron.kaoriya@gmail.com>
# THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
#
# Original translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Vim 7.3\n"
"Project-Id-Version: Vim 7.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-04-17 19:56+0900\n"
"PO-Revision-Date: 2013-04-17 20:00+0900\n"
"POT-Creation-Date: 2013-05-19 12:20+0900\n"
"PO-Revision-Date: 2013-05-19 12:30+0900\n"
"Last-Translator: MURAOKA Taro <koron.kaoriya@gmail.com>\n"
"Language-Team: MURAOKA Taro <koron.kaoriya@gmail.com>\n"
"Language: Japanese\n"
@@ -2656,9 +2658,11 @@ msgstr "E858:
msgid "E859: Failed to convert returned python object to vim value"
msgstr "E859: <20>Ԃ<EFBFBD><D482>ꂽpython<6F>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67>vim<69>̒l<CC92>ɕϊ<C995><CF8A>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD>"
#, c-format
msgid "<buffer object (deleted) at %p>"
msgstr "<<3C>o<EFBFBD>b<EFBFBD>t<EFBFBD>@<40>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g (<28><><EFBFBD><EFBFBD><EFBFBD>ς<EFBFBD>) %p>"
msgid "failed to run the code"
msgstr "<22>R<EFBFBD>[<5B>h<EFBFBD>̎<EFBFBD><CC8E>s<EFBFBD>Ɏ<EFBFBD><C98E>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "E863: return value must be an instance of str"
msgstr "E863: <20>߂<EFBFBD><DF82>l<EFBFBD>͕<EFBFBD><CD95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̃C<CC83><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
msgid "E837: This Vim cannot execute :py3 after using :python"
msgstr "E837: <20><><EFBFBD><EFBFBD>Vim<69>ł<EFBFBD> :python <20><><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :py3 <20><><EFBFBD>g<EFBFBD><67><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
@@ -2669,6 +2673,9 @@ msgstr "E860:
msgid "E861: Failed to convert returned python 3 object to vim value"
msgstr "E861: <20>Ԃ<EFBFBD><D482>ꂽpython 3<>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67>vim<69>̒l<CC92>ɕϊ<C995><CF8A>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD>"
msgid "index must be int or slice"
msgstr "<22>C<EFBFBD><43><EFBFBD>f<EFBFBD>b<EFBFBD>N<EFBFBD>X<EFBFBD>͐<EFBFBD><CD90><EFBFBD><EFBFBD><EFBFBD><EFBFBD>X<EFBFBD><58><EFBFBD>C<EFBFBD>X<EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
msgid "E265: $_ must be an instance of String"
msgstr "E265: $_ <20>͕<EFBFBD><CD95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̃C<CC83><43><EFBFBD>X<EFBFBD>^<5E><><EFBFBD>X<EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
@@ -6521,33 +6528,27 @@ msgstr "writelines()
msgid "E264: Python: Error initialising I/O objects"
msgstr "E264: Python: I/O<>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>̏<EFBFBD><CC8F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>G<EFBFBD><47><EFBFBD>["
msgid "no such buffer"
msgstr "<22><><EFBFBD>̂悤<CC82>ȃo<C883>b<EFBFBD>t<EFBFBD>@<40>͂<EFBFBD><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "empty keys are not allowed"
msgstr "<22><><EFBFBD>̃L<CC83>[<5B>͋<EFBFBD><CD8B>‚<EFBFBD><C282><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD>"
msgid "failed to add key to dictionary"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD>ւ̃L<CC83>[<5B>̒lj<CC92><C789>Ɏ<EFBFBD><C98E>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "Cannot delete DictionaryObject attributes"
msgstr "DictionaryObject<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "Cannot modify fixed dictionary"
msgstr "<22>Œ肳<C592><EFBFBD><EA82BD><EFBFBD><EFBFBD><EFBFBD>͕ύX<CF8D>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "Only boolean objects are allowed"
msgstr "boolean<61>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‚<EFBFBD><C282><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD>"
msgid "Cannot set this attribute"
msgstr "<22><><EFBFBD>̑<EFBFBD><CC91><EFBFBD><EFBFBD>͐ݒ<CD90><DD92>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "no such key in dictionary"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD><C982>̂悤<CC82>ȃL<C883>[<5B>͂<EFBFBD><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "dict is locked"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD>̓<EFBFBD><CD83>b<EFBFBD>N<EFBFBD><4E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD>"
msgid "failed to add key to dictionary"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD>ւ̃L<CC83>[<5B>̒lj<CC92><C789>Ɏ<EFBFBD><C98E>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "list index out of range"
msgstr "<22><><EFBFBD>X<EFBFBD>g<EFBFBD>͈͊O<CD8A>̃C<CC83><43><EFBFBD>f<EFBFBD>b<EFBFBD>N<EFBFBD>X<EFBFBD>ł<EFBFBD>"
msgid "internal error: failed to get vim list item"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD>G<EFBFBD><47><EFBFBD>[: vim<69>̃<EFBFBD><CC83>X<EFBFBD>g<EFBFBD>v<EFBFBD>f<EFBFBD>̎擾<CC8E>Ɏ<EFBFBD><C98E>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
@@ -6569,15 +6570,54 @@ msgstr "
msgid "can only concatenate with lists"
msgstr "<22><><EFBFBD>X<EFBFBD>g<EFBFBD>Ƃ̂ݐڑ<DD90><DA91>ł<EFBFBD><C582>܂<EFBFBD>"
msgid "Cannot modify fixed list"
msgid "cannot delete vim.dictionary attributes"
msgstr "vim.dictionary<72><79><EFBFBD><EFBFBD><EFBFBD>͏<EFBFBD><CD8F><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "cannot modify fixed list"
msgstr "<22>Œ肳<C592><EFBFBD><EA82BD><EFBFBD>X<EFBFBD>g<EFBFBD>͕ύX<CF8D>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "cannot set this attribute"
msgstr "<22><><EFBFBD>̑<EFBFBD><CC91><EFBFBD><EFBFBD>͐ݒ<CD90><DD92>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "'self' argument must be a dictionary"
msgstr "'self' <20><><EFBFBD><EFBFBD><EFBFBD>͎<EFBFBD><CD8E><EFBFBD><EFBFBD>^<5E>̒l<CC92>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
msgid "failed to run function"
msgstr "<22>֐<EFBFBD><D690>̎<EFBFBD><CC8E>s<EFBFBD>Ɏ<EFBFBD><C98E>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "unable to get option value"
msgstr "<22>I<EFBFBD>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>̒l<CC92>͎擾<CD8E>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "unable to unset global option"
msgstr "<22>O<EFBFBD><4F><EFBFBD>[<5B>o<EFBFBD><6F><EFBFBD>I<EFBFBD>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>̐ݒ<CC90><DD92><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͂ł<CD82><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "unable to unset option without global value"
msgstr "<22>O<EFBFBD><4F><EFBFBD>[<5B>o<EFBFBD><6F><EFBFBD>ϐ<EFBFBD><CF90><EFBFBD><EFBFBD>g<EFBFBD><EFBFBD>ɃI<C983>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>̐ݒ<CC90><DD92><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͂ł<CD82><C582>܂<EFBFBD><DC82><EFBFBD>"
msgid "object must be integer"
msgstr "<22>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>͐<EFBFBD><CD90><EFBFBD><EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
msgid "object must be string"
msgstr "<22>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD>͕<EFBFBD><CD95><EFBFBD><EFBFBD><EFBFBD><EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
msgid "attempt to refer to deleted tab page"
msgstr "<22><EFBFBD><ED8F9C><EFBFBD><EFBFBD>^<5E>u<EFBFBD><75><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD>Ƃ<EFBFBD><C682>܂<EFBFBD><DC82><EFBFBD>"
#, c-format
msgid "<tabpage object (deleted) at %p>"
msgstr "<<3C>^<5E>u<EFBFBD>y<EFBFBD>[<5B>W<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g (<28><><EFBFBD><EFBFBD><EFBFBD>ς<EFBFBD>) %p>"
#, c-format
msgid "<tabpage object (unknown) at %p>"
msgstr "<<3C>^<5E>u<EFBFBD>y<EFBFBD>[<5B>W<EFBFBD>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g (<28>s<EFBFBD><73>) %p>"
#, c-format
msgid "<tabpage %d>"
msgstr "<<3C>^<5E>u<EFBFBD>y<EFBFBD>[<5B>W %d>"
msgid "no such tab page"
msgstr "<22><><EFBFBD>̂悤<CC82>ȃ^<5E>u<EFBFBD>y<EFBFBD>[<5B>W<EFBFBD>͂<EFBFBD><CD82><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "attempt to refer to deleted window"
msgstr "<22><EFBFBD><ED8F9C><EFBFBD><EFBFBD>E<EFBFBD>B<EFBFBD><42><EFBFBD>h<EFBFBD>E<EFBFBD><45><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD>Ƃ<EFBFBD><C682>܂<EFBFBD><DC82><EFBFBD>"
@@ -6605,6 +6645,34 @@ msgstr "
msgid "attempt to refer to deleted buffer"
msgstr "<22><EFBFBD><ED8F9C><EFBFBD><EFBFBD>o<EFBFBD>b<EFBFBD>t<EFBFBD>@<40><><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD>Ƃ<EFBFBD><C682>܂<EFBFBD><DC82><EFBFBD>"
#, c-format
msgid "<buffer object (deleted) at %p>"
msgstr "<<3C>o<EFBFBD>b<EFBFBD>t<EFBFBD>@<40>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g (<28><><EFBFBD><EFBFBD><EFBFBD>ς<EFBFBD>) %p>"
msgid "key must be integer"
msgstr "<22>L<EFBFBD>[<5B>͐<EFBFBD><CD90><EFBFBD><EFBFBD>l<EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>΂Ȃ<CE82><C882>܂<EFBFBD><DC82><EFBFBD>"
msgid "expected vim.buffer object"
msgstr "vim.buffer<65>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>҂<EFBFBD><D282>Ă<EFBFBD><C482>܂<EFBFBD>"
msgid "failed to switch to given buffer"
msgstr "<22>w<EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>b<EFBFBD>t<EFBFBD>@<40>ւ̐؂<CC90><D882>ւ<EFBFBD><D682>Ɏ<EFBFBD><C98E>s<EFBFBD><73><EFBFBD>܂<EFBFBD><DC82><EFBFBD>"
msgid "expected vim.window object"
msgstr "vim.window<6F>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>҂<EFBFBD><D282>Ă<EFBFBD><C482>܂<EFBFBD>"
msgid "failed to find window in the current tab page"
msgstr "<22><><EFBFBD>݂̃^<5E>u<EFBFBD>ɂ͎w<CD8E><EFBFBD><EFBFBD>E<EFBFBD>B<EFBFBD><42><EFBFBD>h<EFBFBD>E<EFBFBD><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD>"
msgid "did not switch to the specified window"
msgstr "<22>w<EFBFBD><EFBFBD><EFBFBD>E<EFBFBD>B<EFBFBD><42><EFBFBD>h<EFBFBD>E<EFBFBD>ɐ؂<C990><D882>ւ<EFBFBD><D682>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD>"
msgid "expected vim.tabpage object"
msgstr "vim.tabpage<67>I<EFBFBD>u<EFBFBD>W<EFBFBD>F<EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>҂<EFBFBD><D282>Ă<EFBFBD><C482>܂<EFBFBD>"
msgid "did not switch to the specified tab page"
msgstr "<22>w<EFBFBD><EFBFBD><EFBFBD>^<5E>u<EFBFBD>y<EFBFBD>[<5B>W<EFBFBD>ɐ؂<C990><D882>ւ<EFBFBD><D682>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD>"
msgid "unable to convert to vim structure"
msgstr "vim<69>̍\\<5C><><EFBFBD>̂ɕϊ<C995><CF8A>ł<EFBFBD><C582>܂<EFBFBD><DC82><EFBFBD>"

View File

@@ -18,10 +18,10 @@ main(argc, argv)
{
for (p = buffer; *p != 0; p++)
{
if (strncmp(p, "charset=euc-jp", 14) == 0)
if (strncmp(p, "charset=utf-8", 13) == 0)
{
fputs("charset=cp932", stdout);
p += 13;
p += 12;
}
else if (strncmp(p, "ja.po - Japanese message file", 29) == 0)
{

View File

@@ -49,6 +49,7 @@ list_T *list_alloc __ARGS((void));
void list_unref __ARGS((list_T *l));
void list_free __ARGS((list_T *l, int recurse));
listitem_T *listitem_alloc __ARGS((void));
void listitem_free __ARGS((listitem_T *item));
void listitem_remove __ARGS((list_T *l, listitem_T *item));
dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
listitem_T *list_find __ARGS((list_T *l, long n));
@@ -65,6 +66,7 @@ void set_ref_in_list __ARGS((list_T *l, int copyID));
void set_ref_in_item __ARGS((typval_T *tv, int copyID));
dict_T *dict_alloc __ARGS((void));
void dict_unref __ARGS((dict_T *d));
void dict_free __ARGS((dict_T *d, int recurse));
dictitem_T *dictitem_alloc __ARGS((char_u *key));
void dictitem_free __ARGS((dictitem_T *item));
int dict_add __ARGS((dict_T *d, dictitem_T *item));
@@ -73,8 +75,11 @@ int dict_add_list __ARGS((dict_T *d, char *key, list_T *list));
dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len));
char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save));
long get_dict_number __ARGS((dict_T *d, char_u *key));
void dict_extend __ARGS((dict_T *d1, dict_T *d2, char_u *action));
char_u *get_function_name __ARGS((expand_T *xp, int idx));
char_u *get_expr_name __ARGS((expand_T *xp, int idx));
char_u *get_expanded_name __ARGS((char_u *name, int check));
int translated_function_exists __ARGS((char_u *name));
int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv));
void mzscheme_call_vim __ARGS((char_u *name, typval_T *args, typval_T *rettv));
long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit));

View File

@@ -19,6 +19,7 @@ void viminfo_writestring __ARGS((FILE *fd, char_u *p));
void do_fixdel __ARGS((exarg_T *eap));
void print_line_no_prefix __ARGS((linenr_T lnum, int use_number, int list));
void print_line __ARGS((linenr_T lnum, int use_number, int list));
int rename_buffer __ARGS((char_u *new_fname));
void ex_file __ARGS((exarg_T *eap));
void ex_update __ARGS((exarg_T *eap));
void ex_write __ARGS((exarg_T *eap));

View File

@@ -23,7 +23,7 @@ char_u *check_colorcolumn __ARGS((win_T *wp));
char_u *check_stl_option __ARGS((char_u *s));
int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval, int opt_flags));
int get_option_value_strict __ARGS((char_u *name, long *numval, char_u **stringval, int opt_type, void *from));
void set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags));
char_u *set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags));
char_u *get_term_code __ARGS((char_u *tname));
char_u *get_highlight_default __ARGS((void));
char_u *get_encoding_default __ARGS((void));

View File

@@ -701,6 +701,7 @@ static void regmbc __ARGS((int c));
# define CASEMBC(x)
#endif
static void reginsert __ARGS((int, char_u *));
static void reginsert_nr __ARGS((int op, long val, char_u *opnd));
static void reginsert_limits __ARGS((int, long, long, char_u *));
static char_u *re_put_long __ARGS((char_u *pr, long_u val));
static int read_limits __ARGS((long *, long *));
@@ -1781,7 +1782,9 @@ regpiece(flagp)
case Magic('@'):
{
int lop = END;
int nr;
nr = getdecchrs();
switch (no_Magic(getchr()))
{
case '=': lop = MATCH; break; /* \@= */
@@ -1803,7 +1806,14 @@ regpiece(flagp)
*flagp |= HASLOOKBH;
}
regtail(ret, regnode(END)); /* operand ends */
reginsert(lop, ret);
if (lop == BEHIND || lop == NOBEHIND)
{
if (nr < 0)
nr = 0; /* no limit is same as zero limit */
reginsert_nr(lop, nr, ret);
}
else
reginsert(lop, ret);
break;
}
@@ -2778,6 +2788,38 @@ reginsert(op, opnd)
*place = NUL;
}
/*
* Insert an operator in front of already-emitted operand.
* Add a number to the operator.
*/
static void
reginsert_nr(op, val, opnd)
int op;
long val;
char_u *opnd;
{
char_u *src;
char_u *dst;
char_u *place;
if (regcode == JUST_CALC_SIZE)
{
regsize += 7;
return;
}
src = regcode;
regcode += 7;
dst = regcode;
while (src > opnd)
*--dst = *--src;
place = opnd; /* Op node, where operand used to be. */
*place++ = op;
*place++ = NUL;
*place++ = NUL;
place = re_put_long(place, (long_u)val);
}
/*
* Insert an operator in front of already-emitted operand.
* The operator has the given limit values as operands. Also set next pointer.
@@ -3182,7 +3224,7 @@ gethexchrs(maxinputlen)
}
/*
* get and return the value of the decimal string immediately after the
* Get and return the value of the decimal string immediately after the
* current position. Return -1 for invalid. Consumes all digits.
*/
static int
@@ -3200,6 +3242,7 @@ getdecchrs()
nr *= 10;
nr += c - '0';
++regparse;
curchr = -1; /* no longer valid */
}
if (i == 0)
@@ -5432,7 +5475,7 @@ regmatch(scan)
/* save the position after the found match for next */
reg_save(&(((regbehind_T *)rp) - 1)->save_after, &backpos);
/* start looking for a match with operand at the current
/* Start looking for a match with operand at the current
* position. Go back one character until we find the
* result, hitting the start of the line or the previous
* line (for multi-line matching).
@@ -5444,7 +5487,7 @@ regmatch(scan)
rp->rs_state = RS_BEHIND2;
reg_restore(&rp->rs_un.regsave, &backpos);
scan = OPERAND(rp->rs_scan);
scan = OPERAND(rp->rs_scan) + 4;
}
break;
@@ -5472,9 +5515,12 @@ regmatch(scan)
}
else
{
long limit;
/* No match or a match that doesn't end where we want it: Go
* back one character. May go to previous line once. */
no = OK;
limit = OPERAND_MIN(rp->rs_scan);
if (REG_MULTI)
{
if (rp->rs_un.regsave.rs_u.pos.col == 0)
@@ -5493,27 +5539,41 @@ regmatch(scan)
}
}
else
{
#ifdef FEAT_MBYTE
if (has_mbyte)
rp->rs_un.regsave.rs_u.pos.col -=
(*mb_head_off)(regline, regline
if (has_mbyte)
rp->rs_un.regsave.rs_u.pos.col -=
(*mb_head_off)(regline, regline
+ rp->rs_un.regsave.rs_u.pos.col - 1) + 1;
else
else
#endif
--rp->rs_un.regsave.rs_u.pos.col;
--rp->rs_un.regsave.rs_u.pos.col;
if (limit > 0
&& ((rp->rs_un.regsave.rs_u.pos.lnum
< behind_pos.rs_u.pos.lnum
? (colnr_T)STRLEN(regline)
: behind_pos.rs_u.pos.col)
- rp->rs_un.regsave.rs_u.pos.col > limit))
no = FAIL;
}
}
else
{
if (rp->rs_un.regsave.rs_u.ptr == regline)
no = FAIL;
else
--rp->rs_un.regsave.rs_u.ptr;
{
mb_ptr_back(regline, rp->rs_un.regsave.rs_u.ptr);
if (limit > 0 && (long)(behind_pos.rs_u.ptr
- rp->rs_un.regsave.rs_u.ptr) > limit)
no = FAIL;
}
}
if (no == OK)
{
/* Advanced, prepare for finding match again. */
reg_restore(&rp->rs_un.regsave, &backpos);
scan = OPERAND(rp->rs_scan);
scan = OPERAND(rp->rs_scan) + 4;
if (status == RA_MATCH)
{
/* We did match, so subexpr may have been changed,
@@ -6899,7 +6959,7 @@ mb_decompose(c, c1, c2, c3)
{
decomp_T d;
if (c >= 0x4b20 && c <= 0xfb4f)
if (c >= 0xfb20 && c <= 0xfb4f)
{
d = decomp_table[c - 0xfb20];
*c1 = d.a;
@@ -7773,7 +7833,7 @@ static int regexp_engine = 0;
#ifdef DEBUG
static char_u regname[][30] = {
"AUTOMATIC Regexp Engine",
"BACKTACKING Regexp Engine",
"BACKTRACKING Regexp Engine",
"NFA Regexp Engine"
};
#endif

View File

@@ -29,8 +29,6 @@
typedef struct regengine regengine_T;
typedef struct thread thread_T;
/*
* Structure returned by vim_regcomp() to pass on to vim_regexec().
* This is the general structure. For the actual matcher, two specific
@@ -73,9 +71,8 @@ struct nfa_state
nfa_state_T *out1;
int id;
int lastlist;
int visits;
thread_T *lastthread;
int negated;
int val;
};
/*
@@ -89,6 +86,8 @@ typedef struct
regprog_T regprog;
nfa_state_T *start;
int has_zend; /* pattern contains \ze */
int nsubexp; /* number of () */
int nstate;
nfa_state_T state[0]; /* actually longer.. */
} nfa_regprog_T;

File diff suppressed because it is too large Load Diff

View File

@@ -15,332 +15,465 @@ STARTTEST
:" etc.
:" When there is no match use only the first two items.
:let tl = []
:"
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:"""" Previously written tests """"""""""""""""""""""""""""""""
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:call add(tl, ['ab', 'aab', 'ab'])
:call add(tl, ['b', 'abcdef', 'b'])
:call add(tl, ['bc*', 'abccccdef', 'bcccc'])
:call add(tl, ['bc\{-}', 'abccccdef', 'b'])
:call add(tl, ['bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd'])
:call add(tl, ['bc*', 'abbdef', 'b'])
:call add(tl, ['c*', 'ccc', 'ccc'])
:call add(tl, ['bc*', 'abdef', 'b'])
:call add(tl, ['c*', 'abdef', ''])
:call add(tl, ['bc\+', 'abccccdef', 'bcccc'])
:call add(tl, ['bc\+', 'abdef']) "no match
:"
:call add(tl, [2, 'ab', 'aab', 'ab'])
:call add(tl, [2, 'b', 'abcdef', 'b'])
:call add(tl, [2, 'bc*', 'abccccdef', 'bcccc'])
:call add(tl, [0, 'bc\{-}', 'abccccdef', 'b'])
:call add(tl, [0, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd'])
:call add(tl, [2, 'bc*', 'abbdef', 'b'])
:call add(tl, [2, 'c*', 'ccc', 'ccc'])
:call add(tl, [2, 'bc*', 'abdef', 'b'])
:call add(tl, [2, 'c*', 'abdef', ''])
:call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc'])
:call add(tl, [2, 'bc\+', 'abdef']) "no match
:"
:"operator \|
:call add(tl, ['a\|ab', 'cabd', 'a']) "alternation is ordered
:call add(tl, [2, 'a\|ab', 'cabd', 'a']) "alternation is ordered
:"
:call add(tl, ['c\?', 'ccb', 'c'])
:call add(tl, ['bc\?', 'abd', 'b'])
:call add(tl, ['bc\?', 'abccd', 'bc'])
:call add(tl, [2, 'c\?', 'ccb', 'c'])
:call add(tl, [2, 'bc\?', 'abd', 'b'])
:call add(tl, [2, 'bc\?', 'abccd', 'bc'])
:"
:call add(tl, ['\va{1}', 'ab', 'a'])
:call add(tl, [2, '\va{1}', 'ab', 'a'])
:"
:call add(tl, ['\va{2}', 'aa', 'aa'])
:call add(tl, ['\va{2}', 'caad', 'aa'])
:call add(tl, ['\va{2}', 'aba'])
:call add(tl, ['\va{2}', 'ab'])
:call add(tl, ['\va{2}', 'abaa', 'aa'])
:call add(tl, ['\va{2}', 'aaa', 'aa'])
:call add(tl, [2, '\va{2}', 'aa', 'aa'])
:call add(tl, [2, '\va{2}', 'caad', 'aa'])
:call add(tl, [2, '\va{2}', 'aba'])
:call add(tl, [2, '\va{2}', 'ab'])
:call add(tl, [2, '\va{2}', 'abaa', 'aa'])
:call add(tl, [2, '\va{2}', 'aaa', 'aa'])
:"
:call add(tl, ['\vb{1}', 'abca', 'b'])
:call add(tl, ['\vba{2}', 'abaa', 'baa'])
:call add(tl, ['\vba{3}', 'aabaac'])
:call add(tl, [2, '\vb{1}', 'abca', 'b'])
:call add(tl, [2, '\vba{2}', 'abaa', 'baa'])
:call add(tl, [2, '\vba{3}', 'aabaac'])
:"
:call add(tl, ['\v(ab){1}', 'ab', 'ab', 'ab'])
:call add(tl, ['\v(ab){1}', 'dabc', 'ab', 'ab'])
:call add(tl, ['\v(ab){1}', 'acb'])
:call add(tl, [2, '\v(ab){1}', 'ab', 'ab', 'ab'])
:call add(tl, [2, '\v(ab){1}', 'dabc', 'ab', 'ab'])
:call add(tl, [2, '\v(ab){1}', 'acb'])
:"
:call add(tl, ['\v(ab){0,2}', 'acb', "", ""])
:call add(tl, ['\v(ab){0,2}', 'ab', 'ab', 'ab'])
:call add(tl, ['\v(ab){1,2}', 'ab', 'ab', 'ab'])
:call add(tl, ['\v(ab){1,2}', 'ababc', 'abab', 'ab'])
:call add(tl, ['\v(ab){2,4}', 'ababcab', 'abab', 'ab'])
:call add(tl, ['\v(ab){2,4}', 'abcababa', 'abab', 'ab'])
:call add(tl, [2, '\v(ab){0,2}', 'acb', "", ""])
:call add(tl, [2, '\v(ab){0,2}', 'ab', 'ab', 'ab'])
:call add(tl, [2, '\v(ab){1,2}', 'ab', 'ab', 'ab'])
:call add(tl, [2, '\v(ab){1,2}', 'ababc', 'abab', 'ab'])
:call add(tl, [2, '\v(ab){2,4}', 'ababcab', 'abab', 'ab'])
:call add(tl, [2, '\v(ab){2,4}', 'abcababa', 'abab', 'ab'])
:"
:call add(tl, ['\v(ab){2}', 'abab', 'abab', 'ab'])
:call add(tl, ['\v(ab){2}', 'cdababe', 'abab', 'ab'])
:call add(tl, ['\v(ab){2}', 'abac'])
:call add(tl, ['\v(ab){2}', 'abacabab', 'abab', 'ab'])
:call add(tl, ['\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab'])
:call add(tl, ['\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab'])
:call add(tl, [2, '\v(ab){2}', 'abab', 'abab', 'ab'])
:call add(tl, [2, '\v(ab){2}', 'cdababe', 'abab', 'ab'])
:call add(tl, [2, '\v(ab){2}', 'abac'])
:call add(tl, [2, '\v(ab){2}', 'abacabab', 'abab', 'ab'])
:call add(tl, [2, '\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab'])
:call add(tl, [2, '\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab'])
:"
:call add(tl, ['\v(a{1}){1}', 'a', 'a', 'a'])
:call add(tl, ['\v(a{2}){1}', 'aa', 'aa', 'aa'])
:call add(tl, ['\v(a{2}){1}', 'aaac', 'aa', 'aa'])
:call add(tl, ['\v(a{2}){1}', 'daaac', 'aa', 'aa'])
:call add(tl, ['\v(a{1}){2}', 'daaac', 'aa', 'a'])
:call add(tl, ['\v(a{1}){2}', 'aaa', 'aa', 'a'])
:call add(tl, ['\v(a{2})+', 'adaac', 'aa', 'aa'])
:call add(tl, ['\v(a{2})+', 'aa', 'aa', 'aa'])
:call add(tl, ['\v(a{2}){1}', 'aa', 'aa', 'aa'])
:call add(tl, ['\v(a{1}){2}', 'aa', 'aa', 'a'])
:call add(tl, ['\v(a{1}){1}', 'a', 'a', 'a'])
:call add(tl, ['\v(a{2}){2}', 'aaaa', 'aaaa', 'aa'])
:call add(tl, ['\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa'])
:call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a'])
:call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa'])
:call add(tl, [2, '\v(a{2}){1}', 'aaac', 'aa', 'aa'])
:call add(tl, [2, '\v(a{2}){1}', 'daaac', 'aa', 'aa'])
:call add(tl, [2, '\v(a{1}){2}', 'daaac', 'aa', 'a'])
:call add(tl, [2, '\v(a{1}){2}', 'aaa', 'aa', 'a'])
:call add(tl, [2, '\v(a{2})+', 'adaac', 'aa', 'aa'])
:call add(tl, [2, '\v(a{2})+', 'aa', 'aa', 'aa'])
:call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa'])
:call add(tl, [2, '\v(a{1}){2}', 'aa', 'aa', 'a'])
:call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a'])
:call add(tl, [2, '\v(a{2}){2}', 'aaaa', 'aaaa', 'aa'])
:call add(tl, [2, '\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa'])
:"
:call add(tl, ['\v(a+){2}', 'dadaac', 'aa', 'a'])
:call add(tl, ['\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa'])
:call add(tl, [2, '\v(a+){2}', 'dadaac', 'aa', 'a'])
:call add(tl, [2, '\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa'])
:"
:call add(tl, ['\v(a{1,2}){2}', 'daaac', 'aaa', 'a'])
:call add(tl, ['\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a'])
:call add(tl, ['\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa'])
:call add(tl, ['\v(a{1,3}){3}', 'daac'])
:call add(tl, ['\v(a{1,2}){2}', 'dac'])
:call add(tl, ['\v(a+)+', 'daac', 'aa', 'aa'])
:call add(tl, ['\v(a+)+', 'aaa', 'aaa', 'aaa'])
:call add(tl, ['\v(a+){1,2}', 'aaa', 'aaa', 'aaa'])
:call add(tl, ['\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a'])
:call add(tl, ['\v(a{3})+', 'daaaac', 'aaa', 'aaa'])
:call add(tl, ['\v(a|b|c)+', 'aacb', 'aacb', 'b'])
:call add(tl, ['\v(a|b|c){2}', 'abcb', 'ab', 'b'])
:call add(tl, ['\v(abc){2}', 'abcabd', ])
:call add(tl, ['\v(abc){2}', 'abdabcabc','abcabc', 'abc'])
:call add(tl, [2, '\v(a{1,2}){2}', 'daaac', 'aaa', 'a'])
:call add(tl, [2, '\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a'])
:call add(tl, [2, '\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa'])
:call add(tl, [2, '\v(a{1,3}){3}', 'daac'])
:call add(tl, [2, '\v(a{1,2}){2}', 'dac'])
:call add(tl, [2, '\v(a+)+', 'daac', 'aa', 'aa'])
:call add(tl, [2, '\v(a+)+', 'aaa', 'aaa', 'aaa'])
:call add(tl, [2, '\v(a+){1,2}', 'aaa', 'aaa', 'aaa'])
:call add(tl, [2, '\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a'])
:call add(tl, [2, '\v(a{3})+', 'daaaac', 'aaa', 'aaa'])
:call add(tl, [2, '\v(a|b|c)+', 'aacb', 'aacb', 'b'])
:call add(tl, [2, '\v(a|b|c){2}', 'abcb', 'ab', 'b'])
:call add(tl, [2, '\v(abc){2}', 'abcabd', ])
:call add(tl, [2, '\v(abc){2}', 'abdabcabc','abcabc', 'abc'])
:"
:call add(tl, ['a*', 'cc', ''])
:call add(tl, ['\v(a*)+', 'cc', ''])
:call add(tl, ['\v((ab)+)+', 'ab', 'ab', 'ab', 'ab'])
:call add(tl, ['\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab'])
:call add(tl, ['\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab'])
:call add(tl, ['\v(a{0,2})+', 'cc', ''])
:call add(tl, ['\v(a*)+', '', ''])
:call add(tl, ['\v((a*)+)+', '', ''])
:call add(tl, ['\v((ab)*)+', '', ''])
:call add(tl, ['\va{1,3}', 'aab', 'aa'])
:call add(tl, ['\va{2,3}', 'abaa', 'aa'])
:call add(tl, [2, 'a*', 'cc', ''])
:call add(tl, [2, '\v(a*)+', 'cc', ''])
:call add(tl, [2, '\v((ab)+)+', 'ab', 'ab', 'ab', 'ab'])
:call add(tl, [2, '\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab'])
:call add(tl, [2, '\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab'])
:call add(tl, [2, '\v(a{0,2})+', 'cc', ''])
:call add(tl, [2, '\v(a*)+', '', ''])
:call add(tl, [2, '\v((a*)+)+', '', ''])
:call add(tl, [2, '\v((ab)*)+', '', ''])
:call add(tl, [2, '\va{1,3}', 'aab', 'aa'])
:call add(tl, [2, '\va{2,3}', 'abaa', 'aa'])
:"
:call add(tl, ['\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
:call add(tl, ['\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb'])
:call add(tl, ['\va{2}|b{2}', 'abab'])
:call add(tl, ['\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a'])
:call add(tl, ['\vab{2,3}c', 'aabbccccccccccccc', 'abbc'])
:call add(tl, ['\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc'])
:call add(tl, ['\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde'])
:call add(tl, ['\va(bc){2}d', 'aabcbfbc' ])
:call add(tl, ['\va*a{2}', 'a', ])
:call add(tl, ['\va*a{2}', 'aa', 'aa' ])
:call add(tl, ['\va*a{2}', 'aaa', 'aaa' ])
:call add(tl, ['\va*a{2}', 'bbbabcc', ])
:call add(tl, ['\va*b*|a*c*', 'a', 'a'])
:call add(tl, ['\va{1}b{1}|a{1}b{1}', ''])
:call add(tl, [2, '\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
:call add(tl, [2, '\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb'])
:call add(tl, [2, '\va{2}|b{2}', 'abab'])
:call add(tl, [2, '\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a'])
:call add(tl, [2, '\vab{2,3}c', 'aabbccccccccccccc', 'abbc'])
:call add(tl, [2, '\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc'])
:call add(tl, [2, '\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde'])
:call add(tl, [2, '\va(bc){2}d', 'aabcbfbc' ])
:call add(tl, [2, '\va*a{2}', 'a', ])
:call add(tl, [2, '\va*a{2}', 'aa', 'aa' ])
:call add(tl, [2, '\va*a{2}', 'aaa', 'aaa' ])
:call add(tl, [2, '\va*a{2}', 'bbbabcc', ])
:call add(tl, [2, '\va*b*|a*c*', 'a', 'a'])
:call add(tl, [2, '\va{1}b{1}|a{1}b{1}', ''])
:"
:"submatches
:call add(tl, ['\v(a)', 'ab', 'a', 'a'])
:call add(tl, ['\v(a)(b)', 'ab', 'ab', 'a', 'b'])
:call add(tl, ['\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c'])
:call add(tl, ['\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b'])
:call add(tl, ['\v(a)|(b)', 'ab', 'a', 'a'])
:call add(tl, [2, '\v(a)', 'ab', 'a', 'a'])
:call add(tl, [2, '\v(a)(b)', 'ab', 'ab', 'a', 'b'])
:call add(tl, [2, '\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c'])
:call add(tl, [2, '\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b'])
:call add(tl, [2, '\v(a)|(b)', 'ab', 'a', 'a'])
:"
:call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', ''])
:call add(tl, [2, 'x', 'abcdef'])
:"
:call add(tl, ['\v(a*)+', 'aaaa', 'aaaa', ''])
:call add(tl, ['x', 'abcdef'])
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:""""" Simple tests """""""""""""""""""""""""""""""""""""""""""
:""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
:"
:" Search single groups
:call add(tl, ['ab', 'aab', 'ab'])
:call add(tl, ['ab', 'baced'])
:call add(tl, ['ab', ' ab ', 'ab'])
:call add(tl, [2, 'ab', 'aab', 'ab'])
:call add(tl, [2, 'ab', 'baced'])
:call add(tl, [2, 'ab', ' ab ', 'ab'])
:"
:" Search multi-modifiers
:call add(tl, ['x*', 'xcd', 'x'])
:call add(tl, ['x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
:call add(tl, ['x*', 'abcdoij', '']) " empty match is good
:call add(tl, ['x\+', 'abcdoin']) " no match here
:call add(tl, ['x\+', 'abcdeoijdfxxiuhfij', 'xx'])
:call add(tl, ['x\+', 'xxxxx', 'xxxxx'])
:call add(tl, ['x\+', 'abc x siufhiush xxxxxxxxx', 'x'])
:call add(tl, ['x\=', 'x sdfoij', 'x'])
:call add(tl, ['x\=', 'abc sfoij', '']) " empty match is good
:call add(tl, ['x\=', 'xxxxxxxxx c', 'x'])
:call add(tl, ['x\?', 'x sdfoij', 'x'])
:call add(tl, ['x\?', 'abc sfoij', '']) " empty match is good
:call add(tl, ['x\?', 'xxxxxxxxxx c', 'x'])
:call add(tl, ['a\{0,0}', 'abcdfdoij', ''])
:call add(tl, ['a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?'
:call add(tl, ['a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}'
:call add(tl, ['a\{3,6}', 'aa siofuh'])
:call add(tl, ['a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa'])
:call add(tl, ['a\{3,6}', 'aaaaaaaa', 'aaaaaa'])
:call add(tl, ['a\{0}', 'asoiuj', ''])
:call add(tl, ['a\{2}', 'aaaa', 'aa'])
:call add(tl, ['a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa'])
:call add(tl, ['a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
:call add(tl, ['a\{0,}', 'oij sdigfusnf', '']) " same thing as 'a*'
:call add(tl, ['a\{0,}', 'aaaaa aa', 'aaaaa'])
:call add(tl, ['a\{2,}', 'sdfiougjdsafg'])
:call add(tl, ['a\{2,}', 'aaaaasfoij ', 'aaaaa'])
:call add(tl, ['a\{,0}', 'oidfguih iuhi hiu aaaa', ''])
:call add(tl, ['a\{,5}', 'abcd', 'a'])
:call add(tl, ['a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
:call add(tl, ['a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*'
:call add(tl, ['a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
:call add(tl, ['a\{-0,0}', 'abcdfdoij', ''])
:call add(tl, ['a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?'
:call add(tl, ['a\{-3,6}', 'aa siofuh'])
:call add(tl, ['a\{-3,6}', 'aaaaa asfoij afaa', 'aaa'])
:call add(tl, ['a\{-3,6}', 'aaaaaaaa', 'aaa'])
:call add(tl, ['a\{-0}', 'asoiuj', ''])
:call add(tl, ['a\{-2}', 'aaaa', 'aa'])
:call add(tl, ['a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
:call add(tl, ['a\{-0,}', 'oij sdigfusnf', ''])
:call add(tl, ['a\{-0,}', 'aaaaa aa', ''])
:call add(tl, ['a\{-2,}', 'sdfiougjdsafg'])
:call add(tl, ['a\{-2,}', 'aaaaasfoij ', 'aa'])
:call add(tl, ['a\{-,0}', 'oidfguih iuhi hiu aaaa', ''])
:call add(tl, ['a\{-,5}', 'abcd', ''])
:call add(tl, ['a\{-,5}', 'aaaaaaaaaa', ''])
:call add(tl, ['a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*'
:call add(tl, ['a\{-}', 'aaaaioudfh coisf jda', ''])
:call add(tl, [2, 'x*', 'xcd', 'x'])
:call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx'])
:" empty match is good
:call add(tl, [2, 'x*', 'abcdoij', ''])
:" no match here
:call add(tl, [2, 'x\+', 'abcdoin'])
:call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx'])
:call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx'])
:call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x'])
:call add(tl, [2, 'x\=', 'x sdfoij', 'x'])
:call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good
:call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x'])
:call add(tl, [2, 'x\?', 'x sdfoij', 'x'])
:" empty match is good
:call add(tl, [2, 'x\?', 'abc sfoij', ''])
:call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x'])
:"
:call add(tl, [2, 'a\{0,0}', 'abcdfdoij', ''])
:" same thing as 'a?'
:call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a'])
:" same thing as 'a\{0,1}'
:call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a'])
:call add(tl, [2, 'a\{3,6}', 'aa siofuh'])
:call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa'])
:call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa'])
:call add(tl, [2, 'a\{0}', 'asoiuj', ''])
:call add(tl, [2, 'a\{2}', 'aaaa', 'aa'])
:call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa'])
:call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
:" same thing as 'a*'
:call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', ''])
:call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa'])
:call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg'])
:call add(tl, [0, 'a\{2,}', 'aaaaasfoij ', 'aaaaa'])
:call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', ''])
:call add(tl, [2, 'a\{,5}', 'abcd', 'a'])
:call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa'])
:" same thing as 'a*'
:call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', ''])
:call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa'])
:"
:call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', ''])
:" anti-greedy version of 'a?'
:call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', ''])
:call add(tl, [2, 'a\{-3,6}', 'aa siofuh'])
:call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa'])
:call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa'])
:call add(tl, [2, 'a\{-0}', 'asoiuj', ''])
:call add(tl, [2, 'a\{-2}', 'aaaa', 'aa'])
:call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890'])
:call add(tl, [0, 'a\{-0,}', 'oij sdigfusnf', ''])
:call add(tl, [0, 'a\{-0,}', 'aaaaa aa', ''])
:call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg'])
:call add(tl, [0, 'a\{-2,}', 'aaaaasfoij ', 'aa'])
:call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', ''])
:call add(tl, [2, 'a\{-,5}', 'abcd', ''])
:call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', ''])
:" anti-greedy version of 'a*'
:call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', ''])
:call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', ''])
:"
:" Test groups of characters and submatches
:call add(tl, ['\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
:call add(tl, ['\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
:call add(tl, ['\(abaaaaa\)*cd', 'cd', 'cd', ''])
:call add(tl, ['\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', ''])
:call add(tl, ['\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443'])
:call add(tl, ['\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2'])
:call add(tl, ['\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz'])
:call add(tl, ['\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab'])
:call add(tl, ['\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
:call add(tl, ['\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
:call add(tl, ['\v(a|b*)+', 'aaaa', 'aaaa', ''])
:call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc'])
:call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab'])
:call add(tl, [2, '\(abaaaaa\)*cd', 'cd', 'cd', ''])
:call add(tl, [2, '\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', ''])
:call add(tl, [2, '\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443'])
:call add(tl, [2, '\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2'])
:call add(tl, [2, '\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz'])
:call add(tl, [2, '\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab'])
:call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab'])
:call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', ''])
:call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', ''])
:"
:" Test greedy-ness and lazy-ness
:call add(tl, ['a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
:call add(tl, ['a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
:call add(tl, ['\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz'])
:call add(tl, ['\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
:call add(tl, ['\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
:call add(tl, ['\v(a{-1,3})+','aa','aa','a'])
:call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa'])
:call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa'])
:call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz'])
:call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa',''])
:call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa'])
:call add(tl, [2, '\v(a{-1,3})+','aa','aa','a'])
:"
:" Test Character classes
:call add(tl, ['\d\+e\d\d','test 10e23 fd','10e23'])
:call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23'])
:"
:" Test collections and character range []
:call add(tl, ['\v[a]', 'abcd', 'a'])
:call add(tl, ['a[bcd]', 'abcd', 'ab'])
:call add(tl, ['a[b-d]', 'acbd', 'ac'])
:call add(tl, ['[a-d][e-f][x-x]d', 'cexdxx', 'cexd'])
:call add(tl, ['\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz'])
:call add(tl, ['[[:alpha:]\+]', '6x8','x'])
:call add(tl, ['[^abc]\+','abcabcabc'])
:call add(tl, ['[^abc]','defghiasijvoinasoiunbvb','d'])
:call add(tl, ['[^abc]\+','ddddddda','ddddddd'])
:call add(tl, ['[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC'])
:call add(tl, ['[a-f]*','iiiiiiii',''])
:call add(tl, ['[a-f]*','abcdefgh','abcdef'])
:call add(tl, ['[^a-f]\+','abcdefgh','gh'])
:call add(tl, ['[a-c]\{-3,6}','abcabc','abc'])
:call add(tl, ['[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787'])
:call add(tl, ['[-a]', '-', '-'])
:call add(tl, ['[a-]', '-', '-'])
:call add(tl, ['[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) " filename regexp
:call add(tl, ['[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) " special chars
:call add(tl, ['[[.a.]]\+', 'aa', 'aa']) " collation elem
:call add(tl, ['abc[0-9]*ddd', 'siuhabc ii']) " middle of regexp
:call add(tl, ['abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
:call add(tl, ['\_[0-9]\+', 'asfi9888u', '9888'])
:call add(tl, ['[0-9\n]\+', 'asfi9888u', '9888'])
:call add(tl, [2, '\v[a]', 'abcd', 'a'])
:call add(tl, [2, 'a[bcd]', 'abcd', 'ab'])
:call add(tl, [2, 'a[b-d]', 'acbd', 'ac'])
:call add(tl, [2, '[a-d][e-f][x-x]d', 'cexdxx', 'cexd'])
:call add(tl, [2, '\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz'])
:call add(tl, [2, '[[:alpha:]\+]', '6x8','x'])
:call add(tl, [2, '[^abc]\+','abcabcabc'])
:call add(tl, [2, '[^abc]','defghiasijvoinasoiunbvb','d'])
:call add(tl, [2, '[^abc]\+','ddddddda','ddddddd'])
:call add(tl, [2, '[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC'])
:call add(tl, [2, '[a-f]*','iiiiiiii',''])
:call add(tl, [2, '[a-f]*','abcdefgh','abcdef'])
:call add(tl, [2, '[^a-f]\+','abcdefgh','gh'])
:call add(tl, [2, '[a-c]\{-3,6}','abcabc','abc'])
:call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787'])
:call add(tl, [2, '[-a]', '-', '-'])
:call add(tl, [2, '[a-]', '-', '-'])
:" filename regexp
:call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file'])
:" special chars
:call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^'])
:" collation elem
:call add(tl, [2, '[[.a.]]\+', 'aa', 'aa'])
:" middle of regexp
:call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii'])
:call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd'])
:call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888'])
:call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888'])
:call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"])
:call add(tl, [2, '\_f', " \na ", "\n"])
:call add(tl, [2, '\_f\+', " \na ", "\na"])
:"
:"
:"""" Test recognition of some character classes
:call add(tl, ['[0-9]', '8', '8'])
:call add(tl, ['[^0-9]', '8'])
:call add(tl, ['[0-9a-fA-F]*', '0a7', '0a7'])
:call add(tl, ['[^0-9A-Fa-f]\+', '0a7'])
:call add(tl, ['[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij'])
:call add(tl, ['[a-z]', 'a', 'a'])
: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, [2, '[0-9]', '8', '8'])
:call add(tl, [2, '[^0-9]', '8'])
:call add(tl, [2, '[0-9a-fA-F]*', '0a7', '0a7'])
:call add(tl, [2, '[^0-9A-Fa-f]\+', '0a7'])
:call add(tl, [2, '[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij'])
:call add(tl, [2, '[a-z]', 'a', 'a'])
:call add(tl, [2, '[a-zA-Z]', 'a', 'a'])
:call add(tl, [2, '[A-Z]', 'a'])
:call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
:"
:"""" Tests for \z features
:call add(tl, ['xx \ze test', 'xx ']) " must match after \ze
:call add(tl, ['abc\zeend', 'oij abcend', 'abc'])
:call add(tl, ['abc\zsdd', 'ddabcddxyzt', 'dd'])
:call add(tl, ['aa \zsax', ' ax']) " must match before \zs
:call add(tl, ['abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
:call add(tl, ['\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
:" match ends at \ze
:call add(tl, [2, 'xx \ze test', 'xx '])
:call add(tl, [2, 'abc\zeend', 'oij abcend', 'abc'])
:call add(tl, [2, 'aa\zebb\|aaxx', ' aabb ', 'aa'])
:call add(tl, [2, 'aa\zebb\|aaxx', ' aaxx ', 'aaxx'])
:call add(tl, [2, 'aabb\|aa\zebb', ' aabb ', 'aabb'])
:call add(tl, [2, 'aa\zebb\|aaebb', ' aabb ', 'aa'])
:" match starts at \zs
:call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd'])
:call add(tl, [2, 'aa \zsax', ' ax'])
:call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
:call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
:call add(tl, [2, '\>\zs.', 'aword. ', '.'])
:"
:"""" Tests for \@ features
:call add(tl, ['abc\@=', 'abc', 'ab'])
:call add(tl, ['abc\@=cd', 'abcd', 'abcd'])
:call add(tl, ['abc\@=', 'ababc', 'ab'])
:call add(tl, ['abcd\@=e', 'abcd']) " will never match, no matter the input text
:call add(tl, ['abcd\@=e', 'any text in here ... ']) " will never match
:call add(tl, ['\v(abc)@=..', 'xabcd', 'ab', 'abc'])
:call add(tl, ['\(.*John\)\@=.*Bob', 'here is John, and here is B']) " no match
:call add(tl, ['\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend'])
:call add(tl, ['.*John\&.*Bob', 'here is John, and here is B']) " no match
:call add(tl, ['.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
:call add(tl, ['\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
:call add(tl, [0, 'abc\@=', 'abc', 'ab'])
:call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd'])
:call add(tl, [0, 'abc\@=', 'ababc', 'ab'])
:" will never match, no matter the input text
:call add(tl, [2, 'abcd\@=e', 'abcd'])
:" will never match
:call add(tl, [2, 'abcd\@=e', 'any text in here ... '])
:call add(tl, [0, '\v(abc)@=..', 'xabcd', 'ab', 'abc'])
:" no match
:call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B'])
:call add(tl, [0, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend'])
:" no match
:call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B'])
:call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob'])
:call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1'])
:"
:"""" 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'])
:call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab'])
:call add(tl, [2, '', 'abcd', ''])
:call add(tl, [2, '\v(())', 'any possible text', ''])
:call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz'])
:call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', ''])
:call add(tl, [2, '\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', ' '])
:call add(tl, [2, '\%d32', 'yes no', ' '])
:call add(tl, [2, '\%o40', 'yes no', ' '])
:call add(tl, [2, '\%x20', 'yes no', ' '])
:call add(tl, [2, '\%u0020', 'yes no', ' '])
:call add(tl, [2, '\%U00000020', 'yes no', ' '])
:"
:"""" Alternatives, must use first longest match
:call add(tl, [2, 'goo\|go', 'google', 'goo'])
:call add(tl, [2, '\<goo\|\<go', 'google', 'goo'])
:call add(tl, [2, '\<goo\|go', 'google', 'goo'])
:"
:"""" Back references
:call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc'])
:"call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo'])
:call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i'])
:"
:"""" Look-behind with limit
:call add(tl, [0, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
:call add(tl, [0, '<\@1<=span.', 'xxspanxx<spanyyy', 'spany'])
:call add(tl, [0, '<\@2<=span.', 'xxspanxx<spanyyy', 'spany'])
:call add(tl, [0, '\(<<\)\@<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
:call add(tl, [0, '\(<<\)\@1<=span.', 'xxspanxxxx<spanxx<<spanyyy'])
:call add(tl, [0, '\(<<\)\@2<=span.', 'xxspanxxxx<spanxx<<spanyyy', 'spany', '<<'])
:"
:"""" "\_" prepended negated collection matches EOL
:call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"])
:call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"])
:"
:"
:"""" Run the tests
:"
:for t in tl
: let l = matchlist(t[1], t[0])
: let re = t[0]
: let pat = t[1]
: let text = t[2]
: let matchidx = 3
: for engine in [0, 1, 2]
: if engine == 2 && !re
: continue
: endif
: let &regexpengine = engine
: let l = matchlist(text, pat)
:" check the match itself
: if len(l) == 0 && len(t) > 2
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", did not match, expected: \"' . t[2] . '\"'
: elseif len(l) > 0 && len(t) == 2
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected no match'
: elseif len(t) > 2 && l[0] != t[2]
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected: \"' . t[2] . '\"'
: else
: $put ='OK - ' . t[0]
: endif
: if len(l) > 0
: if len(l) == 0 && len(t) > matchidx
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"'
: elseif len(l) > 0 && len(t) == matchidx
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected no match'
: elseif len(t) > matchidx && l[0] != t[matchidx]
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected: \"' . t[matchidx] . '\"'
: else
: $put ='OK ' . engine . ' - ' . pat
: endif
: if len(l) > 0
:" check all the nine submatches
: for i in range(1, 9)
: if len(t) <= i + 2
: let e = ''
: else
: let e = t[i + 2]
: endif
: if l[i] != e
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
: endif
: endfor
: unlet i
: endif
: for i in range(1, 9)
: if len(t) <= matchidx + i
: let e = ''
: else
: let e = t[matchidx + i]
: endif
: if l[i] != e
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
: endif
: endfor
: unlet i
: endif
: endfor
:endfor
:unlet t tl e l
:"
:" Check that \_[0-9] matching EOL does not break a following \>
:" This only works on a buffer line, not with expression evaluation
/^Find this
/\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>
/\%#=0\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>
y$Gop:"
/^Find this
/\%#=1\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>
y$Gop:"
/^Find this
/\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>
y$Gop:"
:"
:" Check that using a pattern on two lines doesn't get messed up by using
:" matchstr() with \ze in between.
:set re=0
/^Substitute here
:.+1,.+2s/""/\='"'.matchstr(getline("."), '\d\+\ze<').'"'
/^Substitute here
:.+1,.+2yank
Gop:"
:"
:" Check a pattern with a line break matches in the right position.
/^Multiline
/\S.*\nx
:.yank
y$Gop:"
:"
:" Check a pattern with a look beind crossing a line boundary
/^Behind:
/\(<\_[xy]\+\)\@3<=start
:.yank
Gop:"
:"
:" Check patterns matching cursor position.
:func! Postest()
new
call setline(1, ['ffooooo', 'boboooo', 'zoooooo', 'koooooo', 'moooooo', "\t\t\tfoo", 'abababababababfoo', 'bababababababafoo', '********_'])
call setpos('.', [0, 1, 0, 0])
s/\%>3c.//g
call setpos('.', [0, 2, 4, 0])
s/\%#.*$//g
call setpos('.', [0, 3, 0, 0])
s/\%<3c./_/g
%s/\%4l\%>5c./_/g
%s/\%6l\%>25v./_/g
%s/\%>6l\%3c./!/g
%s/\%>7l\%12c./?/g
%s/\%>7l\%<9l\%>5v\%<8v./#/g
1,$yank
quit!
endfunc
Go-0-:set re=0
:call Postest()
:put
o-1-:set re=1
:call Postest()
:put
o-2-:set re=2
:call Postest()
:put
:"
:/\%#=1^Results/,$wq! test.out
ENDTEST
Find this:
localnet/192.168.0.1
Substitute here:
<T="">Ta 5</Title>
<T="">Ac 7</Title>
Multiline:
abc
def
ghi
xjk
lmn
Behind:
asdfasd<yyy
xxstart1
asdfasd<yy
xxxxstart2
asdfasd<yy
xxxstart3
Results of test64:

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,7 @@ See http://svn.python.org/view/python/trunk/Misc/README.valgrind?view=markup
STARTTEST
:so small.vim
:set encoding=latin1
:if !has('python') | e! test.ok | wq! test.out | endif
:lang C
:py import vim
@@ -31,19 +32,29 @@ STARTTEST
:"
:" Extending Dictionary directly with different types
:let d = {}
:py d=vim.bindeval('d')
:py d['1']='asd'
:py d['b']=[1, 2, f]
:py d['-1']={'a': 1}
:let dkeys = []
:py dk=vim.bindeval('dkeys')
:py dkeys=d.keys()
:py dkeys.sort()
:py dk.extend(dkeys)
:$put =string(dkeys)
:for [key, val] in sort(items(d))
: $put =string(key) . ' : ' . string(val)
: unlet key val
:fun d.f()
: return 1
:endfun
py << EOF
d=vim.bindeval('d')
d['1']='asd'
d.update(b=[1, 2, f])
d.update((('-1', {'a': 1}),))
d.update({'0': -1})
dk = d.keys()
dv = d.values()
di = d.items()
dk.sort(key=repr)
dv.sort(key=repr)
di.sort(key=repr)
EOF
:$put =pyeval('d[''f''](self={})')
:$put =pyeval('repr(dk)')
:$put =substitute(pyeval('repr(dv)'),'0x\x\+','','g')
:$put =substitute(pyeval('repr(di)'),'0x\x\+','','g')
:for [key, Val] in sort(items(d))
: $put =string(key) . ' : ' . string(Val)
: unlet key Val
:endfor
:"
:" removing items with del
@@ -60,7 +71,21 @@ STARTTEST
:$put =string(l)
:"
:py del d['-1']
:py del d['f']
:$put =string(pyeval('d.get(''b'', 1)'))
:$put =string(pyeval('d.pop(''b'')'))
:$put =string(pyeval('d.get(''b'', 1)'))
:$put =string(pyeval('d.pop(''1'', 2)'))
:$put =string(pyeval('d.pop(''1'', 2)'))
:$put =pyeval('repr(d.has_key(''0''))')
:$put =pyeval('repr(d.has_key(''1''))')
:$put =pyeval('repr(''0'' in d)')
:$put =pyeval('repr(''1'' in d)')
:$put =pyeval('repr(list(iter(d)))')
:$put =string(d)
:$put =pyeval('repr(d.popitem(''0''))')
:$put =pyeval('repr(d.get(''0''))')
:$put =pyeval('repr(list(iter(d)))')
:"
:" removing items out of range: silently skip items that don't exist
:let l = [0, 1, 2, 3]
@@ -168,9 +193,10 @@ STARTTEST
:catch
: $put =v:exception[:16]
:endtry
:py f=l[0]
:delfunction New
:try
: py l[0](1, 2, 3)
: py f(1, 2, 3)
:catch
: $put =v:exception[:16]
:endtry
@@ -198,6 +224,9 @@ em('d["abc"]=vim')
em('d[""]=1')
em('d["a\\0b"]=1')
em('d[u"a\\0b"]=1')
em('d.pop("abc")')
em('d.popitem("abc")')
EOF
:$put =messages
:unlet messages
@@ -476,6 +505,10 @@ EOF
:py b=vim.current.buffer
:wincmd w
:mark a
:augroup BUFS
: autocmd BufFilePost * python cb.append(vim.eval('expand("<abuf>")') + ':BufFilePost:' + vim.eval('bufnr("%")'))
: autocmd BufFilePre * python cb.append(vim.eval('expand("<abuf>")') + ':BufFilePre:' + vim.eval('bufnr("%")'))
:augroup END
py << EOF
cb = vim.current.buffer
# Tests BufferAppend and BufferItem
@@ -496,9 +529,21 @@ b.append('foo')
b[0]='bar'
b[0:0]=['baz']
vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number)
# Test assigning to name property
old_name = cb.name
cb.name = 'foo'
cb.append(cb.name[-11:])
b.name = 'bar'
cb.append(b.name[-11:])
cb.name = old_name
cb.append(cb.name[-17:])
# Test CheckBuffer
vim.command('bwipeout! ' + str(b.number))
for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'):
for _b in vim.buffers:
if _b is not cb:
vim.command('bwipeout! ' + str(_b.number))
del _b
cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid)))
for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")', 'b.name = "!"'):
try:
exec(expr)
except vim.error:
@@ -507,7 +552,12 @@ for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'):
# Usually a SEGV here
# Should not happen in any case
cb.append('No exception for ' + expr)
vim.command('cd .')
EOF
:augroup BUFS
: autocmd!
:augroup END
:augroup! BUFS
:"
:" Test vim.buffers object
:set hidden
@@ -518,6 +568,10 @@ EOF
:edit c
:buffer #
py << EOF
try:
from __builtin__ import next
except ImportError:
next = lambda o: o.next()
# Check GCing iterator that was not fully exhausted
i = iter(vim.buffers)
cb.append('i:' + str(next(i)))
@@ -577,15 +631,24 @@ py << EOF
cb.append('Number of tabs: ' + str(len(vim.tabpages)))
cb.append('Current tab pages:')
def W(w):
if '(unknown)' in repr(w):
if repr(w).find('(unknown)') != -1:
return '<window object (unknown)>'
else:
return repr(w)
start = len(cb)
def Cursor(w):
if w.buffer is cb:
return repr((start - w.cursor[0], w.cursor[1]))
else:
return repr(w.cursor)
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))
cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w))
# Other values depend on the size of the terminal, so they are checked partly:
for attr in ('height', 'row', 'width', 'col'):
try:
@@ -630,9 +693,13 @@ 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))
ws = list(vim.windows)
ts = list(vim.tabpages)
for b in vim.buffers:
if b is not cb:
vim.command('bwipeout! ' + str(b.number))
cb.append('w.valid: ' + repr([w.valid for w in ws]))
cb.append('t.valid: ' + repr([t.valid for t in ts]))
EOF
:tabonly!
:only!
@@ -653,16 +720,343 @@ for expr, attr in (
cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr)))
EOF
:"
:" Test exceptions
:fun Exe(e)
: execute a:e
:" Test __dir__() method
py << EOF
for name, o in (
('current', vim.current),
('buffer', vim.current.buffer),
('window', vim.current.window),
('tabpage', vim.current.tabpage),
('range', vim.current.range),
('dictionary', vim.bindeval('{}')),
('list', vim.bindeval('[]')),
('function', vim.bindeval('function("tr")')),
('output', sys.stdout),
):
cb.append(name + ':' + ','.join(dir(o)))
del name
del o
EOF
:"
:" Test vim.*.__new__
:$put =string(pyeval('vim.Dictionary({})'))
:$put =string(pyeval('vim.Dictionary(a=1)'))
:$put =string(pyeval('vim.Dictionary(((''a'', 1),))'))
:$put =string(pyeval('vim.List()'))
:$put =string(pyeval('vim.List(iter(''abc''))'))
:$put =string(pyeval('vim.Function(''tr'')'))
:"
:" Test stdout/stderr
:redir => messages
:py sys.stdout.write('abc') ; sys.stdout.write('def')
:py sys.stderr.write('abc') ; sys.stderr.write('def')
:py sys.stdout.writelines(iter('abc'))
:py sys.stderr.writelines(iter('abc'))
:redir END
:$put =string(substitute(messages, '\d\+', '', 'g'))
:" Test subclassing
:fun Put(...)
: $put =string(a:000)
: return a:000
:endfun
py << EOF
class DupDict(vim.Dictionary):
def __setitem__(self, key, value):
super(DupDict, self).__setitem__(key, value)
super(DupDict, self).__setitem__('dup_' + key, value)
dd = DupDict()
dd['a'] = 'b'
class DupList(vim.List):
def __getitem__(self, idx):
return [super(DupList, self).__getitem__(idx)] * 2
dl = DupList()
dl2 = DupList(iter('abc'))
dl.extend(dl2[0])
class DupFun(vim.Function):
def __call__(self, arg):
return super(DupFun, self).__call__(arg, arg)
df = DupFun('Put')
EOF
:$put =string(sort(keys(pyeval('dd'))))
:$put =string(pyeval('dl'))
:$put =string(pyeval('dl2'))
:$put =string(pyeval('df(2)'))
:"
:" Test errors
:fun F() dict
:endfun
:fun D()
:endfun
py << EOF
def ee(expr, g=globals(), l=locals()):
try:
exec(expr, g, l)
except:
cb.append(repr(sys.exc_info()[:2]))
cb.append(expr + ':' + repr(sys.exc_info()[:2]))
else:
cb.append(expr + ':NOT FAILED')
d = vim.Dictionary()
ned = vim.Dictionary(foo='bar', baz='abc')
dl = vim.Dictionary(a=1)
dl.locked = True
l = vim.List()
ll = vim.List('abc')
ll.locked = True
f = vim.Function('string')
fd = vim.Function('F')
fdel = vim.Function('D')
vim.command('delfunction D')
def subexpr_test(expr, name, subexprs):
cb.append('>>> Testing %s using %s' % (name, expr))
for subexpr in subexprs:
ee(expr % subexpr)
cb.append('<<< Finished')
def stringtochars_test(expr):
return subexpr_test(expr, 'StringToChars', (
'1', # Fail type checks
'u"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check
'"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check
))
class Mapping(object):
def __init__(self, d):
self.d = d
def __getitem__(self, key):
return self.d[key]
def keys(self):
return self.d.keys()
def items(self):
return self.d.items()
def convertfrompyobject_test(expr, recurse=True):
# pydict_to_tv
stringtochars_test(expr % '{%s : 1}')
if recurse:
convertfrompyobject_test(expr % '{"abc" : %s}', False)
# pymap_to_tv
stringtochars_test(expr % 'Mapping({%s : 1})')
if recurse:
convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False)
# pyseq_to_tv
iter_test(expr)
return subexpr_test(expr, 'ConvertFromPyObject', (
'None', # Not conversible
'{"": 1}', # Empty key not allowed
'FailingMapping()', #
'FailingMappingKey()', #
))
def convertfrompymapping_test(expr):
convertfrompyobject_test(expr)
return subexpr_test(expr, 'ConvertFromPyMapping', (
'[]',
))
def iter_test(expr):
return subexpr_test(expr, '*Iter*', (
'FailingIter()',
'FailingIterNext()',
))
class FailingTrue(object):
def __nonzero__(self):
raise NotImplementedError
class FailingIter(object):
def __iter__(self):
raise NotImplementedError
class FailingIterNext(object):
def __iter__(self):
return self
def next(self):
raise NotImplementedError
class FailingMappingKey(object):
def __getitem__(self, item):
raise NotImplementedError
def keys(self):
return list("abc")
class FailingMapping(object):
def __getitem__(self):
raise NotImplementedError
def keys(self):
raise NotImplementedError
class FailingList(list):
def __getitem__(self, idx):
if i == 2:
raise NotImplementedError
else:
return super(FailingList, self).__getitem__(idx)
cb.append("> Output")
cb.append(">> OutputSetattr")
ee('del sys.stdout.softspace')
ee('sys.stdout.softspace = []')
ee('sys.stdout.attr = None')
cb.append(">> OutputWrite")
ee('sys.stdout.write(None)')
cb.append(">> OutputWriteLines")
ee('sys.stdout.writelines(None)')
ee('sys.stdout.writelines([1])')
iter_test('sys.stdout.writelines(%s)')
cb.append("> VimCommand")
ee('vim.command(1)')
#! Not checked: vim->python exceptions translating: checked later
cb.append("> VimToPython")
#! Not checked: everything: needs errors in internal python functions
cb.append("> VimEval")
ee('vim.eval(1)')
#! Not checked: everything: needs errors in internal python functions
cb.append("> VimEvalPy")
ee('vim.bindeval(1)')
#! Not checked: vim->python exceptions translating: checked later
cb.append("> VimStrwidth")
ee('vim.strwidth(1)')
cb.append("> Dictionary")
cb.append(">> DictionaryConstructor")
ee('vim.Dictionary("abc")')
##! Not checked: py_dict_alloc failure
cb.append(">> DictionarySetattr")
ee('del d.locked')
ee('d.locked = FailingTrue()')
ee('vim.vvars.locked = False')
ee('d.scope = True')
ee('d.xxx = True')
cb.append(">> _DictionaryItem")
ee('d.get("a", 2, 3)')
stringtochars_test('d.get(%s)')
ee('d.pop("a")')
ee('dl.pop("a")')
cb.append(">> DictionaryIterNext")
ee('for i in ned: ned["a"] = 1')
cb.append(">> DictionaryAssItem")
ee('dl["b"] = 1')
stringtochars_test('d[%s] = 1')
convertfrompyobject_test('d["a"] = %s')
cb.append(">> DictionaryUpdate")
cb.append(">>> kwargs")
cb.append(">>> iter")
ee('d.update(FailingMapping())')
ee('d.update([FailingIterNext()])')
iter_test('d.update(%s)')
convertfrompyobject_test('d.update(%s)')
stringtochars_test('d.update(((%s, 0),))')
convertfrompyobject_test('d.update((("a", %s),))')
cb.append(">> DictionaryPopItem")
ee('d.popitem(1, 2)')
cb.append(">> DictionaryHasKey")
ee('d.has_key()')
cb.append("> List")
cb.append(">> ListConstructor")
ee('vim.List(1, 2)')
ee('vim.List(a=1)')
iter_test('vim.List(%s)')
convertfrompyobject_test('vim.List([%s])')
cb.append(">> ListItem")
ee('l[1000]')
cb.append(">> ListAssItem")
ee('ll[1] = 2')
ee('l[1000] = 3')
cb.append(">> ListAssSlice")
ee('ll[1:100] = "abc"')
iter_test('l[:] = %s')
convertfrompyobject_test('l[:] = [%s]')
cb.append(">> ListConcatInPlace")
iter_test('l.extend(%s)')
convertfrompyobject_test('l.extend([%s])')
cb.append(">> ListSetattr")
ee('del l.locked')
ee('l.locked = FailingTrue()')
ee('l.xxx = True')
cb.append("> Function")
cb.append(">> FunctionConstructor")
ee('vim.Function("123")')
ee('vim.Function("xxx_non_existent_function_xxx")')
ee('vim.Function("xxx#non#existent#function#xxx")')
cb.append(">> FunctionCall")
convertfrompyobject_test('f(%s)')
convertfrompymapping_test('fd(self=%s)')
cb.append("> TabPage")
cb.append(">> TabPageAttr")
ee('vim.current.tabpage.xxx')
cb.append("> TabList")
cb.append(">> TabListItem")
ee('vim.tabpages[1000]')
cb.append("> Window")
cb.append(">> WindowAttr")
ee('vim.current.window.xxx')
cb.append(">> WindowSetattr")
ee('vim.current.window.buffer = 0')
ee('vim.current.window.cursor = (10000000000, 100000000)')
ee('vim.current.window.cursor = True')
ee('vim.current.window.height = "abc"')
ee('vim.current.window.width = "abc"')
ee('vim.current.window.xxxxxx = True')
cb.append("> WinList")
cb.append(">> WinListItem")
ee('vim.windows[1000]')
cb.append("> Buffer")
cb.append(">> StringToLine (indirect)")
ee('vim.current.buffer[0] = "\\na"')
cb.append(">> SetBufferLine (indirect)")
ee('vim.current.buffer[0] = True')
cb.append(">> SetBufferLines (indirect)")
ee('vim.current.buffer[:] = True')
ee('vim.current.buffer[:] = ["\\na", "bc"]')
cb.append(">> InsertBufferLines (indirect)")
ee('vim.current.buffer.append(None)')
ee('vim.current.buffer.append(["\\na", "bc"])')
ee('vim.current.buffer.append("\\nbc")')
cb.append(">> RBItem")
ee('vim.current.buffer[10000000000]')
cb.append(">> RBAsItem")
ee('vim.current.buffer[10000000000] = ""')
cb.append(">> BufferAttr")
ee('vim.current.buffer.xxx')
cb.append(">> BufferSetattr")
ee('vim.current.buffer.name = True')
ee('vim.current.buffer.xxx = True')
cb.append(">> BufferMark")
ee('vim.current.buffer.mark(0)')
ee('vim.current.buffer.mark("abc")')
ee('vim.current.buffer.mark("!")')
cb.append(">> BufferRange")
ee('vim.current.buffer.range(1, 2, 3)')
cb.append("> BufMap")
cb.append(">> BufMapItem")
ee('vim.buffers[None]')
ee('vim.buffers[100000000]')
cb.append("> Current")
cb.append(">> CurrentGetattr")
ee('vim.current.xxx')
cb.append(">> CurrentSetattr")
ee('vim.current.line = True')
ee('vim.current.buffer = True')
ee('vim.current.window = True')
ee('vim.current.tabpage = True')
ee('vim.current.xxx = True')
EOF
:"
:" Test exceptions
:fun Exe(e)
: execute a:e
:endfun
py << EOF
Exe = vim.bindeval('function("Exe")')
ee('vim.command("throw \'abc\'")')
ee('Exe("throw \'def\'")')

View File

@@ -4,13 +4,31 @@ start:
Vim(put):E684:
[0, 'as''d', [1, 2, function('strlen'), {'a': 1}]]
[0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]]
['-1', '1', 'b']
1
['-1', '0', '1', 'b', 'f']
['asd', -1L, <vim.Function '1'>, <vim.dictionary object at >, <vim.list object at >]
[('-1', <vim.dictionary object at >), ('0', -1L), ('1', 'asd'), ('b', <vim.list object at >), ('f', <vim.Function '1'>)]
'-1' : {'a': 1}
'0' : -1
'1' : 'asd'
'b' : [1, 2, function('strlen')]
'f' : function('1')
[0, function('strlen')]
[3]
{'1': 'asd', 'b': [1, 2, function('strlen')]}
[1, 2, function('strlen')]
[1, 2, function('strlen')]
1
'asd'
2
True
False
True
False
['0']
{'0': -1}
('', -1L)
None
[]
[0, 1, 2, 3]
[0, 1, 2, 3]
[0, 1, 3]
@@ -44,6 +62,8 @@ TypeError
ValueError
TypeError
TypeError
KeyError
KeyError
d : locked:0;scope:0
dl : locked:1;scope:0
v: : locked:2;scope:1
@@ -166,6 +186,7 @@ jkl
inv: -100! KeyError
gopts1! KeyError
p/wopts1: 8
inv: -100! error
p/bopts1! KeyError
inv: -100! KeyError
bopts1! KeyError
@@ -184,6 +205,7 @@ jkl
inv: 'abc'! KeyError
gopts1! KeyError
p/wopts1: ''
inv: 'abc'! error
p/bopts1! KeyError
inv: 'abc'! KeyError
bopts1! KeyError
@@ -317,14 +339,24 @@ bar
Second line
Third line
foo
1:BufFilePre:1
1:BufFilePost:1
testdir/foo
5:BufFilePre:5
5:BufFilePost:5
testdir/bar
1:BufFilePre:1
1:BufFilePost:1
testdir/test86.in
valid: b:False, cb:True
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>
8:<buffer a>=<buffer a>
9:<buffer b>=<buffer b>
10:<buffer c>=<buffer c>
4
i4:<buffer test86.in>
i4:<buffer test86.in>
@@ -333,7 +365,7 @@ Number of tabs: 4
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 (990, 0)
<window object (unknown)>(1): displays buffer <buffer test86.in>; cursor is at (37, 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)
@@ -359,6 +391,8 @@ 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'
w.valid: [True, False]
t.valid: [True, False, True, False]
vim.vars:Dictionary:True
vim.options:Options:True
vim.bindeval("{}"):Dictionary:True
@@ -368,9 +402,680 @@ vim.current.buffer:Buffer:True
vim.current.range:Range:True
vim.current.window:Window:True
vim.current.tabpage:TabPage:True
(<class 'vim.error'>, error('abc',))
(<class 'vim.error'>, error('def',))
(<class 'vim.error'>, error('ghi',))
(<class 'vim.error'>, error('Vim(echoerr):jkl',))
(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
current:__dir__,__members__,buffer,line,range,tabpage,window
buffer:__dir__,__members__,append,mark,name,number,options,range,valid,vars
window:__dir__,__members__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars
tabpage:__dir__,__members__,number,valid,vars,window,windows
range:__dir__,__members__,append,end,start
dictionary:__dir__,__members__,get,has_key,items,keys,locked,pop,popitem,scope,update,values
list:__dir__,__members__,extend,locked
function:__dir__,__members__,softspace
output:__dir__,__members__,flush,softspace,write,writelines
{}
{'a': 1}
{'a': 1}
[]
['a', 'b', 'c']
function('tr')
'
abcdef
line :
abcdef
abc
line :
abc'
['a', 'dup_a']
['a', 'a']
['a', 'b', 'c']
[2, 2]
[2, 2]
> Output
>> OutputSetattr
del sys.stdout.softspace:(<type 'exceptions.AttributeError'>, AttributeError("can't delete OutputObject attributes",))
sys.stdout.softspace = []:(<type 'exceptions.TypeError'>, TypeError('softspace must be an integer',))
sys.stdout.attr = None:(<type 'exceptions.AttributeError'>, AttributeError('invalid attribute',))
>> OutputWrite
sys.stdout.write(None):(<type 'exceptions.TypeError'>, TypeError('coercing to Unicode: need string or buffer, NoneType found',))
>> OutputWriteLines
sys.stdout.writelines(None):(<type 'exceptions.TypeError'>, TypeError("'NoneType' object is not iterable",))
sys.stdout.writelines([1]):(<type 'exceptions.TypeError'>, TypeError('writelines() requires list of strings',))
>>> Testing *Iter* using sys.stdout.writelines(%s)
sys.stdout.writelines(FailingIter()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
sys.stdout.writelines(FailingIterNext()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
> VimCommand
vim.command(1):(<type 'exceptions.TypeError'>, TypeError('must be string, not int',))
> VimToPython
> VimEval
vim.eval(1):(<type 'exceptions.TypeError'>, TypeError('must be string, not int',))
> VimEvalPy
vim.bindeval(1):(<type 'exceptions.TypeError'>, TypeError('must be string, not int',))
> VimStrwidth
vim.strwidth(1):(<type 'exceptions.TypeError'>, TypeError('must be string, not int',))
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abc"):(<type 'exceptions.ValueError'>, ValueError('expected sequence element of size 2',))
>> DictionarySetattr
del d.locked:(<type 'exceptions.AttributeError'>, AttributeError('cannot delete vim.Dictionary attributes',))
d.locked = FailingTrue():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
vim.vvars.locked = False:(<type 'exceptions.TypeError'>, TypeError('cannot modify fixed dictionary',))
d.scope = True:(<type 'exceptions.AttributeError'>, AttributeError('cannot set this attribute',))
d.xxx = True:(<type 'exceptions.AttributeError'>, AttributeError('cannot set this attribute',))
>> _DictionaryItem
d.get("a", 2, 3):(<type 'exceptions.TypeError'>, TypeError('function takes at most 2 arguments (3 given)',))
>>> Testing StringToChars using d.get(%s)
d.get(1):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.get(u"\0"):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.get("\0"):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
d.pop("a"):(<type 'exceptions.KeyError'>, KeyError('a',))
dl.pop("a"):(<class 'vim.error'>, error('dict is locked',))
>> DictionaryIterNext
for i in ned: ned["a"] = 1:(<type 'exceptions.RuntimeError'>, RuntimeError('hashtab changed during iteration',))
>> DictionaryAssItem
dl["b"] = 1:(<class 'vim.error'>, error('dict is locked',))
>>> Testing StringToChars using d[%s] = 1
d[1] = 1:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d[u"\0"] = 1:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["\0"] = 1:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d["a"] = {%s : 1}
d["a"] = {1 : 1}:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d["a"] = {u"\0" : 1}:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["a"] = {"\0" : 1}:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}}
d["a"] = {"abc" : {1 : 1}}:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d["a"] = {"abc" : {u"\0" : 1}}:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["a"] = {"abc" : {"\0" : 1}}:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})}
d["a"] = {"abc" : Mapping({1 : 1})}:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d["a"] = {"abc" : Mapping({u"\0" : 1})}:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["a"] = {"abc" : Mapping({"\0" : 1})}:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using d["a"] = {"abc" : %s}
d["a"] = {"abc" : FailingIter()}:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = {"abc" : FailingIterNext()}:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s}
d["a"] = {"abc" : None}:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = {"abc" : {"": 1}}:(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d["a"] = {"abc" : FailingMapping()}:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d["a"] = {"abc" : FailingMappingKey()}:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d["a"] = Mapping({%s : 1})
d["a"] = Mapping({1 : 1}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d["a"] = Mapping({u"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["a"] = Mapping({"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}})
d["a"] = Mapping({"abc" : {1 : 1}}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d["a"] = Mapping({"abc" : {u"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["a"] = Mapping({"abc" : {"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})})
d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using d["a"] = Mapping({"abc" : %s})
d["a"] = Mapping({"abc" : FailingIter()}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = Mapping({"abc" : FailingIterNext()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s})
d["a"] = Mapping({"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = Mapping({"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d["a"] = Mapping({"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d["a"] = Mapping({"abc" : FailingMappingKey()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using d["a"] = %s
d["a"] = FailingIter():(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = FailingIterNext():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = %s
d["a"] = None:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = {"": 1}:(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d["a"] = FailingMapping():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d["a"] = FailingMappingKey():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>> DictionaryUpdate
>>> kwargs
>>> iter
d.update(FailingMapping()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update([FailingIterNext()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
>>> Testing *Iter* using d.update(%s)
d.update(FailingIter()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update(FailingIterNext()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update({%s : 1})
d.update({1 : 1}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update({u"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update({"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update({"abc" : {%s : 1}})
d.update({"abc" : {1 : 1}}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update({"abc" : {u"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update({"abc" : {"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})})
d.update({"abc" : Mapping({1 : 1})}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update({"abc" : Mapping({u"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update({"abc" : Mapping({"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using d.update({"abc" : %s})
d.update({"abc" : FailingIter()}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update({"abc" : FailingIterNext()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update({"abc" : %s})
d.update({"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update({"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update({"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update({"abc" : FailingMappingKey()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update(Mapping({%s : 1}))
d.update(Mapping({1 : 1})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update(Mapping({u"\0" : 1})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update(Mapping({"\0" : 1})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}}))
d.update(Mapping({"abc" : {1 : 1}})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update(Mapping({"abc" : {u"\0" : 1}})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update(Mapping({"abc" : {"\0" : 1}})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})}))
d.update(Mapping({"abc" : Mapping({1 : 1})})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using d.update(Mapping({"abc" : %s}))
d.update(Mapping({"abc" : FailingIter()})):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update(Mapping({"abc" : FailingIterNext()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s}))
d.update(Mapping({"abc" : None})):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update(Mapping({"abc" : {"": 1}})):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update(Mapping({"abc" : FailingMapping()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update(Mapping({"abc" : FailingMappingKey()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using d.update(%s)
d.update(FailingIter()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update(FailingIterNext()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update(%s)
d.update(None):(<type 'exceptions.TypeError'>, TypeError("'NoneType' object is not iterable",))
d.update({"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update(FailingMapping()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update(FailingMappingKey()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update(((%s, 0),))
d.update(((1, 0),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update(((u"\0", 0),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("\0", 0),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update((("a", {%s : 1}),))
d.update((("a", {1 : 1}),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update((("a", {u"\0" : 1}),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("a", {"\0" : 1}),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),))
d.update((("a", {"abc" : {1 : 1}}),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update((("a", {"abc" : {u"\0" : 1}}),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("a", {"abc" : {"\0" : 1}}),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),))
d.update((("a", {"abc" : Mapping({1 : 1})}),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using d.update((("a", {"abc" : %s}),))
d.update((("a", {"abc" : FailingIter()}),)):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", {"abc" : FailingIterNext()}),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),))
d.update((("a", {"abc" : None}),)):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", {"abc" : {"": 1}}),)):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", {"abc" : FailingMapping()}),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update((("a", {"abc" : FailingMappingKey()}),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
d.update((("a", Mapping({1 : 1})),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update((("a", Mapping({u"\0" : 1})),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("a", Mapping({"\0" : 1})),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),))
d.update((("a", Mapping({"abc" : {1 : 1}})),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),))
d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),))
d.update((("a", Mapping({"abc" : FailingIter()})),)):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),))
d.update((("a", Mapping({"abc" : None})),)):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", Mapping({"abc" : {"": 1}})),)):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", Mapping({"abc" : FailingMapping()})),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using d.update((("a", %s),))
d.update((("a", FailingIter()),)):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", FailingIterNext()),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", %s),))
d.update((("a", None),)):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", {"": 1}),)):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", FailingMapping()),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
d.update((("a", FailingMappingKey()),)):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>> DictionaryPopItem
d.popitem(1, 2):(<type 'exceptions.TypeError'>, TypeError('function takes exactly 1 argument (2 given)',))
>> DictionaryHasKey
d.has_key():(<type 'exceptions.TypeError'>, TypeError('function takes exactly 1 argument (0 given)',))
> List
>> ListConstructor
vim.List(1, 2):(<type 'exceptions.TypeError'>, TypeError('function takes at most 1 argument (2 given)',))
vim.List(a=1):(<type 'exceptions.TypeError'>, TypeError('list constructor does not accept keyword arguments',))
>>> Testing *Iter* using vim.List(%s)
vim.List(FailingIter()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
vim.List(FailingIterNext()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using vim.List([{%s : 1}])
vim.List([{1 : 1}]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.List([{u"\0" : 1}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
vim.List([{"\0" : 1}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}])
vim.List([{"abc" : {1 : 1}}]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.List([{"abc" : {u"\0" : 1}}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
vim.List([{"abc" : {"\0" : 1}}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}])
vim.List([{"abc" : Mapping({1 : 1})}]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.List([{"abc" : Mapping({u"\0" : 1})}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
vim.List([{"abc" : Mapping({"\0" : 1})}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using vim.List([{"abc" : %s}])
vim.List([{"abc" : FailingIter()}]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([{"abc" : FailingIterNext()}]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}])
vim.List([{"abc" : None}]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([{"abc" : {"": 1}}]):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
vim.List([{"abc" : FailingMapping()}]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
vim.List([{"abc" : FailingMappingKey()}]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using vim.List([Mapping({%s : 1})])
vim.List([Mapping({1 : 1})]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.List([Mapping({u"\0" : 1})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
vim.List([Mapping({"\0" : 1})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})])
vim.List([Mapping({"abc" : {1 : 1}})]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.List([Mapping({"abc" : {u"\0" : 1}})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
vim.List([Mapping({"abc" : {"\0" : 1}})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})])
vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using vim.List([Mapping({"abc" : %s})])
vim.List([Mapping({"abc" : FailingIter()})]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([Mapping({"abc" : FailingIterNext()})]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})])
vim.List([Mapping({"abc" : None})]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([Mapping({"abc" : {"": 1}})]):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
vim.List([Mapping({"abc" : FailingMapping()})]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
vim.List([Mapping({"abc" : FailingMappingKey()})]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using vim.List([%s])
vim.List([FailingIter()]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([FailingIterNext()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([%s])
vim.List([None]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([{"": 1}]):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
vim.List([FailingMapping()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
vim.List([FailingMappingKey()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>> ListItem
l[1000]:(<type 'exceptions.IndexError'>, IndexError('list index out of range',))
>> ListAssItem
ll[1] = 2:(<class 'vim.error'>, error('list is locked',))
l[1000] = 3:(<type 'exceptions.IndexError'>, IndexError('list index out of range',))
>> ListAssSlice
ll[1:100] = "abc":(<class 'vim.error'>, error('list is locked',))
>>> Testing *Iter* using l[:] = %s
l[:] = FailingIter():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l[:] = FailingIterNext():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l[:] = [{%s : 1}]
l[:] = [{1 : 1}]:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l[:] = [{u"\0" : 1}]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l[:] = [{"\0" : 1}]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}]
l[:] = [{"abc" : {1 : 1}}]:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l[:] = [{"abc" : {u"\0" : 1}}]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l[:] = [{"abc" : {"\0" : 1}}]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}]
l[:] = [{"abc" : Mapping({1 : 1})}]:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l[:] = [{"abc" : Mapping({u"\0" : 1})}]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l[:] = [{"abc" : Mapping({"\0" : 1})}]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using l[:] = [{"abc" : %s}]
l[:] = [{"abc" : FailingIter()}]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [{"abc" : FailingIterNext()}]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}]
l[:] = [{"abc" : None}]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [{"abc" : {"": 1}}]:(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
l[:] = [{"abc" : FailingMapping()}]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l[:] = [{"abc" : FailingMappingKey()}]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
l[:] = [Mapping({1 : 1})]:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l[:] = [Mapping({u"\0" : 1})]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l[:] = [Mapping({"\0" : 1})]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})]
l[:] = [Mapping({"abc" : {1 : 1}})]:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l[:] = [Mapping({"abc" : {u"\0" : 1}})]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l[:] = [Mapping({"abc" : {"\0" : 1}})]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})]
l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})]
l[:] = [Mapping({"abc" : FailingIter()})]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [Mapping({"abc" : FailingIterNext()})]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})]
l[:] = [Mapping({"abc" : None})]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [Mapping({"abc" : {"": 1}})]:(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
l[:] = [Mapping({"abc" : FailingMapping()})]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l[:] = [Mapping({"abc" : FailingMappingKey()})]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using l[:] = [%s]
l[:] = [FailingIter()]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [FailingIterNext()]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [%s]
l[:] = [None]:(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [{"": 1}]:(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
l[:] = [FailingMapping()]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l[:] = [FailingMappingKey()]:(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>> ListConcatInPlace
>>> Testing *Iter* using l.extend(%s)
l.extend(FailingIter()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l.extend(FailingIterNext()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l.extend([{%s : 1}])
l.extend([{1 : 1}]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l.extend([{u"\0" : 1}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l.extend([{"\0" : 1}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}])
l.extend([{"abc" : {1 : 1}}]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l.extend([{"abc" : {u"\0" : 1}}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l.extend([{"abc" : {"\0" : 1}}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}])
l.extend([{"abc" : Mapping({1 : 1})}]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l.extend([{"abc" : Mapping({u"\0" : 1})}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l.extend([{"abc" : Mapping({"\0" : 1})}]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using l.extend([{"abc" : %s}])
l.extend([{"abc" : FailingIter()}]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([{"abc" : FailingIterNext()}]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}])
l.extend([{"abc" : None}]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([{"abc" : {"": 1}}]):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
l.extend([{"abc" : FailingMapping()}]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l.extend([{"abc" : FailingMappingKey()}]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l.extend([Mapping({%s : 1})])
l.extend([Mapping({1 : 1})]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l.extend([Mapping({u"\0" : 1})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l.extend([Mapping({"\0" : 1})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})])
l.extend([Mapping({"abc" : {1 : 1}})]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l.extend([Mapping({"abc" : {u"\0" : 1}})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l.extend([Mapping({"abc" : {"\0" : 1}})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})])
l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using l.extend([Mapping({"abc" : %s})])
l.extend([Mapping({"abc" : FailingIter()})]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([Mapping({"abc" : FailingIterNext()})]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})])
l.extend([Mapping({"abc" : None})]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([Mapping({"abc" : {"": 1}})]):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
l.extend([Mapping({"abc" : FailingMapping()})]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l.extend([Mapping({"abc" : FailingMappingKey()})]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using l.extend([%s])
l.extend([FailingIter()]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([FailingIterNext()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([%s])
l.extend([None]):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([{"": 1}]):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
l.extend([FailingMapping()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l.extend([FailingMappingKey()]):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>> ListSetattr
del l.locked:(<type 'exceptions.AttributeError'>, AttributeError('cannot delete vim.List attributes',))
l.locked = FailingTrue():(<type 'exceptions.NotImplementedError'>, NotImplementedError())
l.xxx = True:(<type 'exceptions.AttributeError'>, AttributeError('cannot set this attribute',))
> Function
>> FunctionConstructor
vim.Function("123"):(<type 'exceptions.ValueError'>, ValueError('unnamed function does not exist',))
vim.Function("xxx_non_existent_function_xxx"):(<type 'exceptions.ValueError'>, ValueError('function does not exist',))
vim.Function("xxx#non#existent#function#xxx"):NOT FAILED
>> FunctionCall
>>> Testing StringToChars using f({%s : 1})
f({1 : 1}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
f({u"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
f({"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using f({"abc" : {%s : 1}})
f({"abc" : {1 : 1}}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
f({"abc" : {u"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
f({"abc" : {"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using f({"abc" : Mapping({%s : 1})})
f({"abc" : Mapping({1 : 1})}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
f({"abc" : Mapping({u"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
f({"abc" : Mapping({"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using f({"abc" : %s})
f({"abc" : FailingIter()}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
f({"abc" : FailingIterNext()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using f({"abc" : %s})
f({"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
f({"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
f({"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
f({"abc" : FailingMappingKey()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using f(Mapping({%s : 1}))
f(Mapping({1 : 1})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
f(Mapping({u"\0" : 1})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
f(Mapping({"\0" : 1})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}}))
f(Mapping({"abc" : {1 : 1}})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
f(Mapping({"abc" : {u"\0" : 1}})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
f(Mapping({"abc" : {"\0" : 1}})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})}))
f(Mapping({"abc" : Mapping({1 : 1})})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
f(Mapping({"abc" : Mapping({u"\0" : 1})})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
f(Mapping({"abc" : Mapping({"\0" : 1})})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using f(Mapping({"abc" : %s}))
f(Mapping({"abc" : FailingIter()})):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
f(Mapping({"abc" : FailingIterNext()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s}))
f(Mapping({"abc" : None})):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
f(Mapping({"abc" : {"": 1}})):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
f(Mapping({"abc" : FailingMapping()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
f(Mapping({"abc" : FailingMappingKey()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using f(%s)
f(FailingIter()):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
f(FailingIterNext()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using f(%s)
f(None):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
f({"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
f(FailingMapping()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
f(FailingMappingKey()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using fd(self={%s : 1})
fd(self={1 : 1}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
fd(self={u"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
fd(self={"\0" : 1}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using fd(self={"abc" : {%s : 1}})
fd(self={"abc" : {1 : 1}}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
fd(self={"abc" : {u"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
fd(self={"abc" : {"\0" : 1}}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})})
fd(self={"abc" : Mapping({1 : 1})}):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
fd(self={"abc" : Mapping({u"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
fd(self={"abc" : Mapping({"\0" : 1})}):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using fd(self={"abc" : %s})
fd(self={"abc" : FailingIter()}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
fd(self={"abc" : FailingIterNext()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using fd(self={"abc" : %s})
fd(self={"abc" : None}):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
fd(self={"abc" : {"": 1}}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
fd(self={"abc" : FailingMapping()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
fd(self={"abc" : FailingMappingKey()}):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using fd(self=Mapping({%s : 1}))
fd(self=Mapping({1 : 1})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
fd(self=Mapping({u"\0" : 1})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
fd(self=Mapping({"\0" : 1})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}}))
fd(self=Mapping({"abc" : {1 : 1}})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
fd(self=Mapping({"abc" : {u"\0" : 1}})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
fd(self=Mapping({"abc" : {"\0" : 1}})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})}))
fd(self=Mapping({"abc" : Mapping({1 : 1})})):(<type 'exceptions.TypeError'>, TypeError('object must be string',))
fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(<type 'exceptions.TypeError'>, TypeError('expected string without null bytes',))
<<< Finished
>>> Testing *Iter* using fd(self=Mapping({"abc" : %s}))
fd(self=Mapping({"abc" : FailingIter()})):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
fd(self=Mapping({"abc" : FailingIterNext()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s}))
fd(self=Mapping({"abc" : None})):(<type 'exceptions.TypeError'>, TypeError('unable to convert to vim structure',))
fd(self=Mapping({"abc" : {"": 1}})):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
fd(self=Mapping({"abc" : FailingMapping()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
fd(self=Mapping({"abc" : FailingMappingKey()})):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using fd(self=%s)
fd(self=FailingIter()):(<type 'exceptions.TypeError'>, TypeError('unable to convert object to vim dictionary',))
fd(self=FailingIterNext()):(<type 'exceptions.TypeError'>, TypeError('unable to convert object to vim dictionary',))
<<< Finished
>>> Testing ConvertFromPyObject using fd(self=%s)
fd(self=None):(<type 'exceptions.TypeError'>, TypeError('unable to convert object to vim dictionary',))
fd(self={"": 1}):(<type 'exceptions.ValueError'>, ValueError('empty keys are not allowed',))
fd(self=FailingMapping()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
fd(self=FailingMappingKey()):(<type 'exceptions.NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyMapping using fd(self=%s)
fd(self=[]):(<type 'exceptions.TypeError'>, TypeError('unable to convert object to vim dictionary',))
<<< Finished
> TabPage
>> TabPageAttr
vim.current.tabpage.xxx:(<type 'exceptions.AttributeError'>, AttributeError('xxx',))
> TabList
>> TabListItem
vim.tabpages[1000]:(<type 'exceptions.IndexError'>, IndexError('no such tab page',))
> Window
>> WindowAttr
vim.current.window.xxx:(<type 'exceptions.AttributeError'>, AttributeError('xxx',))
>> WindowSetattr
vim.current.window.buffer = 0:(<type 'exceptions.TypeError'>, TypeError('readonly attribute',))
vim.current.window.cursor = (10000000000, 100000000):(<class 'vim.error'>, error('cursor position outside buffer',))
vim.current.window.cursor = True:(<type 'exceptions.TypeError'>, TypeError('argument must be 2-item sequence, not bool',))
vim.current.window.height = "abc":(<type 'exceptions.TypeError'>, TypeError('an integer is required',))
vim.current.window.width = "abc":(<type 'exceptions.TypeError'>, TypeError('an integer is required',))
vim.current.window.xxxxxx = True:(<type 'exceptions.AttributeError'>, AttributeError('xxxxxx',))
> WinList
>> WinListItem
vim.windows[1000]:(<type 'exceptions.IndexError'>, IndexError('no such window',))
> Buffer
>> StringToLine (indirect)
vim.current.buffer[0] = "\na":(<class 'vim.error'>, error('string cannot contain newlines',))
>> SetBufferLine (indirect)
vim.current.buffer[0] = True:(<type 'exceptions.TypeError'>, TypeError('bad argument type for built-in operation',))
>> SetBufferLines (indirect)
vim.current.buffer[:] = True:(<type 'exceptions.TypeError'>, TypeError('bad argument type for built-in operation',))
vim.current.buffer[:] = ["\na", "bc"]:(<class 'vim.error'>, error('string cannot contain newlines',))
>> InsertBufferLines (indirect)
vim.current.buffer.append(None):(<type 'exceptions.TypeError'>, TypeError('bad argument type for built-in operation',))
vim.current.buffer.append(["\na", "bc"]):(<class 'vim.error'>, error('string cannot contain newlines',))
vim.current.buffer.append("\nbc"):(<class 'vim.error'>, error('string cannot contain newlines',))
>> RBItem
vim.current.buffer[10000000000]:(<type 'exceptions.IndexError'>, IndexError('line number out of range',))
>> RBAsItem
vim.current.buffer[10000000000] = "":(<type 'exceptions.IndexError'>, IndexError('line number out of range',))
>> BufferAttr
vim.current.buffer.xxx:(<type 'exceptions.AttributeError'>, AttributeError('xxx',))
>> BufferSetattr
vim.current.buffer.name = True:(<type 'exceptions.TypeError'>, TypeError('object must be string',))
vim.current.buffer.xxx = True:(<type 'exceptions.AttributeError'>, AttributeError('xxx',))
>> BufferMark
vim.current.buffer.mark(0):(<type 'exceptions.TypeError'>, TypeError('must be string, not int',))
vim.current.buffer.mark("abc"):(<type 'exceptions.ValueError'>, ValueError('mark name must be a single character',))
vim.current.buffer.mark("!"):(<class 'vim.error'>, error('invalid mark name',))
>> BufferRange
vim.current.buffer.range(1, 2, 3):(<type 'exceptions.TypeError'>, TypeError('function takes exactly 2 arguments (3 given)',))
> BufMap
>> BufMapItem
vim.buffers[None]:(<type 'exceptions.TypeError'>, TypeError('key must be integer',))
vim.buffers[100000000]:(<type 'exceptions.KeyError'>, KeyError(100000000,))
> Current
>> CurrentGetattr
vim.current.xxx:(<type 'exceptions.AttributeError'>, AttributeError('xxx',))
>> CurrentSetattr
vim.current.line = True:(<type 'exceptions.TypeError'>, TypeError('bad argument type for built-in operation',))
vim.current.buffer = True:(<type 'exceptions.TypeError'>, TypeError('expected vim.Buffer object',))
vim.current.window = True:(<type 'exceptions.TypeError'>, TypeError('expected vim.Window object',))
vim.current.tabpage = True:(<type 'exceptions.TypeError'>, TypeError('expected vim.TabPage object',))
vim.current.xxx = True:(<type 'exceptions.AttributeError'>, AttributeError('xxx',))
vim.command("throw 'abc'"):(<class 'vim.error'>, error('abc',))
Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))
vim.eval("Exe('echoerr ''jkl''')"):(<class 'vim.error'>, error('Vim(echoerr):jkl',))
vim.eval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))

View File

@@ -26,19 +26,29 @@ STARTTEST
:"
:" Extending Dictionary directly with different types
:let d = {}
:py3 d=vim.bindeval('d')
:py3 d['1']='asd'
:py3 d['b']=[1, 2, f]
:py3 d['-1']={'a': 1}
:let dkeys = []
:py3 dk=vim.bindeval('dkeys')
:py3 dkeys=d.keys()
:py3 dkeys.sort()
:py3 dk+=dkeys
:$put =string(dkeys)
:for [key, val] in sort(items(d))
: $put =string(key) . ' : ' . string(val)
: unlet key val
:fun d.f()
: return 1
:endfun
py3 << EOF
d=vim.bindeval('d')
d['1']='asd'
d.update(b=[1, 2, f])
d.update((('-1', {'a': 1}),))
d.update({'0': -1})
dk = d.keys()
dv = d.values()
di = d.items()
dk.sort(key=repr)
dv.sort(key=repr)
di.sort(key=repr)
EOF
:$put =py3eval('d[''f''](self={})')
:$put =py3eval('repr(dk)')
:$put =substitute(py3eval('repr(dv)'),'0x\x\+','','g')
:$put =substitute(py3eval('repr(di)'),'0x\x\+','','g')
:for [key, Val] in sort(items(d))
: $put =string(key) . ' : ' . string(Val)
: unlet key Val
:endfor
:"
:" removing items with del
@@ -55,7 +65,21 @@ STARTTEST
:$put =string(l)
:"
:py3 del d['-1']
:py3 del d['f']
:$put =string(py3eval('d.get(''b'', 1)'))
:$put =string(py3eval('d.pop(''b'')'))
:$put =string(py3eval('d.get(''b'', 1)'))
:$put =string(py3eval('d.pop(''1'', 2)'))
:$put =string(py3eval('d.pop(''1'', 2)'))
:$put =py3eval('repr(d.has_key(''0''))')
:$put =py3eval('repr(d.has_key(''1''))')
:$put =py3eval('repr(''0'' in d)')
:$put =py3eval('repr(''1'' in d)')
:$put =py3eval('repr(list(iter(d)))')
:$put =string(d)
:$put =py3eval('repr(d.popitem(''0''))')
:$put =py3eval('repr(d.get(''0''))')
:$put =py3eval('repr(list(iter(d)))')
:"
:" removing items out of range: silently skip items that don't exist
:let l = [0, 1, 2, 3]
@@ -163,9 +187,10 @@ STARTTEST
:catch
: $put =v:exception[:13]
:endtry
:py3 f=l[0]
:delfunction New
:try
: py3 l[0](1, 2, 3)
: py3 f(1, 2, 3)
:catch
: $put =v:exception[:13]
:endtry
@@ -181,35 +206,21 @@ STARTTEST
:py3 <<EOF
d=vim.bindeval('{}')
m=vim.bindeval('messages')
try:
d['abc']
except Exception as e:
m.extend([e.__class__.__name__])
def em(expr, g=globals(), l=locals()):
try:
exec(expr, g, l)
except Exception as e:
m.extend([e.__class__.__name__])
try:
d['abc']="\0"
except Exception as e:
m.extend([e.__class__.__name__])
em('d["abc"]')
em('d["abc"]="\\0"')
em('d["abc"]=vim')
em('d[""]=1')
em('d["a\\0b"]=1')
em('d[b"a\\0b"]=1')
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__])
em('d.pop("abc")')
em('d.popitem("abc")')
EOF
:$put =messages
:unlet messages
@@ -463,6 +474,10 @@ EOF
:py3 b=vim.current.buffer
:wincmd w
:mark a
:augroup BUFS
: autocmd BufFilePost * python3 cb.append(vim.eval('expand("<abuf>")') + ':BufFilePost:' + vim.eval('bufnr("%")'))
: autocmd BufFilePre * python3 cb.append(vim.eval('expand("<abuf>")') + ':BufFilePre:' + vim.eval('bufnr("%")'))
:augroup END
py3 << EOF
cb = vim.current.buffer
# Tests BufferAppend and BufferItem
@@ -483,8 +498,20 @@ b.append('foo')
b[0]='bar'
b[0:0]=['baz']
vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number)
# Test assigning to name property
old_name = cb.name
cb.name = 'foo'
cb.append(cb.name[-11:])
b.name = 'bar'
cb.append(b.name[-11:])
cb.name = old_name
cb.append(cb.name[-17:])
# Test CheckBuffer
vim.command('bwipeout! ' + str(b.number))
for _b in vim.buffers:
if _b is not cb:
vim.command('bwipeout! ' + str(_b.number))
del _b
cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid)))
for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'):
try:
exec(expr)
@@ -494,6 +521,7 @@ for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'):
# Usually a SEGV here
# Should not happen in any case
cb.append('No exception for ' + expr)
vim.command('cd .')
EOF
:"
:" Test vim.buffers object
@@ -561,18 +589,26 @@ EOF
:vnew b.2
:vnew c.2
py3 << 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)
cb.append('Number of tabs: ' + str(len(vim.tabpages)))
cb.append('Current tab pages:')
def Cursor(w, start=len(cb)):
if w.buffer is cb:
return repr((start - w.cursor[0], w.cursor[1]))
else:
return repr(w.cursor)
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))
cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w))
# Other values depend on the size of the terminal, so they are checked partly:
for attr in ('height', 'row', 'width', 'col'):
try:
@@ -617,9 +653,13 @@ 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))
ws = list(vim.windows)
ts = list(vim.tabpages)
for b in vim.buffers:
if b is not cb:
vim.command('bwipeout! ' + str(b.number))
cb.append('w.valid: ' + repr([w.valid for w in ws]))
cb.append('t.valid: ' + repr([t.valid for t in ts]))
EOF
:tabonly!
:only!
@@ -640,16 +680,347 @@ for expr, attr in (
cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr)))
EOF
:"
:" Test __dir__() method
py3 << EOF
for name, o in (
('current', vim.current),
('buffer', vim.current.buffer),
('window', vim.current.window),
('tabpage', vim.current.tabpage),
('range', vim.current.range),
('dictionary', vim.bindeval('{}')),
('list', vim.bindeval('[]')),
('function', vim.bindeval('function("tr")')),
('output', sys.stdout),
):
cb.append(name + ':' + ','.join(dir(o)))
del name
del o
EOF
:"
:" Test vim.*.__new__
:$put =string(py3eval('vim.Dictionary({})'))
:$put =string(py3eval('vim.Dictionary(a=1)'))
:$put =string(py3eval('vim.Dictionary(((''a'', 1),))'))
:$put =string(py3eval('vim.List()'))
:$put =string(py3eval('vim.List(iter(''abc''))'))
:$put =string(py3eval('vim.Function(''tr'')'))
:"
:" Test stdout/stderr
:redir => messages
:py sys.stdout.write('abc') ; sys.stdout.write('def')
:py sys.stderr.write('abc') ; sys.stderr.write('def')
:py sys.stdout.writelines(iter('abc'))
:py sys.stderr.writelines(iter('abc'))
:redir END
:$put =string(substitute(messages, '\d\+', '', 'g'))
:" Test subclassing
:fun Put(...)
: $put =string(a:000)
: return a:000
:endfun
py3 << EOF
class DupDict(vim.Dictionary):
def __setitem__(self, key, value):
super(DupDict, self).__setitem__(key, value)
super(DupDict, self).__setitem__('dup_' + key, value)
dd = DupDict()
dd['a'] = 'b'
class DupList(vim.List):
def __getitem__(self, idx):
return [super(DupList, self).__getitem__(idx)] * 2
dl = DupList()
dl2 = DupList(iter('abc'))
dl.extend(dl2[0])
class DupFun(vim.Function):
def __call__(self, arg):
return super(DupFun, self).__call__(arg, arg)
df = DupFun('Put')
EOF
:$put =string(sort(keys(py3eval('dd'))))
:$put =string(py3eval('dl'))
:$put =string(py3eval('dl2'))
:$put =string(py3eval('df(2)'))
:"
:" Test errors
:fun F() dict
:endfun
:fun D()
:endfun
py3 << EOF
def ee(expr, g=globals(), l=locals()):
try:
try:
exec(expr, g, l)
except Exception as e:
cb.append(expr + ':' + repr((e.__class__, e)))
else:
cb.append(expr + ':NOT FAILED')
except Exception as e:
cb.append(expr + '::' + repr((e.__class__, e)))
d = vim.Dictionary()
ned = vim.Dictionary(foo='bar', baz='abc')
dl = vim.Dictionary(a=1)
dl.locked = True
l = vim.List()
ll = vim.List('abc')
ll.locked = True
f = vim.Function('string')
fd = vim.Function('F')
fdel = vim.Function('D')
vim.command('delfunction D')
def subexpr_test(expr, name, subexprs):
cb.append('>>> Testing %s using %s' % (name, expr))
for subexpr in subexprs:
ee(expr % subexpr)
cb.append('<<< Finished')
def stringtochars_test(expr):
return subexpr_test(expr, 'StringToChars', (
'1', # Fail type checks
'u"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check
'"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check
))
class Mapping(object):
def __init__(self, d):
self.d = d
def __getitem__(self, key):
return self.d[key]
def keys(self):
return self.d.keys()
def items(self):
return self.d.items()
def convertfrompyobject_test(expr, recurse=True):
# pydict_to_tv
stringtochars_test(expr % '{%s : 1}')
if recurse:
convertfrompyobject_test(expr % '{"abc" : %s}', False)
# pymap_to_tv
stringtochars_test(expr % 'Mapping({%s : 1})')
if recurse:
convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False)
# pyseq_to_tv
iter_test(expr)
return subexpr_test(expr, 'ConvertFromPyObject', (
'None', # Not conversible
'{"": 1}', # Empty key not allowed
'FailingMapping()', #
'FailingMappingKey()', #
))
def convertfrompymapping_test(expr):
convertfrompyobject_test(expr)
return subexpr_test(expr, 'ConvertFromPyMapping', (
'[]',
))
def iter_test(expr):
return subexpr_test(expr, '*Iter*', (
'FailingIter()',
'FailingIterNext()',
))
class FailingTrue(object):
def __bool__(self):
raise NotImplementedError
class FailingIter(object):
def __iter__(self):
raise NotImplementedError
class FailingIterNext(object):
def __iter__(self):
return self
def __next__(self):
raise NotImplementedError
class FailingMappingKey(object):
def __getitem__(self, item):
raise NotImplementedError
def keys(self):
return list("abc")
class FailingMapping(object):
def __getitem__(self):
raise NotImplementedError
def keys(self):
raise NotImplementedError
class FailingList(list):
def __getitem__(self, idx):
if i == 2:
raise NotImplementedError
else:
return super(FailingList, self).__getitem__(idx)
cb.append("> Output")
cb.append(">> OutputSetattr")
ee('del sys.stdout.softspace')
ee('sys.stdout.softspace = []')
ee('sys.stdout.attr = None')
cb.append(">> OutputWrite")
ee('sys.stdout.write(None)')
cb.append(">> OutputWriteLines")
ee('sys.stdout.writelines(None)')
ee('sys.stdout.writelines([1])')
iter_test('sys.stdout.writelines(%s)')
cb.append("> VimCommand")
ee('vim.command(1)')
#! Not checked: vim->python exceptions translating: checked later
cb.append("> VimToPython")
#! Not checked: everything: needs errors in internal python functions
cb.append("> VimEval")
ee('vim.eval(1)')
#! Not checked: everything: needs errors in internal python functions
cb.append("> VimEvalPy")
ee('vim.bindeval(1)')
#! Not checked: vim->python exceptions translating: checked later
cb.append("> VimStrwidth")
ee('vim.strwidth(1)')
cb.append("> Dictionary")
cb.append(">> DictionaryConstructor")
ee('vim.Dictionary("abc")')
##! Not checked: py_dict_alloc failure
cb.append(">> DictionarySetattr")
ee('del d.locked')
ee('d.locked = FailingTrue()')
ee('vim.vvars.locked = False')
ee('d.scope = True')
ee('d.xxx = True')
cb.append(">> _DictionaryItem")
ee('d.get("a", 2, 3)')
stringtochars_test('d.get(%s)')
ee('d.pop("a")')
ee('dl.pop("a")')
cb.append(">> DictionaryIterNext")
ee('for i in ned: ned["a"] = 1')
cb.append(">> DictionaryAssItem")
ee('dl["b"] = 1')
stringtochars_test('d[%s] = 1')
convertfrompyobject_test('d["a"] = %s')
cb.append(">> DictionaryUpdate")
cb.append(">>> kwargs")
cb.append(">>> iter")
ee('d.update(FailingMapping())')
ee('d.update([FailingIterNext()])')
iter_test('d.update(%s)')
convertfrompyobject_test('d.update(%s)')
stringtochars_test('d.update(((%s, 0),))')
convertfrompyobject_test('d.update((("a", %s),))')
cb.append(">> DictionaryPopItem")
ee('d.popitem(1, 2)')
cb.append(">> DictionaryHasKey")
ee('d.has_key()')
cb.append("> List")
cb.append(">> ListConstructor")
ee('vim.List(1, 2)')
ee('vim.List(a=1)')
iter_test('vim.List(%s)')
convertfrompyobject_test('vim.List([%s])')
cb.append(">> ListItem")
ee('l[1000]')
cb.append(">> ListAssItem")
ee('ll[1] = 2')
ee('l[1000] = 3')
cb.append(">> ListAssSlice")
ee('ll[1:100] = "abc"')
iter_test('l[:] = %s')
convertfrompyobject_test('l[:] = [%s]')
cb.append(">> ListConcatInPlace")
iter_test('l.extend(%s)')
convertfrompyobject_test('l.extend([%s])')
cb.append(">> ListSetattr")
ee('del l.locked')
ee('l.locked = FailingTrue()')
ee('l.xxx = True')
cb.append("> Function")
cb.append(">> FunctionConstructor")
ee('vim.Function("123")')
ee('vim.Function("xxx_non_existent_function_xxx")')
ee('vim.Function("xxx#non#existent#function#xxx")')
cb.append(">> FunctionCall")
convertfrompyobject_test('f(%s)')
convertfrompymapping_test('fd(self=%s)')
cb.append("> TabPage")
cb.append(">> TabPageAttr")
ee('vim.current.tabpage.xxx')
cb.append("> TabList")
cb.append(">> TabListItem")
ee('vim.tabpages[1000]')
cb.append("> Window")
cb.append(">> WindowAttr")
ee('vim.current.window.xxx')
cb.append(">> WindowSetattr")
ee('vim.current.window.buffer = 0')
ee('vim.current.window.cursor = (10000000000, 100000000)')
ee('vim.current.window.cursor = True')
ee('vim.current.window.height = "abc"')
ee('vim.current.window.width = "abc"')
ee('vim.current.window.xxxxxx = True')
cb.append("> WinList")
cb.append(">> WinListItem")
ee('vim.windows[1000]')
cb.append("> Buffer")
cb.append(">> StringToLine (indirect)")
ee('vim.current.buffer[0] = "\\na"')
cb.append(">> SetBufferLine (indirect)")
ee('vim.current.buffer[0] = True')
cb.append(">> SetBufferLines (indirect)")
ee('vim.current.buffer[:] = True')
ee('vim.current.buffer[:] = ["\\na", "bc"]')
cb.append(">> InsertBufferLines (indirect)")
ee('vim.current.buffer.append(None)')
ee('vim.current.buffer.append(["\\na", "bc"])')
ee('vim.current.buffer.append("\\nbc")')
cb.append(">> RBItem")
ee('vim.current.buffer[10000000000]')
cb.append(">> RBAsItem")
ee('vim.current.buffer[10000000000] = ""')
cb.append(">> BufferAttr")
ee('vim.current.buffer.xxx')
cb.append(">> BufferSetattr")
ee('vim.current.buffer.name = True')
ee('vim.current.buffer.xxx = True')
cb.append(">> BufferMark")
ee('vim.current.buffer.mark(0)')
ee('vim.current.buffer.mark("abc")')
ee('vim.current.buffer.mark("!")')
cb.append(">> BufferRange")
ee('vim.current.buffer.range(1, 2, 3)')
cb.append("> BufMap")
cb.append(">> BufMapItem")
ee('vim.buffers[None]')
ee('vim.buffers[100000000]')
cb.append("> Current")
cb.append(">> CurrentGetattr")
ee('vim.current.xxx')
cb.append(">> CurrentSetattr")
ee('vim.current.line = True')
ee('vim.current.buffer = True')
ee('vim.current.window = True')
ee('vim.current.tabpage = True')
ee('vim.current.xxx = True')
EOF
:"
:" Test exceptions
:fun Exe(e)
: execute a:e
:endfun
py3 << EOF
def ee(expr, g=globals(), l=locals()):
try:
exec(expr, g, l)
except Exception as e:
cb.append(repr((e.__class__, e)))
Exe = vim.bindeval('function("Exe")')
ee('vim.command("throw \'abc\'")')
ee('Exe("throw \'def\'")')

View File

@@ -4,13 +4,31 @@ start:
Vim(put):E684:
[0, 'as''d', [1, 2, function('strlen'), {'a': 1}]]
[0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]]
['-1', '1', 'b']
1
[b'-1', b'0', b'1', b'b', b'f']
[-1, <vim.Function '1'>, <vim.dictionary object at >, <vim.list object at >, b'asd']
[(b'-1', <vim.dictionary object at >), (b'0', -1), (b'1', b'asd'), (b'b', <vim.list object at >), (b'f', <vim.Function '1'>)]
'-1' : {'a': 1}
'0' : -1
'1' : 'asd'
'b' : [1, 2, function('strlen')]
'f' : function('1')
[0, function('strlen')]
[3]
{'1': 'asd', 'b': [1, 2, function('strlen')]}
[1, 2, function('strlen')]
[1, 2, function('strlen')]
1
'asd'
2
True
False
True
False
[b'0']
{'0': -1}
(b'', -1)
None
[]
[0, 1, 2, 3]
[0, 1, 2, 3]
[0, 1, 3]
@@ -44,6 +62,8 @@ TypeError
ValueError
TypeError
TypeError
KeyError
KeyError
d : locked:0;scope:0
dl : locked:1;scope:0
v: : locked:2;scope:1
@@ -155,6 +175,7 @@ jkl
inv: -100! KeyError
gopts1! KeyError
p/wopts1: 8
inv: -100! error
p/bopts1! KeyError
inv: -100! KeyError
bopts1! KeyError
@@ -173,6 +194,7 @@ jkl
inv: 'abc'! KeyError
gopts1! KeyError
p/wopts1: b''
inv: 'abc'! error
p/bopts1! KeyError
inv: 'abc'! KeyError
bopts1! KeyError
@@ -306,14 +328,24 @@ bar
Second line
Third line
foo
1:BufFilePre:1
1:BufFilePost:1
testdir/foo
5:BufFilePre:5
5:BufFilePost:5
testdir/bar
1:BufFilePre:1
1:BufFilePost:1
testdir/test87.in
valid: b:False, cb:True
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>
8:<buffer a>=<buffer a>
9:<buffer b>=<buffer b>
10:<buffer c>=<buffer c>
4
i4:<buffer test87.in>
i4:<buffer test87.in>
@@ -322,7 +354,7 @@ Number of tabs: 4
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 (966, 0)
<window object (unknown)>(1): displays buffer <buffer test87.in>; cursor is at (37, 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)
@@ -348,6 +380,8 @@ 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'
w.valid: [True, False]
t.valid: [True, False, True, False]
vim.vars:Dictionary:True
vim.options:Options:True
vim.bindeval("{}"):Dictionary:True
@@ -357,9 +391,680 @@ vim.current.buffer:Buffer:True
vim.current.range:Range:True
vim.current.window:Window:True
vim.current.tabpage:TabPage:True
(<class 'vim.error'>, error('abc',))
(<class 'vim.error'>, error('def',))
(<class 'vim.error'>, error('ghi',))
(<class 'vim.error'>, error('Vim(echoerr):jkl',))
(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
current:__dir__,buffer,line,range,tabpage,window
buffer:__dir__,append,mark,name,number,options,range,valid,vars
window:__dir__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars
tabpage:__dir__,number,valid,vars,window,windows
range:__dir__,append,end,start
dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values
list:__dir__,extend,locked
function:__dir__,softspace
output:__dir__,flush,softspace,write,writelines
{}
{'a': 1}
{'a': 1}
[]
['a', 'b', 'c']
function('tr')
'
abcdef
line :
abcdef
abc
line :
abc'
['a', 'dup_a']
['a', 'a']
['a', 'b', 'c']
[2, 2]
[2, 2]
> Output
>> OutputSetattr
del sys.stdout.softspace:(<class 'AttributeError'>, AttributeError("can't delete OutputObject attributes",))
sys.stdout.softspace = []:(<class 'TypeError'>, TypeError('softspace must be an integer',))
sys.stdout.attr = None:(<class 'AttributeError'>, AttributeError('invalid attribute',))
>> OutputWrite
sys.stdout.write(None):(<class 'TypeError'>, TypeError("Can't convert 'NoneType' object to str implicitly",))
>> OutputWriteLines
sys.stdout.writelines(None):(<class 'TypeError'>, TypeError("'NoneType' object is not iterable",))
sys.stdout.writelines([1]):(<class 'TypeError'>, TypeError('writelines() requires list of strings',))
>>> Testing *Iter* using sys.stdout.writelines(%s)
sys.stdout.writelines(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
sys.stdout.writelines(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
> VimCommand
vim.command(1):(<class 'TypeError'>, TypeError('must be str, not int',))
> VimToPython
> VimEval
vim.eval(1):(<class 'TypeError'>, TypeError('must be str, not int',))
> VimEvalPy
vim.bindeval(1):(<class 'TypeError'>, TypeError('must be str, not int',))
> VimStrwidth
vim.strwidth(1):(<class 'TypeError'>, TypeError('must be str, not int',))
> Dictionary
>> DictionaryConstructor
vim.Dictionary("abc"):(<class 'ValueError'>, ValueError('expected sequence element of size 2',))
>> DictionarySetattr
del d.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.Dictionary attributes',))
d.locked = FailingTrue():(<class 'NotImplementedError'>, NotImplementedError())
vim.vvars.locked = False:(<class 'TypeError'>, TypeError('cannot modify fixed dictionary',))
d.scope = True:(<class 'AttributeError'>, AttributeError('cannot set this attribute',))
d.xxx = True:(<class 'AttributeError'>, AttributeError('cannot set this attribute',))
>> _DictionaryItem
d.get("a", 2, 3):(<class 'TypeError'>, TypeError('function takes at most 2 arguments (3 given)',))
>>> Testing StringToChars using d.get(%s)
d.get(1):(<class 'TypeError'>, TypeError('object must be string',))
d.get(u"\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.get("\0"):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
d.pop("a"):(<class 'KeyError'>, KeyError('a',))
dl.pop("a"):(<class 'vim.error'>, error('dict is locked',))
>> DictionaryIterNext
for i in ned: ned["a"] = 1:(<class 'RuntimeError'>, RuntimeError('hashtab changed during iteration',))
>> DictionaryAssItem
dl["b"] = 1:(<class 'vim.error'>, error('dict is locked',))
>>> Testing StringToChars using d[%s] = 1
d[1] = 1:(<class 'TypeError'>, TypeError('object must be string',))
d[u"\0"] = 1:(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["\0"] = 1:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d["a"] = {%s : 1}
d["a"] = {1 : 1}:(<class 'TypeError'>, TypeError('object must be string',))
d["a"] = {u"\0" : 1}:(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["a"] = {"\0" : 1}:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}}
d["a"] = {"abc" : {1 : 1}}:(<class 'TypeError'>, TypeError('object must be string',))
d["a"] = {"abc" : {u"\0" : 1}}:(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["a"] = {"abc" : {"\0" : 1}}:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})}
d["a"] = {"abc" : Mapping({1 : 1})}:(<class 'TypeError'>, TypeError('object must be string',))
d["a"] = {"abc" : Mapping({u"\0" : 1})}:(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["a"] = {"abc" : Mapping({"\0" : 1})}:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using d["a"] = {"abc" : %s}
d["a"] = {"abc" : FailingIter()}:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = {"abc" : FailingIterNext()}:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s}
d["a"] = {"abc" : None}:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = {"abc" : {"": 1}}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d["a"] = {"abc" : FailingMapping()}:(<class 'NotImplementedError'>, NotImplementedError())
d["a"] = {"abc" : FailingMappingKey()}:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d["a"] = Mapping({%s : 1})
d["a"] = Mapping({1 : 1}):(<class 'TypeError'>, TypeError('object must be string',))
d["a"] = Mapping({u"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["a"] = Mapping({"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}})
d["a"] = Mapping({"abc" : {1 : 1}}):(<class 'TypeError'>, TypeError('object must be string',))
d["a"] = Mapping({"abc" : {u"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["a"] = Mapping({"abc" : {"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})})
d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(<class 'TypeError'>, TypeError('object must be string',))
d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using d["a"] = Mapping({"abc" : %s})
d["a"] = Mapping({"abc" : FailingIter()}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = Mapping({"abc" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s})
d["a"] = Mapping({"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = Mapping({"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d["a"] = Mapping({"abc" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
d["a"] = Mapping({"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using d["a"] = %s
d["a"] = FailingIter():(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = FailingIterNext():(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d["a"] = %s
d["a"] = None:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d["a"] = {"": 1}:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d["a"] = FailingMapping():(<class 'NotImplementedError'>, NotImplementedError())
d["a"] = FailingMappingKey():(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>> DictionaryUpdate
>>> kwargs
>>> iter
d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
d.update([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError())
>>> Testing *Iter* using d.update(%s)
d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
d.update(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update({%s : 1})
d.update({1 : 1}):(<class 'TypeError'>, TypeError('object must be string',))
d.update({u"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update({"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update({"abc" : {%s : 1}})
d.update({"abc" : {1 : 1}}):(<class 'TypeError'>, TypeError('object must be string',))
d.update({"abc" : {u"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update({"abc" : {"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})})
d.update({"abc" : Mapping({1 : 1})}):(<class 'TypeError'>, TypeError('object must be string',))
d.update({"abc" : Mapping({u"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update({"abc" : Mapping({"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using d.update({"abc" : %s})
d.update({"abc" : FailingIter()}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update({"abc" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update({"abc" : %s})
d.update({"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update({"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d.update({"abc" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
d.update({"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update(Mapping({%s : 1}))
d.update(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('object must be string',))
d.update(Mapping({u"\0" : 1})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update(Mapping({"\0" : 1})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}}))
d.update(Mapping({"abc" : {1 : 1}})):(<class 'TypeError'>, TypeError('object must be string',))
d.update(Mapping({"abc" : {u"\0" : 1}})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update(Mapping({"abc" : {"\0" : 1}})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})}))
d.update(Mapping({"abc" : Mapping({1 : 1})})):(<class 'TypeError'>, TypeError('object must be string',))
d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using d.update(Mapping({"abc" : %s}))
d.update(Mapping({"abc" : FailingIter()})):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update(Mapping({"abc" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s}))
d.update(Mapping({"abc" : None})):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update(Mapping({"abc" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d.update(Mapping({"abc" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
d.update(Mapping({"abc" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using d.update(%s)
d.update(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
d.update(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update(%s)
d.update(None):(<class 'TypeError'>, TypeError("'NoneType' object is not iterable",))
d.update({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d.update(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
d.update(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update(((%s, 0),))
d.update(((1, 0),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update(((u"\0", 0),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("\0", 0),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update((("a", {%s : 1}),))
d.update((("a", {1 : 1}),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update((("a", {u"\0" : 1}),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("a", {"\0" : 1}),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),))
d.update((("a", {"abc" : {1 : 1}}),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update((("a", {"abc" : {u"\0" : 1}}),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("a", {"abc" : {"\0" : 1}}),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),))
d.update((("a", {"abc" : Mapping({1 : 1})}),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using d.update((("a", {"abc" : %s}),))
d.update((("a", {"abc" : FailingIter()}),)):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", {"abc" : FailingIterNext()}),)):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),))
d.update((("a", {"abc" : None}),)):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", {"abc" : {"": 1}}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", {"abc" : FailingMapping()}),)):(<class 'NotImplementedError'>, NotImplementedError())
d.update((("a", {"abc" : FailingMappingKey()}),)):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),))
d.update((("a", Mapping({1 : 1})),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update((("a", Mapping({u"\0" : 1})),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("a", Mapping({"\0" : 1})),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),))
d.update((("a", Mapping({"abc" : {1 : 1}})),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),))
d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(<class 'TypeError'>, TypeError('object must be string',))
d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),))
d.update((("a", Mapping({"abc" : FailingIter()})),)):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),))
d.update((("a", Mapping({"abc" : None})),)):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", Mapping({"abc" : {"": 1}})),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", Mapping({"abc" : FailingMapping()})),)):(<class 'NotImplementedError'>, NotImplementedError())
d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using d.update((("a", %s),))
d.update((("a", FailingIter()),)):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", FailingIterNext()),)):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using d.update((("a", %s),))
d.update((("a", None),)):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
d.update((("a", {"": 1}),)):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
d.update((("a", FailingMapping()),)):(<class 'NotImplementedError'>, NotImplementedError())
d.update((("a", FailingMappingKey()),)):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>> DictionaryPopItem
d.popitem(1, 2):(<class 'TypeError'>, TypeError('function takes exactly 1 argument (2 given)',))
>> DictionaryHasKey
d.has_key():(<class 'TypeError'>, TypeError('function takes exactly 1 argument (0 given)',))
> List
>> ListConstructor
vim.List(1, 2):(<class 'TypeError'>, TypeError('function takes at most 1 argument (2 given)',))
vim.List(a=1):(<class 'TypeError'>, TypeError('list constructor does not accept keyword arguments',))
>>> Testing *Iter* using vim.List(%s)
vim.List(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
vim.List(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using vim.List([{%s : 1}])
vim.List([{1 : 1}]):(<class 'TypeError'>, TypeError('object must be string',))
vim.List([{u"\0" : 1}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
vim.List([{"\0" : 1}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}])
vim.List([{"abc" : {1 : 1}}]):(<class 'TypeError'>, TypeError('object must be string',))
vim.List([{"abc" : {u"\0" : 1}}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
vim.List([{"abc" : {"\0" : 1}}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}])
vim.List([{"abc" : Mapping({1 : 1})}]):(<class 'TypeError'>, TypeError('object must be string',))
vim.List([{"abc" : Mapping({u"\0" : 1})}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
vim.List([{"abc" : Mapping({"\0" : 1})}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using vim.List([{"abc" : %s}])
vim.List([{"abc" : FailingIter()}]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([{"abc" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}])
vim.List([{"abc" : None}]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([{"abc" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
vim.List([{"abc" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
vim.List([{"abc" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using vim.List([Mapping({%s : 1})])
vim.List([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('object must be string',))
vim.List([Mapping({u"\0" : 1})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
vim.List([Mapping({"\0" : 1})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})])
vim.List([Mapping({"abc" : {1 : 1}})]):(<class 'TypeError'>, TypeError('object must be string',))
vim.List([Mapping({"abc" : {u"\0" : 1}})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
vim.List([Mapping({"abc" : {"\0" : 1}})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})])
vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(<class 'TypeError'>, TypeError('object must be string',))
vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using vim.List([Mapping({"abc" : %s})])
vim.List([Mapping({"abc" : FailingIter()})]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([Mapping({"abc" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})])
vim.List([Mapping({"abc" : None})]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([Mapping({"abc" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
vim.List([Mapping({"abc" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
vim.List([Mapping({"abc" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using vim.List([%s])
vim.List([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using vim.List([%s])
vim.List([None]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
vim.List([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
vim.List([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
vim.List([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>> ListItem
l[1000]:(<class 'IndexError'>, IndexError('list index out of range',))
>> ListAssItem
ll[1] = 2:(<class 'vim.error'>, error('list is locked',))
l[1000] = 3:(<class 'IndexError'>, IndexError('list index out of range',))
>> ListAssSlice
ll[1:100] = "abc":(<class 'vim.error'>, error('list is locked',))
>>> Testing *Iter* using l[:] = %s
l[:] = FailingIter():(<class 'NotImplementedError'>, NotImplementedError())
l[:] = FailingIterNext()::(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l[:] = [{%s : 1}]
l[:] = [{1 : 1}]:(<class 'TypeError'>, TypeError('object must be string',))
l[:] = [{u"\0" : 1}]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
l[:] = [{"\0" : 1}]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}]
l[:] = [{"abc" : {1 : 1}}]:(<class 'TypeError'>, TypeError('object must be string',))
l[:] = [{"abc" : {u"\0" : 1}}]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
l[:] = [{"abc" : {"\0" : 1}}]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}]
l[:] = [{"abc" : Mapping({1 : 1})}]:(<class 'TypeError'>, TypeError('object must be string',))
l[:] = [{"abc" : Mapping({u"\0" : 1})}]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
l[:] = [{"abc" : Mapping({"\0" : 1})}]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using l[:] = [{"abc" : %s}]
l[:] = [{"abc" : FailingIter()}]:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [{"abc" : FailingIterNext()}]:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}]
l[:] = [{"abc" : None}]:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [{"abc" : {"": 1}}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
l[:] = [{"abc" : FailingMapping()}]:(<class 'NotImplementedError'>, NotImplementedError())
l[:] = [{"abc" : FailingMappingKey()}]:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l[:] = [Mapping({%s : 1})]
l[:] = [Mapping({1 : 1})]:(<class 'TypeError'>, TypeError('object must be string',))
l[:] = [Mapping({u"\0" : 1})]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
l[:] = [Mapping({"\0" : 1})]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})]
l[:] = [Mapping({"abc" : {1 : 1}})]:(<class 'TypeError'>, TypeError('object must be string',))
l[:] = [Mapping({"abc" : {u"\0" : 1}})]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
l[:] = [Mapping({"abc" : {"\0" : 1}})]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})]
l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(<class 'TypeError'>, TypeError('object must be string',))
l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})]
l[:] = [Mapping({"abc" : FailingIter()})]:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [Mapping({"abc" : FailingIterNext()})]:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})]
l[:] = [Mapping({"abc" : None})]:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [Mapping({"abc" : {"": 1}})]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
l[:] = [Mapping({"abc" : FailingMapping()})]:(<class 'NotImplementedError'>, NotImplementedError())
l[:] = [Mapping({"abc" : FailingMappingKey()})]:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using l[:] = [%s]
l[:] = [FailingIter()]:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [FailingIterNext()]:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l[:] = [%s]
l[:] = [None]:(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l[:] = [{"": 1}]:(<class 'ValueError'>, ValueError('empty keys are not allowed',))
l[:] = [FailingMapping()]:(<class 'NotImplementedError'>, NotImplementedError())
l[:] = [FailingMappingKey()]:(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>> ListConcatInPlace
>>> Testing *Iter* using l.extend(%s)
l.extend(FailingIter()):(<class 'NotImplementedError'>, NotImplementedError())
l.extend(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l.extend([{%s : 1}])
l.extend([{1 : 1}]):(<class 'TypeError'>, TypeError('object must be string',))
l.extend([{u"\0" : 1}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
l.extend([{"\0" : 1}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}])
l.extend([{"abc" : {1 : 1}}]):(<class 'TypeError'>, TypeError('object must be string',))
l.extend([{"abc" : {u"\0" : 1}}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
l.extend([{"abc" : {"\0" : 1}}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}])
l.extend([{"abc" : Mapping({1 : 1})}]):(<class 'TypeError'>, TypeError('object must be string',))
l.extend([{"abc" : Mapping({u"\0" : 1})}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
l.extend([{"abc" : Mapping({"\0" : 1})}]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using l.extend([{"abc" : %s}])
l.extend([{"abc" : FailingIter()}]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([{"abc" : FailingIterNext()}]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}])
l.extend([{"abc" : None}]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([{"abc" : {"": 1}}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
l.extend([{"abc" : FailingMapping()}]):(<class 'NotImplementedError'>, NotImplementedError())
l.extend([{"abc" : FailingMappingKey()}]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using l.extend([Mapping({%s : 1})])
l.extend([Mapping({1 : 1})]):(<class 'TypeError'>, TypeError('object must be string',))
l.extend([Mapping({u"\0" : 1})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
l.extend([Mapping({"\0" : 1})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})])
l.extend([Mapping({"abc" : {1 : 1}})]):(<class 'TypeError'>, TypeError('object must be string',))
l.extend([Mapping({"abc" : {u"\0" : 1}})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
l.extend([Mapping({"abc" : {"\0" : 1}})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})])
l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(<class 'TypeError'>, TypeError('object must be string',))
l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using l.extend([Mapping({"abc" : %s})])
l.extend([Mapping({"abc" : FailingIter()})]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([Mapping({"abc" : FailingIterNext()})]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})])
l.extend([Mapping({"abc" : None})]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([Mapping({"abc" : {"": 1}})]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
l.extend([Mapping({"abc" : FailingMapping()})]):(<class 'NotImplementedError'>, NotImplementedError())
l.extend([Mapping({"abc" : FailingMappingKey()})]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using l.extend([%s])
l.extend([FailingIter()]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([FailingIterNext()]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using l.extend([%s])
l.extend([None]):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
l.extend([{"": 1}]):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
l.extend([FailingMapping()]):(<class 'NotImplementedError'>, NotImplementedError())
l.extend([FailingMappingKey()]):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>> ListSetattr
del l.locked:(<class 'AttributeError'>, AttributeError('cannot delete vim.List attributes',))
l.locked = FailingTrue():(<class 'NotImplementedError'>, NotImplementedError())
l.xxx = True:(<class 'AttributeError'>, AttributeError('cannot set this attribute',))
> Function
>> FunctionConstructor
vim.Function("123"):(<class 'ValueError'>, ValueError('unnamed function does not exist',))
vim.Function("xxx_non_existent_function_xxx"):(<class 'ValueError'>, ValueError('function does not exist',))
vim.Function("xxx#non#existent#function#xxx"):NOT FAILED
>> FunctionCall
>>> Testing StringToChars using f({%s : 1})
f({1 : 1}):(<class 'TypeError'>, TypeError('object must be string',))
f({u"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
f({"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using f({"abc" : {%s : 1}})
f({"abc" : {1 : 1}}):(<class 'TypeError'>, TypeError('object must be string',))
f({"abc" : {u"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
f({"abc" : {"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using f({"abc" : Mapping({%s : 1})})
f({"abc" : Mapping({1 : 1})}):(<class 'TypeError'>, TypeError('object must be string',))
f({"abc" : Mapping({u"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
f({"abc" : Mapping({"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using f({"abc" : %s})
f({"abc" : FailingIter()}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
f({"abc" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using f({"abc" : %s})
f({"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
f({"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
f({"abc" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
f({"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using f(Mapping({%s : 1}))
f(Mapping({1 : 1})):(<class 'TypeError'>, TypeError('object must be string',))
f(Mapping({u"\0" : 1})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
f(Mapping({"\0" : 1})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}}))
f(Mapping({"abc" : {1 : 1}})):(<class 'TypeError'>, TypeError('object must be string',))
f(Mapping({"abc" : {u"\0" : 1}})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
f(Mapping({"abc" : {"\0" : 1}})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})}))
f(Mapping({"abc" : Mapping({1 : 1})})):(<class 'TypeError'>, TypeError('object must be string',))
f(Mapping({"abc" : Mapping({u"\0" : 1})})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
f(Mapping({"abc" : Mapping({"\0" : 1})})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using f(Mapping({"abc" : %s}))
f(Mapping({"abc" : FailingIter()})):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
f(Mapping({"abc" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s}))
f(Mapping({"abc" : None})):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
f(Mapping({"abc" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
f(Mapping({"abc" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
f(Mapping({"abc" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using f(%s)
f(FailingIter()):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
f(FailingIterNext()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using f(%s)
f(None):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
f({"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
f(FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
f(FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using fd(self={%s : 1})
fd(self={1 : 1}):(<class 'TypeError'>, TypeError('object must be string',))
fd(self={u"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
fd(self={"\0" : 1}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using fd(self={"abc" : {%s : 1}})
fd(self={"abc" : {1 : 1}}):(<class 'TypeError'>, TypeError('object must be string',))
fd(self={"abc" : {u"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
fd(self={"abc" : {"\0" : 1}}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})})
fd(self={"abc" : Mapping({1 : 1})}):(<class 'TypeError'>, TypeError('object must be string',))
fd(self={"abc" : Mapping({u"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
fd(self={"abc" : Mapping({"\0" : 1})}):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using fd(self={"abc" : %s})
fd(self={"abc" : FailingIter()}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
fd(self={"abc" : FailingIterNext()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using fd(self={"abc" : %s})
fd(self={"abc" : None}):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
fd(self={"abc" : {"": 1}}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
fd(self={"abc" : FailingMapping()}):(<class 'NotImplementedError'>, NotImplementedError())
fd(self={"abc" : FailingMappingKey()}):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing StringToChars using fd(self=Mapping({%s : 1}))
fd(self=Mapping({1 : 1})):(<class 'TypeError'>, TypeError('object must be string',))
fd(self=Mapping({u"\0" : 1})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
fd(self=Mapping({"\0" : 1})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}}))
fd(self=Mapping({"abc" : {1 : 1}})):(<class 'TypeError'>, TypeError('object must be string',))
fd(self=Mapping({"abc" : {u"\0" : 1}})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
fd(self=Mapping({"abc" : {"\0" : 1}})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})}))
fd(self=Mapping({"abc" : Mapping({1 : 1})})):(<class 'TypeError'>, TypeError('object must be string',))
fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(<class 'TypeError'>, TypeError('expected bytes with no null',))
<<< Finished
>>> Testing *Iter* using fd(self=Mapping({"abc" : %s}))
fd(self=Mapping({"abc" : FailingIter()})):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
fd(self=Mapping({"abc" : FailingIterNext()})):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s}))
fd(self=Mapping({"abc" : None})):(<class 'TypeError'>, TypeError('unable to convert to vim structure',))
fd(self=Mapping({"abc" : {"": 1}})):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
fd(self=Mapping({"abc" : FailingMapping()})):(<class 'NotImplementedError'>, NotImplementedError())
fd(self=Mapping({"abc" : FailingMappingKey()})):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing *Iter* using fd(self=%s)
fd(self=FailingIter()):(<class 'TypeError'>, TypeError('unable to convert object to vim dictionary',))
fd(self=FailingIterNext()):(<class 'TypeError'>, TypeError('unable to convert object to vim dictionary',))
<<< Finished
>>> Testing ConvertFromPyObject using fd(self=%s)
fd(self=None):(<class 'TypeError'>, TypeError('unable to convert object to vim dictionary',))
fd(self={"": 1}):(<class 'ValueError'>, ValueError('empty keys are not allowed',))
fd(self=FailingMapping()):(<class 'NotImplementedError'>, NotImplementedError())
fd(self=FailingMappingKey()):(<class 'NotImplementedError'>, NotImplementedError())
<<< Finished
>>> Testing ConvertFromPyMapping using fd(self=%s)
fd(self=[]):(<class 'AttributeError'>, AttributeError("'list' object has no attribute 'keys'",))
<<< Finished
> TabPage
>> TabPageAttr
vim.current.tabpage.xxx:(<class 'AttributeError'>, AttributeError("'vim.tabpage' object has no attribute 'xxx'",))
> TabList
>> TabListItem
vim.tabpages[1000]:(<class 'IndexError'>, IndexError('no such tab page',))
> Window
>> WindowAttr
vim.current.window.xxx:(<class 'AttributeError'>, AttributeError("'vim.window' object has no attribute 'xxx'",))
>> WindowSetattr
vim.current.window.buffer = 0:(<class 'TypeError'>, TypeError('readonly attribute',))
vim.current.window.cursor = (10000000000, 100000000):(<class 'vim.error'>, error('cursor position outside buffer',))
vim.current.window.cursor = True:(<class 'TypeError'>, TypeError('argument must be 2-item sequence, not bool',))
vim.current.window.height = "abc":(<class 'TypeError'>, TypeError('an integer is required',))
vim.current.window.width = "abc":(<class 'TypeError'>, TypeError('an integer is required',))
vim.current.window.xxxxxx = True:(<class 'AttributeError'>, AttributeError('xxxxxx',))
> WinList
>> WinListItem
vim.windows[1000]:(<class 'IndexError'>, IndexError('no such window',))
> Buffer
>> StringToLine (indirect)
vim.current.buffer[0] = "\na":(<class 'vim.error'>, error('string cannot contain newlines',))
>> SetBufferLine (indirect)
vim.current.buffer[0] = True:(<class 'TypeError'>, TypeError('bad argument type for built-in operation',))
>> SetBufferLines (indirect)
vim.current.buffer[:] = True:(<class 'TypeError'>, TypeError('bad argument type for built-in operation',))
vim.current.buffer[:] = ["\na", "bc"]:(<class 'vim.error'>, error('string cannot contain newlines',))
>> InsertBufferLines (indirect)
vim.current.buffer.append(None):(<class 'TypeError'>, TypeError('bad argument type for built-in operation',))
vim.current.buffer.append(["\na", "bc"]):(<class 'vim.error'>, error('string cannot contain newlines',))
vim.current.buffer.append("\nbc"):(<class 'vim.error'>, error('string cannot contain newlines',))
>> RBItem
vim.current.buffer[10000000000]:(<class 'IndexError'>, IndexError('line number out of range',))
>> RBAsItem
vim.current.buffer[10000000000] = "":(<class 'IndexError'>, IndexError('line number out of range',))
>> BufferAttr
vim.current.buffer.xxx:(<class 'AttributeError'>, AttributeError("'vim.buffer' object has no attribute 'xxx'",))
>> BufferSetattr
vim.current.buffer.name = True:(<class 'TypeError'>, TypeError('object must be string',))
vim.current.buffer.xxx = True:(<class 'AttributeError'>, AttributeError('xxx',))
>> BufferMark
vim.current.buffer.mark(0):(<class 'TypeError'>, TypeError('must be str, not int',))
vim.current.buffer.mark("abc"):(<class 'ValueError'>, ValueError('mark name must be a single character',))
vim.current.buffer.mark("!"):(<class 'vim.error'>, error('invalid mark name',))
>> BufferRange
vim.current.buffer.range(1, 2, 3):(<class 'TypeError'>, TypeError('function takes exactly 2 arguments (3 given)',))
> BufMap
>> BufMapItem
vim.buffers[None]:(<class 'TypeError'>, TypeError('key must be integer',))
vim.buffers[100000000]:(<class 'KeyError'>, KeyError(100000000,))
> Current
>> CurrentGetattr
vim.current.xxx:(<class 'AttributeError'>, AttributeError("'vim.currentdata' object has no attribute 'xxx'",))
>> CurrentSetattr
vim.current.line = True:(<class 'TypeError'>, TypeError('bad argument type for built-in operation',))
vim.current.buffer = True:(<class 'TypeError'>, TypeError('expected vim.Buffer object',))
vim.current.window = True:(<class 'TypeError'>, TypeError('expected vim.Window object',))
vim.current.tabpage = True:(<class 'TypeError'>, TypeError('expected vim.TabPage object',))
vim.current.xxx = True:(<class 'AttributeError'>, AttributeError('xxx',))
vim.command("throw 'abc'"):(<class 'vim.error'>, error('abc',))
Exe("throw 'def'"):(<class 'vim.error'>, error('def',))
vim.eval("Exe('throw ''ghi''')"):(<class 'vim.error'>, error('ghi',))
vim.eval("Exe('echoerr ''jkl''')"):(<class 'vim.error'>, error('Vim(echoerr):jkl',))
vim.eval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))
vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(<class 'vim.error'>, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',))

View File

@@ -7,8 +7,9 @@ actually tried.
STARTTEST
:so small.vim
:so mbyte.vim
:set nocp encoding=utf-8 viminfo+=nviminfo
:set nocp encoding=utf-8 viminfo+=nviminfo nomore
:" tl is a List of Lists with:
:" 2: test auto/old/new 0: test auto/old 1: test auto/new
:" regexp pattern
:" text to test the pattern on
:" expected match (optional)
@@ -20,53 +21,96 @@ STARTTEST
:"""" Multi-byte character tests. These will fail unless vim is compiled
:"""" with Multibyte (FEAT_MBYTE) or BIG/HUGE features.
:call add(tl, ['[[:alpha:][=a=]]\+', '879 aiaãâaiuvna ', 'aiaãâaiuvna'])
:call add(tl, ['[[=a=]]\+', 'ddaãâbcd', 'aãâ']) " equivalence classes
:call add(tl, ['[^ม ]\+', 'มม oijasoifjos ifjoisj f osij j มมมมม abcd', 'oijasoifjos'])
:call add(tl, [' [^ ]\+', 'start มabcdม ', ' มabcdม'])
:call add(tl, ['[ม[:alpha:][=a=]]\+', '879 aiaãมâมaiuvna ', 'aiaãมâมaiuvna'])
:call add(tl, [2, '[[:alpha:][=a=]]\+', '879 aiaãâaiuvna ', 'aiaãâaiuvna'])
:call add(tl, [2, '[[=a=]]\+', 'ddaãâbcd', 'aãâ']) " equivalence classes
:call add(tl, [2, '[^ม ]\+', 'มม oijasoifjos ifjoisj f osij j มมมมม abcd', 'oijasoifjos'])
:call add(tl, [2, ' [^ ]\+', 'start มabcdม ', ' มabcdม'])
:call add(tl, [2, '[ม[:alpha:][=a=]]\+', '879 aiaãมâมaiuvna ', 'aiaãมâมaiuvna'])
:" this is not a normal "i" but 0xec
:call add(tl, ['\p\+', 'ìa', 'ìa'])
:call add(tl, [2, '\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'])
:call add(tl, [2, '\i\+', '&*¨xx ', 'xx'])
:call add(tl, [2, '\f\+', '&*Ÿfname ', 'fname'])
:"""" Test composing character matching
:call add(tl, [2, '.ม', 'xม่x yมy', 'yม'])
:call add(tl, [2, '.ม่', 'xม่x yมy', 'xม่'])
:call add(tl, [2, "\u05b9", " x\u05b9 ", "x\u05b9"])
:call add(tl, [2, ".\u05b9", " x\u05b9 ", "x\u05b9"])
:call add(tl, [2, "\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"])
:call add(tl, [2, ".\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"])
:call add(tl, [2, "\u05bb\u05b9", " x\u05b9\u05bb ", "x\u05b9\u05bb"])
:call add(tl, [2, ".\u05bb\u05b9", " x\u05b9\u05bb ", "x\u05b9\u05bb"])
:call add(tl, [2, "\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"])
:call add(tl, [2, ".\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"])
:call add(tl, [2, "\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
:call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"])
:call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"])
:call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"])
:"""" Test \Z
:call add(tl, [2, 'ú\Z', 'x'])
:call add(tl, [2, 'יהוה\Z', 'יהוה', 'יהוה'])
:call add(tl, [2, 'יְהוָה\Z', 'יהוה', 'יהוה'])
:call add(tl, [2, 'יהוה\Z', 'יְהוָה', 'יְהוָה'])
:call add(tl, [2, 'יְהוָה\Z', 'יְהוָה', 'יְהוָה'])
:call add(tl, [2, 'יְ\Z', 'וְיַ', 'יַ'])
:call add(tl, [2, "ק\u200d\u05b9x\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"])
:call add(tl, [2, "ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"])
:call add(tl, [2, "ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"])
:call add(tl, [2, "ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"])
:call add(tl, [2, "\u05b9\\Z", "xyz"])
:call add(tl, [2, "\\Z\u05b9", "xyz"])
:call add(tl, [2, "\u05b9\\Z", "xy\u05b9z", "y\u05b9"])
:call add(tl, [2, "\\Z\u05b9", "xy\u05b9z", "y\u05b9"])
:call add(tl, [1, "\u05b9\\+\\Z", "xy\u05b9z\u05b9 ", "y\u05b9z\u05b9"])
:call add(tl, [1, "\\Z\u05b9\\+", "xy\u05b9z\u05b9 ", "y\u05b9z\u05b9"])
:"""" Combining different tests and features
:call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd'])
:call add(tl, [2, '[^[=a=]]\+', 'ddaãâbcd', 'dd'])
:"""" Run the tests
:"
:for t in tl
: let l = matchlist(t[1], t[0])
: let re = t[0]
: let pat = t[1]
: let text = t[2]
: let matchidx = 3
: for engine in [0, 1, 2]
: if engine == 2 && re == 0 || engine == 1 && re == 1
: continue
: endif
: let &regexpengine = engine
: let l = matchlist(text, pat)
:" check the match itself
: if len(l) == 0 && len(t) > 2
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", did not match, expected: \"' . t[2] . '\"'
: elseif len(l) > 0 && len(t) == 2
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected no match'
: elseif len(t) > 2 && l[0] != t[2]
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected: \"' . t[2] . '\"'
: else
: $put ='OK - ' . t[0]
: endif
: if len(l) > 0
: if len(l) == 0 && len(t) > matchidx
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"'
: elseif len(l) > 0 && len(t) == matchidx
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected no match'
: elseif len(t) > matchidx && l[0] != t[matchidx]
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected: \"' . t[matchidx] . '\"'
: else
: $put ='OK ' . engine . ' - ' . pat
: endif
: if len(l) > 0
:" check all the nine submatches
: for i in range(1, 9)
: if len(t) <= i + 2
: let e = ''
: else
: let e = t[i + 2]
: endif
: if l[i] != e
: $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
: endif
: endfor
: unlet i
: endif
: for i in range(1, 9)
: if len(t) <= matchidx + i
: let e = ''
: else
: let e = t[matchidx + i]
: endif
: if l[i] != e
: $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"'
: endif
: endfor
: unlet i
: endif
: endfor
:endfor
:unlet t tl e l

View File

@@ -1,12 +1,115 @@
Results of test95:
OK - [[:alpha:][=a=]]\+
OK - [[=a=]]\+
OK - [^ม ]\+
OK - [^ ]\+
OK - [ม[:alpha:][=a=]]\+
OK - \p\+
OK - \i\+
OK - \%#=1\i\+
OK - \f\+
OK - \%#=1\i\+
OK - [^[=a=]]\+
OK 0 - [[:alpha:][=a=]]\+
OK 1 - [[:alpha:][=a=]]\+
OK 2 - [[:alpha:][=a=]]\+
OK 0 - [[=a=]]\+
OK 1 - [[=a=]]\+
OK 2 - [[=a=]]\+
OK 0 - [^ม ]\+
OK 1 - [^ม ]\+
OK 2 - [^ม ]\+
OK 0 - [^ ]\+
OK 1 - [^ ]\+
OK 2 - [^ ]\+
OK 0 - [ม[:alpha:][=a=]]\+
OK 1 - [ม[:alpha:][=a=]]\+
OK 2 - [ม[:alpha:][=a=]]\+
OK 0 - \p\+
OK 1 - \p\+
OK 2 - \p\+
OK 0 - \i\+
OK 1 - \i\+
OK 2 - \i\+
OK 0 - \f\+
OK 1 - \f\+
OK 2 - \f\+
OK 0 - .ม
OK 1 - .ม
OK 2 - .ม
OK 0 - .ม่
OK 1 - .ม่
OK 2 - .ม่
OK 0 - ֹ
OK 1 - ֹ
OK 2 - ֹ
OK 0 - .ֹ
OK 1 - .ֹ
OK 2 - .ֹ
OK 0 - ֹֻ
OK 1 - ֹֻ
OK 2 - ֹֻ
OK 0 - .ֹֻ
OK 1 - .ֹֻ
OK 2 - .ֹֻ
OK 0 - ֹֻ
OK 1 - ֹֻ
OK 2 - ֹֻ
OK 0 - .ֹֻ
OK 1 - .ֹֻ
OK 2 - .ֹֻ
OK 0 - ֹ
OK 1 - ֹ
OK 2 - ֹ
OK 0 - .ֹ
OK 1 - .ֹ
OK 2 - .ֹ
OK 0 - ֹ
OK 1 - ֹ
OK 2 - ֹ
OK 0 - .ֹ
OK 1 - .ֹ
OK 2 - .ֹ
OK 0 - ֹֻ
OK 2 - ֹֻ
OK 0 - .ֹֻ
OK 1 - .ֹֻ
OK 2 - .ֹֻ
OK 0 - ú\Z
OK 1 - ú\Z
OK 2 - ú\Z
OK 0 - יהוה\Z
OK 1 - יהוה\Z
OK 2 - יהוה\Z
OK 0 - יְהוָה\Z
OK 1 - יְהוָה\Z
OK 2 - יְהוָה\Z
OK 0 - יהוה\Z
OK 1 - יהוה\Z
OK 2 - יהוה\Z
OK 0 - יְהוָה\Z
OK 1 - יְהוָה\Z
OK 2 - יְהוָה\Z
OK 0 - יְ\Z
OK 1 - יְ\Z
OK 2 - יְ\Z
OK 0 - קֹx\Z
OK 1 - קֹx\Z
OK 2 - קֹx\Z
OK 0 - קֹx\Z
OK 1 - קֹx\Z
OK 2 - קֹx\Z
OK 0 - קx\Z
OK 1 - קx\Z
OK 2 - קx\Z
OK 0 - קx\Z
OK 1 - קx\Z
OK 2 - קx\Z
OK 0 - ֹ\Z
OK 1 - ֹ\Z
OK 2 - ֹ\Z
OK 0 - \Zֹ
OK 1 - \Zֹ
OK 2 - \Zֹ
OK 0 - ֹ\Z
OK 1 - ֹ\Z
OK 2 - ֹ\Z
OK 0 - \Zֹ
OK 1 - \Zֹ
OK 2 - \Zֹ
OK 0 - ֹ\+\Z
OK 2 - ֹ\+\Z
OK 0 - \Zֹ\+
OK 2 - \Zֹ\+
OK 0 - [^[=a=]]\+
OK 1 - [^[=a=]]\+
OK 2 - [^[=a=]]\+

View File

@@ -728,6 +728,148 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1069,
/**/
1068,
/**/
1067,
/**/
1066,
/**/
1065,
/**/
1064,
/**/
1063,
/**/
1062,
/**/
1061,
/**/
1060,
/**/
1059,
/**/
1058,
/**/
1057,
/**/
1056,
/**/
1055,
/**/
1054,
/**/
1053,
/**/
1052,
/**/
1051,
/**/
1050,
/**/
1049,
/**/
1048,
/**/
1047,
/**/
1046,
/**/
1045,
/**/
1044,
/**/
1043,
/**/
1042,
/**/
1041,
/**/
1040,
/**/
1039,
/**/
1038,
/**/
1037,
/**/
1036,
/**/
1035,
/**/
1034,
/**/
1033,
/**/
1032,
/**/
1031,
/**/
1030,
/**/
1029,
/**/
1028,
/**/
1027,
/**/
1026,
/**/
1025,
/**/
1024,
/**/
1023,
/**/
1022,
/**/
1021,
/**/
1020,
/**/
1019,
/**/
1018,
/**/
1017,
/**/
1016,
/**/
1015,
/**/
1014,
/**/
1013,
/**/
1012,
/**/
1011,
/**/
1010,
/**/
1009,
/**/
1008,
/**/
1007,
/**/
1006,
/**/
1005,
/**/
1004,
/**/
1003,
/**/
1002,
/**/
1001,
/**/
1000,
/**/
999,
/**/
998,
/**/

View File

@@ -2243,4 +2243,7 @@ typedef int VimClipboard; /* This is required for the prototypes. */
#define SREQ_WIN 1 /* Request window-local option */
#define SREQ_BUF 2 /* Request buffer-local option */
/* Character used as separated in autoload function/variable names. */
#define AUTOLOAD_CHAR '#'
#endif /* VIM__H */