diff options
-rw-r--r-- | runtime/doc/options.txt | 3 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 1 | ||||
-rw-r--r-- | src/nvim/option.c | 3 | ||||
-rw-r--r-- | src/nvim/options.lua | 4 | ||||
-rw-r--r-- | src/nvim/testdir/test_breakindent.in | 2 | ||||
-rw-r--r-- | test/functional/legacy/listchars_spec.lua | 5 | ||||
-rw-r--r-- | test/functional/ui/syntax_conceal_spec.lua | 18 |
7 files changed, 23 insertions, 13 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index e8c844f7d2..e4719c3065 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4154,7 +4154,8 @@ A jump table for the options with a short description can be found at |Q_op|. changing the way tabs are displayed. *'listchars'* *'lcs'* -'listchars' 'lcs' string (default "eol:$") +'listchars' 'lcs' string (default: "tab:> ,trail:-,nbsp:+" + Vi default: "eol:$") global Strings to use in 'list' mode and for the |:list| command. It is a comma separated list of string settings. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index 5d4e6861f5..2edc10486c 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -39,6 +39,7 @@ these differences. - 'hlsearch' is set by default - 'incsearch' is set by default - 'langnoremap' is set by default +- 'listchars' defaults to "tab:> ,trail:-,nbsp:+" - 'mouse' defaults to "a" - 'nocompatible' is always set - 'nrformats' defaults to "hex" diff --git a/src/nvim/option.c b/src/nvim/option.c index 9a375c0675..2d6e2af89e 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -515,6 +515,9 @@ void set_init_1(void) /* Parse default for 'fillchars'. */ (void)set_chars_option(&p_fcs); + /* Parse default for 'listchars'. */ + (void)set_chars_option(&p_lcs); + /* enc_locale() will try to find the encoding of the current locale. */ p = enc_locale(); if (p != NULL) { diff --git a/src/nvim/options.lua b/src/nvim/options.lua index b269bfdc98..6506c6a9b5 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -1422,10 +1422,10 @@ return { full_name='listchars', abbreviation='lcs', type='string', list='comma', scope={'global'}, deny_duplicates=true, - vi_def=true, + vim=true, redraw={'all_windows'}, varname='p_lcs', - defaults={if_true={vi="eol:$"}} + defaults={if_true={vi="eol:$", vim="tab:> ,trail:-,nbsp:+"}} }, { full_name='loadplugins', abbreviation='lpl', diff --git a/src/nvim/testdir/test_breakindent.in b/src/nvim/testdir/test_breakindent.in index 5c6ec4d927..b05aef7f8d 100644 --- a/src/nvim/testdir/test_breakindent.in +++ b/src/nvim/testdir/test_breakindent.in @@ -57,7 +57,7 @@ STARTTEST :let line1=ScreenChar(line('.'),10) :call DoRecordScreen() :let g:test=" Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr" -:set briopt=shift:1,sbr,min:0 nu sbr=# list +:set briopt=shift:1,sbr,min:0 nu sbr=# list lcs&vi :let line1=ScreenChar(line('.'),10) :call DoRecordScreen() :let g:test=" Test 9: breakindent + shift by +1 + 'nu' + sbr=# list" diff --git a/test/functional/legacy/listchars_spec.lua b/test/functional/legacy/listchars_spec.lua index e6c64daed7..89ed90178b 100644 --- a/test/functional/legacy/listchars_spec.lua +++ b/test/functional/legacy/listchars_spec.lua @@ -5,7 +5,10 @@ local feed, insert, source = helpers.feed, helpers.insert, helpers.source local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect describe("'listchars'", function() - before_each(clear) + before_each(function() + clear() + execute('set listchars&vi') + end) it("works with 'list'", function() source([[ diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index ebfe067bbe..66ea779011 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -159,11 +159,13 @@ describe('Screen', function() ]]) end) - it('initially and conceal its start tag and end tag.', function() - execute("syn region rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-") + it('initially and conceal its start tag and end tag.', function() + -- concealends has a known bug (todo.txt) where the first match won't + -- be replaced with cchar. + execute("syn region rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-") screen:expect([[ - {1:-} a region of text {1:-} | - {1:-} a region of text {1:-} | + {1: } a region of text {1:-} | + {1: } a region of text {1:-} | ^ | ~ | ~ | @@ -179,9 +181,9 @@ describe('Screen', function() execute("syn region rText contains=rText matchgroup=rMatch start='<r>' end='</r>' concealends cchar=-") insert("<r> A region with <r> a nested <r> nested region.</r> </r> </r>\n") screen:expect([[ - {1:-} a region of text {1:-} | - {1:-} a region of text {1:-} | - {1:-} A region with {1:-} a nested {1:-} nested region.{1:-} | + {1: } a region of text {1:-} | + {1: } a region of text {1:-} | + {1: } A region with {1: } a nested {1: } nested region.{1:-} | {1:-} {1:-} | ^ | ~ | @@ -281,7 +283,7 @@ describe('Screen', function() execute("let &conceallevel=1") screen:expect([[ // No Conceal | - {1:-} | + {1: } | {1:C} | | ^ | |