aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.lua28
-rw-r--r--src/nvim/testdir/test_charsearch.vim2
-rw-r--r--src/nvim/testdir/test_clientserver.vim2
-rw-r--r--src/nvim/testdir/test_cmdline.vim2
-rw-r--r--src/nvim/testdir/test_cursor_func.vim2
-rw-r--r--src/nvim/testdir/test_diffmode.vim2
-rw-r--r--src/nvim/testdir/test_environ.vim2
-rw-r--r--src/nvim/testdir/test_functions.vim4
-rw-r--r--src/nvim/testdir/test_matchadd_conceal_utf8.vim2
-rw-r--r--src/nvim/testdir/test_search.vim37
-rw-r--r--src/nvim/testdir/test_utf8.vim2
11 files changed, 60 insertions, 25 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index dfc51d80af..d6b285eab0 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -291,29 +291,29 @@ return {
rpcstart={args={1, 2}},
rpcstop={args=1},
rubyeval={args=1, base=1},
- screenattr={args=2},
- screenchar={args=2},
- screenchars={args=2},
+ screenattr={args=2, base=1},
+ screenchar={args=2, base=1},
+ screenchars={args=2, base=1},
screencol={},
- screenpos={args=3},
+ screenpos={args=3, base=1},
screenrow={},
- screenstring={args=2},
- search={args={1, 4}},
+ screenstring={args=2, base=1},
+ search={args={1, 4}, base=1},
searchcount={args={0,1}},
- searchdecl={args={1, 3}},
+ searchdecl={args={1, 3}, base=1},
searchpair={args={3, 7}},
searchpairpos={args={3, 7}},
- searchpos={args={1, 4}},
+ searchpos={args={1, 4}, base=1},
serverlist={},
serverstart={args={0, 1}},
serverstop={args=1},
- setbufline={args=3},
- setbufvar={args=3},
- setcharsearch={args=1},
- setcmdpos={args=1},
- setenv={args=2},
+ setbufline={args=3, base=3},
+ setbufvar={args=3, base=3},
+ setcharsearch={args=1, base=1},
+ setcmdpos={args=1, base=1},
+ setenv={args=2, base=2},
setfperm={args=2, base=1},
- setline={args=2},
+ setline={args=2, base=2},
setloclist={args={2, 4}},
setmatches={args={1, 2}},
setpos={args=2},
diff --git a/src/nvim/testdir/test_charsearch.vim b/src/nvim/testdir/test_charsearch.vim
index 17a49e02be..6f09e85a42 100644
--- a/src/nvim/testdir/test_charsearch.vim
+++ b/src/nvim/testdir/test_charsearch.vim
@@ -20,7 +20,7 @@ func Test_charsearch()
" check that setcharsearch() changes the settings.
3
normal! ylfep
- call setcharsearch({'char': 'k'})
+ eval {'char': 'k'}->setcharsearch()
normal! ;p
call setcharsearch({'forward': 0})
normal! $;p
diff --git a/src/nvim/testdir/test_clientserver.vim b/src/nvim/testdir/test_clientserver.vim
index f3db472b03..922803438f 100644
--- a/src/nvim/testdir/test_clientserver.vim
+++ b/src/nvim/testdir/test_clientserver.vim
@@ -82,7 +82,7 @@ func Test_client_server()
call remote_send(name, ":call server2client(expand('<client>'), 'got it')\<CR>", 'g:myserverid')
call assert_equal('got it', g:myserverid->remote_read(2))
- call remote_send(name, ":call server2client(expand('<client>'), 'another')\<CR>", 'g:myserverid')
+ call remote_send(name, ":eval expand('<client>')->server2client('another')\<CR>", 'g:myserverid')
let peek_result = 'nothing'
let r = g:myserverid->remote_peek('peek_result')
" unpredictable whether the result is already available.
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index 75e17b47b8..49a5386337 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -905,7 +905,7 @@ func Test_setcmdpos()
call assert_equal('"12ab', @:)
" setcmdpos() returns 1 when not editing the command line.
- call assert_equal(1, setcmdpos(3))
+ call assert_equal(1, 3->setcmdpos())
endfunc
func Test_cmdline_overstrike()
diff --git a/src/nvim/testdir/test_cursor_func.vim b/src/nvim/testdir/test_cursor_func.vim
index 46847e0663..a2482d95c4 100644
--- a/src/nvim/testdir/test_cursor_func.vim
+++ b/src/nvim/testdir/test_cursor_func.vim
@@ -86,7 +86,7 @@ func Test_screenpos()
call assert_equal({'row': winrow,
\ 'col': wincol + 13,
\ 'curscol': wincol + 13,
- \ 'endcol': wincol + 13}, screenpos(winid, 1, 7))
+ \ 'endcol': wincol + 13}, winid->screenpos(1, 7))
call assert_equal({'row': winrow + 2,
\ 'col': wincol + 1,
\ 'curscol': wincol + 1,
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index 61da3cbcaa..3a0c615cf6 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -387,7 +387,7 @@ func Test_diffoff()
call setline(1, ['One', '', 'Two', 'Three'])
diffthis
redraw
- call assert_notequal(normattr, screenattr(1, 1))
+ call assert_notequal(normattr, 1->screenattr(1))
diffoff!
redraw
call assert_equal(normattr, screenattr(1, 1))
diff --git a/src/nvim/testdir/test_environ.vim b/src/nvim/testdir/test_environ.vim
index cc15b63824..dd34983ee5 100644
--- a/src/nvim/testdir/test_environ.vim
+++ b/src/nvim/testdir/test_environ.vim
@@ -22,7 +22,7 @@ endfunc
func Test_setenv()
unlet! $TESTENV
- call setenv('TEST ENV', 'foo')
+ eval 'foo'->setenv('TEST ENV')
call assert_equal('foo', getenv('TEST ENV'))
call setenv('TEST ENV', v:null)
call assert_equal(v:null, getenv('TEST ENV'))
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 4a2ade5afa..2fcdd94188 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -346,7 +346,7 @@ func Test_setbufvar_options()
wincmd h
let wh = winheight(0)
let dummy_buf = bufnr('dummy_buf2', v:true)
- call setbufvar(dummy_buf, '&buftype', 'nofile')
+ eval 'nofile'->setbufvar(dummy_buf, '&buftype')
execute 'belowright vertical split #' . dummy_buf
call assert_equal(wh, winheight(0))
@@ -1330,7 +1330,7 @@ func Test_func_range_with_edit()
" is invalid in that buffer.
call writefile(['just one line'], 'Xfuncrange2')
new
- call setline(1, 10->range())
+ eval 10->range()->setline(1)
write Xfuncrange1
call assert_fails('5,8call EditAnotherFile()', 'E16:')
diff --git a/src/nvim/testdir/test_matchadd_conceal_utf8.vim b/src/nvim/testdir/test_matchadd_conceal_utf8.vim
index 34c8c49dd5..7bfac13ad8 100644
--- a/src/nvim/testdir/test_matchadd_conceal_utf8.vim
+++ b/src/nvim/testdir/test_matchadd_conceal_utf8.vim
@@ -6,7 +6,7 @@ endif
function! s:screenline(lnum) abort
let line = []
for c in range(1, winwidth(0))
- call add(line, nr2char(screenchar(a:lnum, c)))
+ call add(line, nr2char(a:lnum->screenchar(c)))
endfor
return s:trim(join(line, ''))
endfunction
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 7570049e7c..c796f1f676 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -1315,7 +1315,7 @@ func Test_search_match_at_curpos()
normal gg
- call search('foobar', 'c')
+ eval 'foobar'->search('c')
call assert_equal([1, 1], [line('.'), col('.')])
normal j
@@ -1354,6 +1354,41 @@ func Test_search_display_pattern()
endif
endfunc
+func Test_searchdecl()
+ let lines =<< trim END
+ int global;
+
+ func()
+ {
+ int global;
+ if (cond) {
+ int local;
+ }
+ int local;
+ // comment
+ }
+ END
+ new
+ call setline(1, lines)
+ 10
+ call assert_equal(0, searchdecl('local', 0, 0))
+ call assert_equal(7, getcurpos()[1])
+
+ 10
+ call assert_equal(0, 'local'->searchdecl(0, 1))
+ call assert_equal(9, getcurpos()[1])
+
+ 10
+ call assert_equal(0, searchdecl('global'))
+ call assert_equal(5, getcurpos()[1])
+
+ 10
+ call assert_equal(0, searchdecl('global', 1))
+ call assert_equal(1, getcurpos()[1])
+
+ bwipe!
+endfunc
+
func Test_search_special()
" this was causing illegal memory access and an endless loop
set t_PE=
diff --git a/src/nvim/testdir/test_utf8.vim b/src/nvim/testdir/test_utf8.vim
index da72da087f..1f2cdde5cf 100644
--- a/src/nvim/testdir/test_utf8.vim
+++ b/src/nvim/testdir/test_utf8.vim
@@ -69,7 +69,7 @@ func Test_screenchar_utf8()
call setline(1, ["ABC\u0308"])
redraw
call assert_equal([0x0041], screenchars(1, 1))
- call assert_equal([0x0042], screenchars(1, 2))
+ call assert_equal([0x0042], 1->screenchars(2))
call assert_equal([0x0043, 0x0308], screenchars(1, 3))
call assert_equal("A", screenstring(1, 1))
call assert_equal("B", screenstring(1, 2))