Lines Matching refs:vim
3 source check.vim
6 source shared.vim
18 import vim
51 'TypeError:(\'unable to convert list to vim dictionary\',)')
52 vim.current.buffer.append(expr + ':' + msg)
54 vim.current.buffer.append(expr + ':NOT FAILED')
62 pydo vim.command("%d_")
69 pydo vim.command("new")
93 pydo vim.current.window.cursor = (1, 5)
102 " Check creating vim.Function object
110 py f = vim.bindeval('function("s:foo")')
117 py f = vim.Function('\x80\xfdR' + vim.eval('s:foo()'))
134 python import vim
162 py vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][:] = None
169 py vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][:] = [ 'test' ]
176 py vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][0] = 'test'
183 py vim.buffers[ int( vim.eval( 'bufnr("hidden")' ) ) ][0] = None
202 py vim.current.buffer[:] = None
211 py vim.current.buffer[:] = [ 'test' ]
220 py vim.current.buffer[-1] = None
258 py b = vim.current.buffer
295 py t = vim.tabpages[1]
300 \ 'Vim(let):vim.error: attempt to refer to deleted tab page')
302 \ 'Vim(let):vim.error: attempt to refer to deleted tab page')
304 \ 'Vim(python):vim.error: attempt to refer to deleted tab page')
305 call AssertException(["py vim.current.tabpage = t"],
306 \ 'Vim(python):vim.error: attempt to refer to deleted tab page')
315 py vim.current.window.height = 5
317 py vim.current.window.height = 3.2
322 py vim.current.window.width = 6
326 py w = vim.current.window
331 \ 'Vim(let):vim.error: attempt to refer to deleted window')
333 \ 'Vim(python):vim.error: attempt to refer to deleted window')
334 call AssertException(["py vim.current.window = w"],
335 \ 'Vim(python):vim.error: attempt to refer to deleted window')
339 \ 'vim.error: attempt to refer to deleted window')
347 py pl = vim.bindeval('l')
351 call AssertException(["py t = vim.eval('test_null_list()')"],
355 call AssertException(["py t = vim.eval('[test_null_list()]')"],
361 py ll = vim.bindeval('l')
366 py l = vim.bindeval('l')
367 py f = vim.bindeval('function("strlen")')
382 py ll = vim.bindeval('l')
394 py pd = vim.bindeval('d')
399 call AssertException(["py t = vim.eval('test_null_dict()')"],
403 call AssertException(["py t = vim.eval(\"{'a' : test_null_list()}\")"],
407 py t = vim.eval("{test_null_string() : 10}")
412 py d = vim.bindeval('d')
426 py f = vim.bindeval('function("strlen")')
428 d = vim.bindeval('d')
446 \ 'Vim(python):vim.error: dictionary is locked')
451 …call assert_equal("['asd', -1L, <vim.Function '1'>, <vim.dictionary object at >, <vim.list object …
452 …call assert_equal("[('-1', <vim.dictionary object at >), ('0', -1L), ('1', 'asd'), ('b', <vim.list…
463 py l = vim.bindeval('l')
468 py l = vim.bindeval('l')
477 py l = vim.bindeval('l')
486 py l = vim.bindeval('l')
491 py l = vim.bindeval('l')
496 py l = vim.bindeval('l')
502 py l = vim.bindeval('l')
511 py l = vim.bindeval('l')
516 py l = vim.bindeval('l')
521 py l = vim.bindeval('l')
526 py l = vim.bindeval('l')
531 py l = vim.bindeval('l')
536 py l = vim.bindeval('l')
543 py d = vim.bindeval('d')
565 py l = vim.bindeval('l')
570 py l = vim.bindeval('l')
575 py l = vim.bindeval('l')
580 py l = vim.bindeval('l')
585 py l = vim.bindeval('l')
590 py l = vim.bindeval('l')
595 py l = vim.bindeval('l')
600 py l = vim.bindeval('l')
605 py l = vim.bindeval('l')
610 py l = vim.bindeval('l')
615 py l = vim.bindeval('l')
620 py l = vim.bindeval('l')
625 py l = vim.bindeval('l')
636 py cb = vim.current.buffer
638 py l = vim.bindeval('l')
643 except vim.error:
644 cb.append('l[2] threw vim.error: ' + emsg(sys.exc_info()))
646 call assert_equal(['', "l[2] threw vim.error: error:('list is locked',)"],
651 \ 'Vim(python):vim.error: list is locked')
670 py l = vim.bindeval('l')
691 py l = vim.bindeval('l')
700 d = vim.bindeval('{}')
701 m = vim.bindeval('messages')
710 em('d["abc1"]=vim')
731 execute 'py ' .. name .. ' = vim.bindeval("' .. s .. '")'
752 execute 'py ' .. name .. '=vim.bindeval("' .. s .. '")'
768 py a = vim.bindeval('v:argv')
785 py v = vim.eval('test_null_function()')
797 call AssertException(['let v = pyeval("vim")'], 'E859:')
800 " Test for vim.bindeval()
804 py f = vim.bindeval('f')
809 py b = vim.bindeval('b')
813 call assert_equal(1, pyeval("vim.bindeval('v:true')"))
814 call assert_equal(0, pyeval("vim.bindeval('v:false')"))
815 call assert_equal(v:none, pyeval("vim.bindeval('v:null')"))
816 call assert_equal(v:none, pyeval("vim.bindeval('v:none')"))
820 call assert_equal(v:none, pyeval("vim.bindeval('test_null_channel()')"))
823 call assert_equal(v:none, pyeval("vim.bindeval('test_null_job()')"))
832 py l = vim.bindeval('l')
869 py l = vim.bindeval('l')
893 py ll = vim.bindeval('[0, 1, 2, 3, 4, 5]')
924 call AssertException(['py ll[-10] = 5'], 'Vim(python):vim.error: internal error:')
937 py ll = vim.bindeval('l')
951 call assert_equal('Abc', pyeval('vim.vvars[''exception'']'))
953 call assert_equal('bac', pyeval('vim.vars[''foo'']'))
954 call assert_equal('def', pyeval('vim.current.window.vars[''abc3'']'))
955 call assert_equal('bar', pyeval('vim.current.buffer.vars[''baz'']'))
956 call assert_equal('jkl', pyeval('vim.current.tabpage.vars[''bar'']'))
1000 vim.command('return ' + repr(sys.exc_type.__name__))
1006 vim.command('let exc=' + repr(sys.exc_type.__name__))
1011 python e(vim.eval('a:s'))
1015 let r = pyeval('ev(vim.eval("a:s"))')
1022 py gopts1 = vim.options
1023 py wopts1 = vim.windows[2].options
1024 py wopts2 = vim.windows[0].options
1025 py wopts3 = vim.windows[1].options
1026 py bopts1 = vim.buffers[vim.bindeval("g:bufs")[2]].options
1027 py bopts2 = vim.buffers[vim.bindeval("g:bufs")[1]].options
1028 py bopts3 = vim.buffers[vim.bindeval("g:bufs")[0]].options
1052 py oname = vim.eval('oname')
1053 py oval1 = vim.bindeval('oval1')
1054 py oval2 = vim.bindeval('oval2')
1055 py oval3 = vim.bindeval('oval3')
1057 py invval = bool(vim.bindeval('invval'))
1059 py invval = vim.bindeval('invval')
1377 call assert_equal(0, pyeval("'' in vim.options"))
1379 " use an empty key to index vim.options
1380 call AssertException(["let v = pyeval(\"vim.options['']\")"],
1382 call AssertException(["py vim.current.window.options[''] = 0"],
1384 call AssertException(["py vim.current.window.options[{}] = 0"],
1388 let cmd = ["py vim.options['previewheight'] = 9999999999999999"]
1392 call AssertException(["py del vim.options['errorformat']"],
1396 " Test for vim.buffer object
1400 call assert_fails("let x = pyeval('vim.current.buffer[0]')", 'E859:')
1405 py cb = vim.current.buffer
1409 py b = vim.current.buffer
1478 vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number)
1486 …autocmd BufFilePost * python cb.append(vim.eval('expand("<abuf>")') + ':BufFilePost:' + vim.eval('…
1487 …autocmd BufFilePre * python cb.append(vim.eval('expand("<abuf>")') + ':BufFilePre:' + vim.eval('bu…
1513 for _b in vim.buffers:
1515 vim.command('bwipeout! ' + str(_b.number))
1526 except vim.error:
1532 vim.command('cd .')
1539 py vim.current.buffer[:] = []
1543 call assert_equal(v:none, pyeval("vim.current.buffer.mark('r')"))
1547 call AssertException(["py vim.current.buffer[0] = 'abc'"],
1548 \ "Vim(python):vim.error: Vim:E21: Cannot make changes, 'modifiable' is off")
1549 call AssertException(["py vim.current.buffer[0] = None"],
1550 \ "Vim(python):vim.error: Vim:E21: Cannot make changes, 'modifiable' is off")
1551 call AssertException(["py vim.current.buffer[:] = None"],
1552 \ "Vim(python):vim.error: Vim:E21: Cannot make changes, 'modifiable' is off")
1553 call AssertException(["py vim.current.buffer[:] = []"],
1554 \ "Vim(python):vim.error: Vim:E21: Cannot make changes, 'modifiable' is off")
1555 call AssertException(["py vim.current.buffer.append('abc')"],
1556 \ "Vim(python):vim.error: Vim:E21: Cannot make changes, 'modifiable' is off")
1557 call AssertException(["py vim.current.buffer.append([])"],
1558 \ "Vim(python):vim.error: Vim:E21: Cannot make changes, 'modifiable' is off")
1570 py b = vim.current.buffer
1571 py r = vim.current.buffer.range(0, 2)
1575 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1579 \ 'Vim(let):vim.error: attempt to refer to deleted buffer')
1581 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1585 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1587 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1589 \ 'Vim(let):vim.error: attempt to refer to deleted buffer')
1591 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1592 call AssertException(["py vim.current.buffer = b"],
1593 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1595 \ 'Vim(python):vim.error: attempt to refer to deleted buffer')
1598 " Test vim.buffers object
1602 py cb = vim.current.buffer
1616 i = iter(vim.buffers)
1619 i2 = iter(vim.buffers)
1625 i3 = iter(vim.buffers)
1636 for b in vim.buffers:
1640 # Check indexing: vim.buffers[number].number == number
1641 cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + \
1646 cb.append(str(len(vim.buffers)))
1655 bnums = list(map(lambda b: b.number, vim.buffers))[1:]
1658 i4 = iter(vim.buffers)
1660 vim.command('bwipeout! ' + str(bnums.pop(0)))
1663 except vim.error:
1666 cb.append('!!!! No vim.error')
1667 i4 = iter(vim.buffers)
1668 vim.command('bwipeout! ' + str(bnums.pop(-1)))
1669 vim.command('bwipeout! ' + str(bnums.pop(-1)))
1683 " Test vim.{tabpage,window}list and vim.{tabpage,window} objects
1687 py cb = vim.current.buffer
1696 call assert_equal(4, pyeval('vim.current.window.tabpage.number'))
1699 cb.append('Number of tabs: ' + str(len(vim.tabpages)))
1715 for t in vim.tabpages:
1741 str(len(vim.windows)))
1742 if list(vim.windows) != list(vim.current.tabpage.windows):
1771 " Test vim.current
1775 py cb = vim.current.buffer
1787 cb.append('Current tab page: ' + repr(vim.current.tabpage))
1788 cb.append('Current window: ' + repr(vim.current.window) + ': ' + \
1789 H(vim.current.window) + ' is ' + H(vim.current.tabpage.window))
1790 cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + \
1791 H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ \
1792 ' is ' + H(vim.current.tabpage.window.buffer))
1806 vim.current.window = vim.tabpages[0].window
1812 setattr(vim.current, attr, None)
1814 cb.append('Type error at assigning None to vim.current.' + attr)
1820 Type error at assigning None to vim.current.window
1821 Type error at assigning None to vim.current.tabpage
1822 Type error at assigning None to vim.current.buffer
1830 vim.current.tabpage = vim.tabpages[-2]
1831 vim.current.buffer = cb
1832 vim.current.window = vim.windows[0]
1833 vim.current.window.cursor = (len(vim.current.buffer), 0)
1834 cb.append('Current tab page: ' + repr(vim.current.tabpage))
1835 cb.append('Current window: ' + repr(vim.current.window))
1836 cb.append('Current buffer: ' + repr(vim.current.buffer))
1837 cb.append('Current line: ' + repr(vim.current.line))
1847 py vim.current.line = 'one line'
1852 ws = list(vim.windows)
1853 ts = list(vim.tabpages)
1854 for b in vim.buffers:
1856 vim.command('bwipeout! ' + str(b.number))
1876 py cb = vim.current.buffer
1879 ('vim.vars', 'Dictionary'),
1880 ('vim.options', 'Options'),
1881 ('vim.bindeval("{}")', 'Dictionary'),
1882 ('vim.bindeval("[]")', 'List'),
1883 ('vim.bindeval("function(\'tr\')")', 'Function'),
1884 ('vim.current.buffer', 'Buffer'),
1885 ('vim.current.range', 'Range'),
1886 ('vim.current.window', 'Window'),
1887 ('vim.current.tabpage', 'TabPage'),
1890 repr(type(eval(expr)) is getattr(vim, attr)))
1895 vim.vars:Dictionary:True
1896 vim.options:Options:True
1897 vim.bindeval("{}"):Dictionary:True
1898 vim.bindeval("[]"):List:True
1899 vim.bindeval("function('tr')"):Function:True
1900 vim.current.buffer:Buffer:True
1901 vim.current.range:Range:True
1902 vim.current.window:Window:True
1903 vim.current.tabpage:TabPage:True
1911 py cb = vim.current.buffer
1914 ('current', vim.current),
1915 ('buffer', vim.current.buffer),
1916 ('window', vim.current.window),
1917 ('tabpage', vim.current.tabpage),
1918 ('range', vim.current.range),
1919 ('dictionary', vim.bindeval('{}')),
1920 ('list', vim.bindeval('[]')),
1921 ('function', vim.bindeval('function("tr")')),
1942 " Test vim.*.__new__
1944 call assert_equal({}, pyeval('vim.Dictionary({})'))
1945 call assert_equal({'a': 1}, pyeval('vim.Dictionary(a=1)'))
1946 call assert_equal({'a': 1}, pyeval('vim.Dictionary(((''a'', 1),))'))
1947 call assert_equal([], pyeval('vim.List()'))
1948 call assert_equal(['a', 'b', 'c', '7'], pyeval('vim.List(iter(''abc7''))'))
1949 call assert_equal(function('tr'), pyeval('vim.Function(''tr'')'))
1951 \ pyeval('vim.Function(''tr'', args=[123, 3, 4])'))
1952 call assert_equal(function('tr'), pyeval('vim.Function(''tr'', args=[])'))
1954 \ pyeval('vim.Function(''tr'', self={})'))
1956 \ pyeval('vim.Function(''tr'', args=[123, 3, 4], self={})'))
1958 \ pyeval('vim.Function(''tr'', auto_rebind=False)'))
1960 \ pyeval('vim.Function(''tr'', args=[123, 3, 4], auto_rebind=False)'))
1962 \ pyeval('vim.Function(''tr'', args=[], auto_rebind=False)'))
1964 \ pyeval('vim.Function(''tr'', self={}, auto_rebind=False)'))
1966 \ pyeval('vim.Function(''tr'', args=[123, 3, 4], self={}, auto_rebind=False)'))
1969 " Test vim.Function
1981 py Pt = vim.bindeval('Pt')
1985 call assert_equal(3, pyeval('vim.strwidth("a\tb")'))
1988 py cb = vim.current.buffer
1997 line += '!result: ' + vim.Function('string')(ret)
1999 a = vim.Function('Args')
2000 pa1 = vim.Function('Args', args=['abcArgsPA1'])
2001 pa2 = vim.Function('Args', args=[])
2002 pa3 = vim.Function('Args', args=['abcArgsPA3'], self={'abcSelfPA3': 'abcSelfPA3Val'})
2003 pa4 = vim.Function('Args', self={'abcSelfPA4': 'abcSelfPA4Val'})
2009 sa = vim.Function('SelfArgs')
2010 psa1 = vim.Function('SelfArgs', args=['abcArgsPSA1'])
2011 psa2 = vim.Function('SelfArgs', args=[])
2012 psa3 = vim.Function('SelfArgs', args=['abcArgsPSA3'], self={'abcSelfPSA3': 'abcSelfPSA3Val'})
2013 psa4 = vim.Function('SelfArgs', self={'abcSelfPSA4': 'abcSelfPSA4Val'})
2014 psa5 = vim.Function('SelfArgs', self={'abcSelfPSA5': 'abcSelfPSA5Val'}, auto_rebind=0)
2015 …psa6 = vim.Function('SelfArgs', args=['abcArgsPSA6'], self={'abcSelfPSA6': 'abcSelfPSA6Val'}, auto…
2016 psa7 = vim.Function('SelfArgs', args=['abcArgsPSA7'], auto_rebind=[])
2017 psa8 = vim.Function('SelfArgs', auto_rebind=False)
2018 psa9 = vim.Function('SelfArgs', self={'abcSelfPSA9': 'abcSelfPSA9Val'}, auto_rebind=True)
2019 …psaA = vim.Function('SelfArgs', args=['abcArgsPSAA'], self={'abcSelfPSAA': 'abcSelfPSAAVal'}, auto…
2020 psaB = vim.Function('SelfArgs', args=['abcArgsPSAB'], auto_rebind={'abcARPSAB': 'abcARPSABVal'})
2021 psaC = vim.Function('SelfArgs', auto_rebind=['abcARPSAC'])
2036 …psar = vim.Function('SelfArgs', args=[{'abcArgsPSAr': 'abcArgsPSArVal'}], self={'abcSelfPSAr': 'ab…
2049 a: <vim.Function 'Args'>
2050 pa1: <vim.Function 'Args', args=['abcArgsPA1']>
2051 pa2: <vim.Function 'Args'>
2052 pa3: <vim.Function 'Args', args=['abcArgsPA3'], self={'abcSelfPA3': 'abcSelfPA3Val'}>
2053 pa4: <vim.Function 'Args', self={'abcSelfPA4': 'abcSelfPA4Val'}>
2054 sa: <vim.Function 'SelfArgs'>
2055 psa1: <vim.Function 'SelfArgs', args=['abcArgsPSA1']>
2056 psa2: <vim.Function 'SelfArgs'>
2057 psa3: <vim.Function 'SelfArgs', args=['abcArgsPSA3'], self={'abcSelfPSA3': 'abcSelfPSA3Val'}>
2058 psa4: <vim.Function 'SelfArgs', self={'abcSelfPSA4': 'abcSelfPSA4Val'}>
2059 psa5: <vim.Function 'SelfArgs', self={'abcSelfPSA5': 'abcSelfPSA5Val'}>
2060 psa6: <vim.Function 'SelfArgs', args=['abcArgsPSA6'], self={'abcSelfPSA6': 'abcSelfPSA6Val'}>
2061 psa7: <vim.Function 'SelfArgs', args=['abcArgsPSA7']>
2062 psa8: <vim.Function 'SelfArgs'>
2063 psa9: <vim.Function 'SelfArgs', self={'abcSelfPSA9': 'abcSelfPSA9Val'}, auto_rebind=True>
2064 …psaA: <vim.Function 'SelfArgs', args=['abcArgsPSAA'], self={'abcSelfPSAA': 'abcSelfPSAAVal'}, auto…
2065 psaB: <vim.Function 'SelfArgs', args=['abcArgsPSAB']>
2066 psaC: <vim.Function 'SelfArgs'>
2067 …psar: <vim.Function 'SelfArgs', args=[{'abcArgsPSAr2': [{'rec': function('SelfArgs', [{...}], {...…
2164 return vim.Function('string')(v)
2368 class DupDict(vim.Dictionary):
2375 class DupList(vim.List):
2383 class DupFun(vim.Function):
2413 py cb = vim.current.buffer
2416 fnamemodify = vim.Function('fnamemodify')
2418 cb.append(vim.eval('@%'))
2427 cb.append(fnamemodify(vim.eval('@%'), ':s?^%s.??' % path).replace(os.path.sep, '/'))
2433 cb.append(vim.eval('@%').replace(os.path.sep, '/'))
2436 cb.append(vim.eval('@%'))
2442 call AssertException(["py vim.chdir(None)"], "Vim(python):TypeError:")
2454 py cb = vim.current.buffer
2457 d = vim.Dictionary()
2458 ned = vim.Dictionary(foo='bar', baz='abcD')
2459 dl = vim.Dictionary(a=1)
2461 l = vim.List()
2462 ll = vim.List('abcE')
2464 nel = vim.List('abcO')
2465 f = vim.Function('string')
2466 fd = vim.Function('F')
2467 fdel = vim.Function('D')
2468 vim.command('delfunction D')
2629 stringtochars_test('vim.command(%s)')
2630 ee('vim.command("", 2)')
2631 #! Not checked: vim->python exceptions translating: checked later
2635 stringtochars_test('vim.eval(%s)')
2636 ee('vim.eval("", FailingTrue())')
2639 stringtochars_test('vim.bindeval(%s)')
2640 ee('vim.eval("", 2)')
2641 #! Not checked: vim->python exceptions translating: checked later
2643 stringtochars_test('vim.strwidth(%s)')
2645 ee('vim.foreach_rtp(None)')
2646 ee('vim.foreach_rtp(NoArgsCall())')
2647 ee('vim.foreach_rtp(FailingCall())')
2648 ee('vim.foreach_rtp(int, 2)')
2650 old_rtp = vim.options['rtp']
2651 vim.options['rtp'] = os.getcwd().replace('\\', '\\\\').replace(',', '\\,')
2655 vim.options['rtp'] = old_rtp
2659 ee('vim.options["abcQ"]')
2660 ee('vim.options[""]')
2661 stringtochars_test('vim.options[%s]')
2663 stringtochars_test('%s in vim.options')
2666 ee('vim.Dictionary("abcI")')
2671 ee('vim.vvars.locked = False')
2705 ee('vim.List(1, 2)')
2706 ee('vim.List(a=1)')
2707 iter_test('vim.List(%s)')
2708 convertfrompyobject_test('vim.List([%s])')
2736 ee('vim.Function("123")')
2737 ee('vim.Function("xxx_non_existent_function_xxx")')
2738 ee('vim.Function("xxx#non#existent#function#xxx")')
2739 ee('vim.Function("xxx_non_existent_function_xxx2", args=[])')
2740 ee('vim.Function("xxx_non_existent_function_xxx3", self={})')
2741 ee('vim.Function("xxx_non_existent_function_xxx4", args=[], self={})')
2743 ee('vim.Function("tr", self="abcFuncSelf")')
2744 ee('vim.Function("tr", args=427423)')
2745 ee('vim.Function("tr", self="abcFuncSelf2", args="abcFuncArgs2")')
2746 ee('vim.Function(self="abcFuncSelf2", args="abcFuncArgs2")')
2747 ee('vim.Function("tr", "", self="abcFuncSelf2", args="abcFuncArgs2")')
2748 ee('vim.Function("tr", "")')
2754 ee('vim.current.tabpage.xxx')
2757 ee('vim.tabpages[1000]')
2760 ee('vim.current.window.xxx')
2762 ee('vim.current.window.buffer = 0')
2763 ee('vim.current.window.cursor = (100000000, 100000000)')
2764 ee('vim.current.window.cursor = True')
2765 number_test('vim.current.window.height = %s', unsigned=True)
2766 number_test('vim.current.window.width = %s', unsigned=True)
2767 ee('vim.current.window.xxxxxx = True')
2770 ee('vim.windows[1000]')
2773 ee('vim.current.buffer[0] = "\\na"')
2774 ee('vim.current.buffer[0] = u"\\na"')
2776 ee('vim.current.buffer[0] = True')
2778 ee('vim.current.buffer[:] = True')
2779 ee('vim.current.buffer[:] = ["\\na", "bc"]')
2781 ee('vim.current.buffer.append(None)')
2782 ee('vim.current.buffer.append(["\\na", "bc"])')
2783 ee('vim.current.buffer.append("\\nbc")')
2785 ee('vim.current.buffer[100000000]')
2787 ee('vim.current.buffer[100000000] = ""')
2789 ee('vim.current.buffer.xxx')
2791 ee('vim.current.buffer.name = True')
2792 ee('vim.current.buffer.xxx = True')
2794 ee('vim.current.buffer.mark(0)')
2795 ee('vim.current.buffer.mark("abcM")')
2796 ee('vim.current.buffer.mark("!")')
2798 ee('vim.current.buffer.range(1, 2, 3)')
2801 ee('vim.buffers[100000000]')
2802 number_test('vim.buffers[%s]', natural=True)
2805 ee('vim.current.xxx')
2807 ee('vim.current.line = True')
2808 ee('vim.current.buffer = True')
2809 ee('vim.current.window = True')
2810 ee('vim.current.tabpage = True')
2811 ee('vim.current.xxx = True')
2883 >>> Testing StringToChars using vim.command(%s)
2884 vim.command(1):TypeError:('expected str() or unicode() instance, but got int',)
2885 vim.command(u"\0"):TypeError:('expected string without null bytes',)
2886 vim.command("\0"):TypeError:('expected string without null bytes',)
2888 vim.command("", 2):TypeError:('command() takes exactly one argument (2 given)',)
2891 >>> Testing StringToChars using vim.eval(%s)
2892 vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',)
2893 vim.eval(u"\0"):TypeError:('expected string without null bytes',)
2894 vim.eval("\0"):TypeError:('expected string without null bytes',)
2896 vim.eval("", FailingTrue()):TypeError:('function takes exactly 1 argument (2 given)',)
2898 >>> Testing StringToChars using vim.bindeval(%s)
2899 vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',)
2900 vim.bindeval(u"\0"):TypeError:('expected string without null bytes',)
2901 vim.bindeval("\0"):TypeError:('expected string without null bytes',)
2903 vim.eval("", 2):TypeError:('function takes exactly 1 argument (2 given)',)
2905 >>> Testing StringToChars using vim.strwidth(%s)
2906 vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',)
2907 vim.strwidth(u"\0"):TypeError:('expected string without null bytes',)
2908 vim.strwidth("\0"):TypeError:('expected string without null bytes',)
2911 vim.foreach_rtp(None):TypeError:("'NoneType' object is not callable",)
2912 vim.foreach_rtp(NoArgsCall()):TypeError:('__call__() takes exactly 1 argument (2 given)',)
2913 vim.foreach_rtp(FailingCall()):NotImplementedError:('call',)
2914 vim.foreach_rtp(int, 2):TypeError:('foreach_rtp() takes exactly one argument (2 given)',)
2921 vim.options["abcQ"]:KeyError:('abcQ',)
2922 vim.options[""]:ValueError:('empty keys are not allowed',)
2923 >>> Testing StringToChars using vim.options[%s]
2924 vim.options[1]:TypeError:('expected str() or unicode() instance, but got int',)
2925 vim.options[u"\0"]:TypeError:('expected string without null bytes',)
2926 vim.options["\0"]:TypeError:('expected string without null bytes',)
2929 >>> Testing StringToChars using %s in vim.options
2930 1 in vim.options:TypeError:('expected str() or unicode() instance, but got int',)
2931 u"\0" in vim.options:TypeError:('expected string without null bytes',)
2932 "\0" in vim.options:TypeError:('expected string without null bytes',)
2936 …vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size …
2938 del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',)
2940 vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',)
3183 vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',)
3184 vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',)
3185 >>> Testing *Iter* using vim.List(%s)
3186 vim.List(FailingIter()):NotImplementedError:('iter',)
3187 vim.List(FailingIterNext()):NotImplementedError:('next',)
3189 >>> Testing StringToChars using vim.List([{%s : 1}])
3190 vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',)
3191 vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',)
3192 vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',)
3194 >>> Testing StringToChars using vim.List([{"abcF" : {%s : 1}}])
3195 vim.List([{"abcF" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',)
3196 vim.List([{"abcF" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',)
3197 vim.List([{"abcF" : {"\0" : 1}}]):TypeError:('expected string without null bytes',)
3199 >>> Testing StringToChars using vim.List([{"abcF" : Mapping({%s : 1})}])
3200 …vim.List([{"abcF" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got …
3201 vim.List([{"abcF" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',)
3202 vim.List([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',)
3204 >>> Testing *Iter* using vim.List([{"abcF" : %s}])
3205 …vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to a Vim structure'…
3206 vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',)
3208 >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}])
3209 vim.List([{"abcF" : None}]):NOT FAILED
3210 vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',)
3211 vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',)
3212 vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',)
3213 vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',)
3214 … vim.List([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',)
3216 >>> Testing StringToChars using vim.List([Mapping({%s : 1})])
3217 vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',)
3218 vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',)
3219 vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',)
3221 >>> Testing StringToChars using vim.List([Mapping({"abcG" : {%s : 1}})])
3222 …vim.List([Mapping({"abcG" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got …
3223 vim.List([Mapping({"abcG" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',)
3224 vim.List([Mapping({"abcG" : {"\0" : 1}})]):TypeError:('expected string without null bytes',)
3226 >>> Testing StringToChars using vim.List([Mapping({"abcG" : Mapping({%s : 1})})])
3227 …vim.List([Mapping({"abcG" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance,…
3228 …vim.List([Mapping({"abcG" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null byte…
3229 …vim.List([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes…
3231 >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})])
3232 …vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to a Vim s…
3233 vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',)
3235 >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})])
3236 vim.List([Mapping({"abcG" : None})]):NOT FAILED
3237 vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',)
3238 vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',)
3239 vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',)
3240 vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:('getitem:mappingkey',)
3241 …vim.List([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a …
3243 >>> Testing *Iter* using vim.List([%s])
3244 vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to a Vim structure',)
3245 vim.List([FailingIterNext()]):NotImplementedError:('next',)
3247 >>> Testing ConvertFromPyObject using vim.List([%s])
3248 vim.List([None]):NOT FAILED
3249 vim.List([{"": 1}]):ValueError:('empty keys are not allowed',)
3250 vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',)
3251 vim.List([FailingMapping()]):NotImplementedError:('keys',)
3252 vim.List([FailingMappingKey()]):NotImplementedError:('getitem:mappingkey',)
3253 vim.List([FailingNumber()]):TypeError:('long() argument must be a string or a number',)
3412 del l.locked:AttributeError:('cannot delete vim.List attributes',)
3418 vim.Function("123"):ValueError:('unnamed function 123 does not exist',)
3419 …vim.Function("xxx_non_existent_function_xxx"):ValueError:('function xxx_non_existent_function_xxx …
3420 vim.Function("xxx#non#existent#function#xxx"):NOT FAILED
3421 …vim.Function("xxx_non_existent_function_xxx2", args=[]):ValueError:('function xxx_non_existent_fun…
3422 …vim.Function("xxx_non_existent_function_xxx3", self={}):ValueError:('function xxx_non_existent_fun…
3423 …vim.Function("xxx_non_existent_function_xxx4", args=[], self={}):ValueError:('function xxx_non_exi…
3425 vim.Function("tr", self="abcFuncSelf"):TypeError:('unable to convert str to a Vim dictionary',)
3426 vim.Function("tr", args=427423):TypeError:('unable to convert int to a Vim list',)
3427 …vim.Function("tr", self="abcFuncSelf2", args="abcFuncArgs2"):TypeError:('unable to convert str to …
3428 …vim.Function(self="abcFuncSelf2", args="abcFuncArgs2"):TypeError:('unable to convert str to a Vim …
3429 …vim.Function("tr", "", self="abcFuncSelf2", args="abcFuncArgs2"):TypeError:('unable to convert str…
3430 vim.Function("tr", ""):TypeError:('function takes exactly 1 argument (2 given)',)
3569 vim.current.tabpage.xxx:AttributeError:('xxx',)
3572 vim.tabpages[1000]:IndexError:('no such tab page',)
3575 vim.current.window.xxx:AttributeError:('xxx',)
3577 vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',)
3578 vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',)
3579 vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',)
3580 >>> Testing NumberToLong using vim.current.window.height = %s
3581 …vim.current.window.height = []:TypeError:('expected int(), long() or something supporting coercing…
3582 …vim.current.window.height = None:TypeError:('expected int(), long() or something supporting coerci…
3583 vim.current.window.height = -1:ValueError:('number must be greater or equal to zero',)
3585 >>> Testing NumberToLong using vim.current.window.width = %s
3586 …vim.current.window.width = []:TypeError:('expected int(), long() or something supporting coercing …
3587 …vim.current.window.width = None:TypeError:('expected int(), long() or something supporting coercin…
3588 vim.current.window.width = -1:ValueError:('number must be greater or equal to zero',)
3590 vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',)
3593 vim.windows[1000]:IndexError:('no such window',)
3596 vim.current.buffer[0] = "\na":error:('string cannot contain newlines',)
3597 vim.current.buffer[0] = u"\na":error:('string cannot contain newlines',)
3599 vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',)
3601 vim.current.buffer[:] = True:TypeError:('bad argument type for built-in operation',)
3602 vim.current.buffer[:] = ["\na", "bc"]:error:('string cannot contain newlines',)
3604 vim.current.buffer.append(None):TypeError:('bad argument type for built-in operation',)
3605 vim.current.buffer.append(["\na", "bc"]):error:('string cannot contain newlines',)
3606 vim.current.buffer.append("\nbc"):error:('string cannot contain newlines',)
3608 vim.current.buffer[100000000]:IndexError:('line number out of range',)
3610 vim.current.buffer[100000000] = "":IndexError:('line number out of range',)
3612 vim.current.buffer.xxx:AttributeError:('xxx',)
3614 vim.current.buffer.name = True:TypeError:('expected str() or unicode() instance, but got bool',)
3615 vim.current.buffer.xxx = True:AttributeError:('xxx',)
3617 vim.current.buffer.mark(0):TypeError:('expected str() or unicode() instance, but got int',)
3618 vim.current.buffer.mark("abcM"):ValueError:('mark name must be a single character',)
3619 vim.current.buffer.mark("!"):error:('invalid mark name',)
3621 vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',)
3624 vim.buffers[100000000]:KeyError:(100000000,)
3625 >>> Testing NumberToLong using vim.buffers[%s]
3626 …vim.buffers[[]]:TypeError:('expected int(), long() or something supporting coercing to long(), but…
3627 …vim.buffers[None]:TypeError:('expected int(), long() or something supporting coercing to long(), b…
3628 vim.buffers[-1]:ValueError:('number must be greater than zero',)
3629 vim.buffers[0]:ValueError:('number must be greater than zero',)
3633 vim.current.xxx:AttributeError:('xxx',)
3635 vim.current.line = True:TypeError:('bad argument type for built-in operation',)
3636 vim.current.buffer = True:TypeError:('expected vim.Buffer object, but got bool',)
3637 vim.current.window = True:TypeError:('expected vim.Window object, but got bool',)
3638 vim.current.tabpage = True:TypeError:('expected vim.TabPage object, but got bool',)
3639 vim.current.xxx = True:AttributeError:('xxx',)
3649 py cb = vim.current.buffer
3654 vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\')
3658 vim.foreach_rtp(callback)
3663 cb.append(repr(vim.foreach_rtp(callback)))
3712 py cb = vim.current.buffer
3715 Exe = vim.bindeval('function("Exe")')
3716 ee('vim.command("throw \'abcN\'")')
3718 ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")')
3719 ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")')
3720 ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")')
3721 ee('vim.eval("xxx_unknown_function_xxx()")')
3722 ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")')
3728 vim.command("throw 'abcN'"):error:('abcN',)
3730 vim.eval("Exe('throw ''ghi''')"):error:('ghi',)
3731 vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',)
3732 …vim.eval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_e…
3733 …vim.eval("xxx_unknown_function_xxx()"):error:('Vim:E117: Unknown function: xxx_unknown_function_xx…
3734 …vim.bindeval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_n…
3740 " Regression: interrupting vim.command propagates to next vim.command
3743 py cb = vim.current.buffer
3747 vim.command('while 1 | endwhile')
3755 vim.command('$ put =\'Running :put\'')
3786 python vim.command('redir => _tmp_smaps | smap | redir END')
3787 python vim.eval('_tmp_smaps').splitlines()
3791 " vim: shiftwidth=2 sts=2 expandtab