mirror of
https://github.com/neovim/neovim.git
synced 2026-07-10 03:19:44 +00:00
options: make 'fillchars' and 'listchars' global-local
These options were previously global. A global-local window option
behaves closer to a global option "per default" (i e with :set),
but still supports local behavior via :setl
Also this restores back-compat for nvim_set_option("fcs", ...)
which are currently broken on 0.4.x but worked in earlier versions
This commit is contained in:
committed by
Justin M. Keyes
parent
5d41bfccec
commit
92e80f18a8
@@ -71,15 +71,28 @@ describe("'fillchars'", function()
|
||||
shouldfail('eob:xy') -- two ascii chars
|
||||
shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8
|
||||
end)
|
||||
it('is local to window', function()
|
||||
clear()
|
||||
screen = Screen.new(50, 5)
|
||||
screen:attach()
|
||||
it('has global value', function()
|
||||
screen:try_resize(50, 5)
|
||||
insert("foo\nbar")
|
||||
command('set laststatus=0')
|
||||
command('1,2fold')
|
||||
command('vsplit')
|
||||
command('set fillchars=fold:x')
|
||||
screen:expect([[
|
||||
^+-- 2 lines: fooxxxxxxxx│+-- 2 lines: fooxxxxxxx|
|
||||
~ │~ |
|
||||
~ │~ |
|
||||
~ │~ |
|
||||
|
|
||||
]])
|
||||
end)
|
||||
it('has local window value', function()
|
||||
screen:try_resize(50, 5)
|
||||
insert("foo\nbar")
|
||||
command('set laststatus=0')
|
||||
command('1,2fold')
|
||||
command('vsplit')
|
||||
command('setl fillchars=fold:x')
|
||||
screen:expect([[
|
||||
^+-- 2 lines: fooxxxxxxxx│+-- 2 lines: foo·······|
|
||||
~ │~ |
|
||||
@@ -100,16 +113,25 @@ describe("'listchars'", function()
|
||||
screen:attach()
|
||||
end)
|
||||
|
||||
after_each(function()
|
||||
screen:detach()
|
||||
end)
|
||||
|
||||
it('is local to window', function()
|
||||
it('has global value', function()
|
||||
feed('i<tab><tab><tab><esc>')
|
||||
command('set laststatus=0')
|
||||
command('set list listchars=tab:<->')
|
||||
command('set list laststatus=0')
|
||||
command('vsplit')
|
||||
command('set listchars&')
|
||||
command('set listchars=tab:<->')
|
||||
screen:expect([[
|
||||
<------><------>^<------> │<------><------><------>|
|
||||
~ │~ |
|
||||
~ │~ |
|
||||
~ │~ |
|
||||
|
|
||||
]])
|
||||
end)
|
||||
it('has value local to window', function()
|
||||
feed('i<tab><tab><tab><esc>')
|
||||
command('set list laststatus=0')
|
||||
command('setl listchars=tab:<->')
|
||||
command('vsplit')
|
||||
command('setl listchars<')
|
||||
screen:expect([[
|
||||
> > ^> │<------><------><------>|
|
||||
~ │~ |
|
||||
|
||||
@@ -12,7 +12,10 @@ describe('ui/mouse/input', function()
|
||||
clear()
|
||||
meths.set_option('mouse', 'a')
|
||||
meths.set_option('list', true)
|
||||
meths.set_option('listchars', 'eol:$')
|
||||
-- NB: this is weird, but mostly irrelevant to the test
|
||||
-- So I didn't bother to change it
|
||||
command('set listchars=eol:$')
|
||||
command('setl listchars=nbsp:x')
|
||||
screen = Screen.new(25, 5)
|
||||
screen:attach()
|
||||
screen:set_default_attr_ids({
|
||||
@@ -814,7 +817,8 @@ describe('ui/mouse/input', function()
|
||||
|
||||
feed_command('set concealcursor=ni')
|
||||
feed_command('set nowrap')
|
||||
feed_command('set shiftwidth=2 tabstop=4 list listchars=tab:>-')
|
||||
feed_command('set shiftwidth=2 tabstop=4 list')
|
||||
feed_command('setl listchars=tab:>-')
|
||||
feed_command('syntax match NonText "\\*" conceal')
|
||||
feed_command('syntax match NonText "cats" conceal cchar=X')
|
||||
feed_command('syntax match NonText "x" conceal cchar=>')
|
||||
|
||||
Reference in New Issue
Block a user