aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-24 11:20:23 +0800
committerGitHub <noreply@github.com>2023-09-24 11:20:23 +0800
commitac1c23442fd2688f89d75310b8c769e91d81e715 (patch)
treea0968c6c14af3c9d10f62bad9b14e8ec4b91a6e6
parent9f58867935362375101a52d6039d27c2ce4dce75 (diff)
downloadrneovim-ac1c23442fd2688f89d75310b8c769e91d81e715.tar.gz
rneovim-ac1c23442fd2688f89d75310b8c769e91d81e715.tar.bz2
rneovim-ac1c23442fd2688f89d75310b8c769e91d81e715.zip
test(old): don't set options to default before every test (#25335)
Oldtests clean up after themselves, and the options that need operators to align with Vim all deny duplicates, so there is no need to set them to default. Also make the variable name that test_listchars.vim uses to align with Vim more obvious.
-rw-r--r--runtime/doc/vim_diff.txt2
-rw-r--r--test/old/testdir/setup.vim5
-rw-r--r--test/old/testdir/test_listchars.vim12
3 files changed, 7 insertions, 12 deletions
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index d65e470dcf..8f339379bf 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -45,7 +45,7 @@ Defaults *nvim-defaults*
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
- 'display' defaults to "lastline"
- 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding)
-- 'fillchars' defaults (in effect) to "vert:│,fold:·,sep:│"
+- 'fillchars' defaults (in effect) to "vert:│,fold:·,foldsep:│"
- 'formatoptions' defaults to "tcqj"
- 'fsync' is disabled
- 'hidden' is enabled
diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim
index 94fbf2bef1..4e8859a33e 100644
--- a/test/old/testdir/setup.vim
+++ b/test/old/testdir/setup.vim
@@ -4,7 +4,6 @@ if exists('s:did_load')
set commentstring=/*%s*/
set complete=.,w,b,u,t,i
set define=^\\s*#\\s*define
- set directory&
set directory^=.
set display=
set fillchars=vert:\|,foldsep:\|,fold:-
@@ -21,13 +20,10 @@ if exists('s:did_load')
set shortmess=filnxtToOS
set sidescroll=0
set tags=./tags,tags
- set undodir&
set undodir^=.
set wildoptions=
set startofline
- set sessionoptions&
set sessionoptions+=options
- set viewoptions&
set viewoptions+=options
set switchbuf=
if g:testname !~ 'test_mapping.vim$'
@@ -59,7 +55,6 @@ endfunc
" Prevent Nvim log from writing to stderr.
let $NVIM_LOG_FILE = exists($NVIM_LOG_FILE) ? $NVIM_LOG_FILE : 'Xnvim.log'
-
" Make sure 'runtimepath' and 'packpath' does not include $HOME.
set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
let &packpath = &rtp
diff --git a/test/old/testdir/test_listchars.vim b/test/old/testdir/test_listchars.vim
index eed4d7e30c..69f1df3098 100644
--- a/test/old/testdir/test_listchars.vim
+++ b/test/old/testdir/test_listchars.vim
@@ -506,7 +506,7 @@ func Test_listchars_composing()
set list
set listchars=eol:$,space:_,nbsp:=
-
+
let nbsp1 = nr2char(0xa0)
let nbsp2 = nr2char(0x202f)
call append(0, [
@@ -533,22 +533,22 @@ endfunc
func Test_listchars_window_local()
%bw!
set list listchars&
- let l:default_listchars = &listchars " Accommodate Nvim default
+ let nvim_default = &listchars " Accommodate Nvim default
new
" set a local value for 'listchars'
setlocal listchars=tab:+-,eol:#
call s:CheckListCharsValue('tab:+-,eol:#')
" When local value is reset, global value should be used
setlocal listchars=
- call s:CheckListCharsValue(l:default_listchars) " Accommodate Nvim default
+ call s:CheckListCharsValue(nvim_default)
" Use 'setlocal <' to copy global value
setlocal listchars=space:.,extends:>
setlocal listchars<
- call s:CheckListCharsValue(l:default_listchars) " Accommodate Nvim default
+ call s:CheckListCharsValue(nvim_default)
" Use 'set <' to copy global value
setlocal listchars=space:.,extends:>
set listchars<
- call s:CheckListCharsValue(l:default_listchars) " Accommodate Nvim default
+ call s:CheckListCharsValue(nvim_default)
" Changing global setting should not change the local setting
setlocal listchars=space:.,extends:>
setglobal listchars=tab:+-,eol:#
@@ -558,7 +558,7 @@ func Test_listchars_window_local()
call s:CheckListCharsValue('space:.,extends:>')
" clearing local value in one window should not change the other window
set listchars&
- call s:CheckListCharsValue(l:default_listchars) " Accommodate Nvim default
+ call s:CheckListCharsValue(nvim_default)
close
call s:CheckListCharsValue('space:.,extends:>')