mirror of
https://github.com/neovim/neovim
synced 2025-07-18 18:21:46 +00:00
fix(options): using :set fillchars should clear local value
This commit is contained in:
@ -2665,14 +2665,19 @@ ambw_end:
|
|||||||
}
|
}
|
||||||
} else if (varp == &curwin->w_p_lcs) { // local 'listchars'
|
} else if (varp == &curwin->w_p_lcs) { // local 'listchars'
|
||||||
errmsg = set_chars_option(curwin, varp, true);
|
errmsg = set_chars_option(curwin, varp, true);
|
||||||
} else if (varp == &p_fcs) { // 'fillchars'
|
} else if (varp == &p_fcs) { // global 'fillchars'
|
||||||
errmsg = set_chars_option(curwin, varp, false);
|
errmsg = set_chars_option(curwin, varp, false);
|
||||||
if (!errmsg) {
|
if (errmsg == NULL) {
|
||||||
|
// The current window is set to use the global 'fillchars' value.
|
||||||
|
// So clear the window-local value.
|
||||||
|
if (!(opt_flags & OPT_GLOBAL)) {
|
||||||
|
clear_string_option(&curwin->w_p_fcs);
|
||||||
|
}
|
||||||
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
||||||
set_chars_option(wp, &wp->w_p_fcs, true);
|
set_chars_option(wp, &wp->w_p_fcs, true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
redraw_all_later(NOT_VALID);
|
redraw_all_later(NOT_VALID);
|
||||||
|
}
|
||||||
} else if (varp == &curwin->w_p_fcs) { // local 'fillchars'
|
} else if (varp == &curwin->w_p_fcs) { // local 'fillchars'
|
||||||
errmsg = set_chars_option(curwin, varp, true);
|
errmsg = set_chars_option(curwin, varp, true);
|
||||||
} else if (varp == &p_cedit) { // 'cedit'
|
} else if (varp == &p_cedit) { // 'cedit'
|
||||||
|
@ -67,6 +67,7 @@ describe("'fillchars'", function()
|
|||||||
shouldfail('eob:xy') -- two ascii chars
|
shouldfail('eob:xy') -- two ascii chars
|
||||||
shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8
|
shouldfail('eob:\255', 'eob:<ff>') -- invalid UTF-8
|
||||||
end)
|
end)
|
||||||
|
end)
|
||||||
it('has global value', function()
|
it('has global value', function()
|
||||||
screen:try_resize(50, 5)
|
screen:try_resize(50, 5)
|
||||||
insert("foo\nbar")
|
insert("foo\nbar")
|
||||||
@ -82,7 +83,7 @@ describe("'fillchars'", function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
it('has local window value', function()
|
it('has window-local value', function()
|
||||||
screen:try_resize(50, 5)
|
screen:try_resize(50, 5)
|
||||||
insert("foo\nbar")
|
insert("foo\nbar")
|
||||||
command('set laststatus=0')
|
command('set laststatus=0')
|
||||||
@ -97,6 +98,21 @@ describe("'fillchars'", function()
|
|||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
it('using :set clears window-local value', function()
|
||||||
|
screen:try_resize(50, 5)
|
||||||
|
insert("foo\nbar")
|
||||||
|
command('set laststatus=0')
|
||||||
|
command('setl fillchars=fold:x')
|
||||||
|
command('1,2fold')
|
||||||
|
command('vsplit')
|
||||||
|
command('set fillchars&')
|
||||||
|
screen:expect([[
|
||||||
|
^+-- 2 lines: foo········│+-- 2 lines: fooxxxxxxx|
|
||||||
|
~ │~ |
|
||||||
|
~ │~ |
|
||||||
|
~ │~ |
|
||||||
|
|
|
||||||
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user