aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-03 16:54:25 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-11-03 17:04:34 +0800
commitfe565ca382bb6cc4cd9f1c01de42d62c48922bf6 (patch)
treefc6c3550d92cbce3da5e2b5552fb46c93663e2a7 /test
parent981fa11c91d3655828b4f70ccf7d079d917d5b6b (diff)
downloadrneovim-fe565ca382bb6cc4cd9f1c01de42d62c48922bf6.tar.gz
rneovim-fe565ca382bb6cc4cd9f1c01de42d62c48922bf6.tar.bz2
rneovim-fe565ca382bb6cc4cd9f1c01de42d62c48922bf6.zip
vim-patch:9.1.0835: :setglobal doesn't work properly for 'ffu' and 'tsrfu'
Problem: :setglobal doesn't work properly for 'ffu' and 'tsrfu' when the local value is set (after v9.1.0831) Solution: Check os_flags instead of buffer option variable (zeertzjq). closes: vim/vim#15980 https://github.com/vim/vim/commit/6eda269600b5ca952f28e808c662f67e581933d7
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_findfile.vim37
-rw-r--r--test/old/testdir/test_ins_complete.vim41
2 files changed, 77 insertions, 1 deletions
diff --git a/test/old/testdir/test_findfile.vim b/test/old/testdir/test_findfile.vim
index 2c049537f0..539c7a661a 100644
--- a/test/old/testdir/test_findfile.vim
+++ b/test/old/testdir/test_findfile.vim
@@ -364,7 +364,7 @@ func Test_findfunc()
" Error cases
- " Function that doesn't any argument
+ " Function that doesn't take any arguments
func FindFuncNoArg()
endfunc
set findfunc=FindFuncNoArg
@@ -484,6 +484,41 @@ func Test_findfunc_scriptlocal_func()
call assert_equal('abc', g:FindFuncArg)
bw!
+ new | only
+ set findfunc=
+ setlocal findfunc=NoSuchFunc
+ setglobal findfunc=s:FindFuncScript
+ call assert_equal('NoSuchFunc', &findfunc)
+ call assert_equal('NoSuchFunc', &l:findfunc)
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &g:findfunc)
+ new | only
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &findfunc)
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &g:findfunc)
+ call assert_equal('', &l:findfunc)
+ let g:FindFuncArg = ''
+ find abc
+ call assert_equal('abc', g:FindFuncArg)
+ bw!
+
+ new | only
+ set findfunc=
+ setlocal findfunc=NoSuchFunc
+ set findfunc=s:FindFuncScript
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &findfunc)
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &g:findfunc)
+ call assert_equal('', &l:findfunc)
+ let g:FindFuncArg = ''
+ find abc
+ call assert_equal('abc', g:FindFuncArg)
+ new | only
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &findfunc)
+ call assert_equal(expand('<SID>') .. 'FindFuncScript', &g:findfunc)
+ call assert_equal('', &l:findfunc)
+ let g:FindFuncArg = ''
+ find abc
+ call assert_equal('abc', g:FindFuncArg)
+ bw!
+
set findfunc=
delfunc s:FindFuncScript
endfunc
diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim
index 01695d5be5..c02aa1db62 100644
--- a/test/old/testdir/test_ins_complete.vim
+++ b/test/old/testdir/test_ins_complete.vim
@@ -2268,6 +2268,7 @@ func Test_thesaurusfunc_callback()
call add(g:TsrFunc3Args, [a:findstart, a:base])
return a:findstart ? 0 : []
endfunc
+
set tsrfu=s:TsrFunc3
new
call setline(1, 'script1')
@@ -2283,6 +2284,46 @@ func Test_thesaurusfunc_callback()
call feedkeys("A\<C-X>\<C-T>\<Esc>", 'x')
call assert_equal([[1, ''], [0, 'script2']], g:TsrFunc3Args)
bw!
+
+ new | only
+ set thesaurusfunc=
+ setlocal thesaurusfunc=NoSuchFunc
+ setglobal thesaurusfunc=s:TsrFunc3
+ call assert_equal('NoSuchFunc', &thesaurusfunc)
+ call assert_equal('NoSuchFunc', &l:thesaurusfunc)
+ call assert_equal('s:TsrFunc3', &g:thesaurusfunc)
+ new | only
+ call assert_equal('s:TsrFunc3', &thesaurusfunc)
+ call assert_equal('s:TsrFunc3', &g:thesaurusfunc)
+ call assert_equal('', &l:thesaurusfunc)
+ call setline(1, 'script1')
+ let g:TsrFunc3Args = []
+ call feedkeys("A\<C-X>\<C-T>\<Esc>", 'x')
+ call assert_equal([[1, ''], [0, 'script1']], g:TsrFunc3Args)
+ bw!
+
+ new | only
+ set thesaurusfunc=
+ setlocal thesaurusfunc=NoSuchFunc
+ set thesaurusfunc=s:TsrFunc3
+ call assert_equal('s:TsrFunc3', &thesaurusfunc)
+ call assert_equal('s:TsrFunc3', &g:thesaurusfunc)
+ call assert_equal('', &l:thesaurusfunc)
+ call setline(1, 'script1')
+ let g:TsrFunc3Args = []
+ call feedkeys("A\<C-X>\<C-T>\<Esc>", 'x')
+ call assert_equal([[1, ''], [0, 'script1']], g:TsrFunc3Args)
+ setlocal bufhidden=wipe
+ new | only!
+ call assert_equal('s:TsrFunc3', &thesaurusfunc)
+ call assert_equal('s:TsrFunc3', &g:thesaurusfunc)
+ call assert_equal('', &l:thesaurusfunc)
+ call setline(1, 'script1')
+ let g:TsrFunc3Args = []
+ call feedkeys("A\<C-X>\<C-T>\<Esc>", 'x')
+ call assert_equal([[1, ''], [0, 'script1']], g:TsrFunc3Args)
+ bw!
+
delfunc s:TsrFunc3
" invalid return value