mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(ui): set stc to empty in floatwin with minimal style (#21720)
fix(ui): set stc to emtpy in floatwin with minimal style
This commit is contained in:
@@ -3042,10 +3042,10 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
|
|||||||
Disables 'number', 'relativenumber', 'cursorline',
|
Disables 'number', 'relativenumber', 'cursorline',
|
||||||
'cursorcolumn', 'foldcolumn', 'spell' and 'list'
|
'cursorcolumn', 'foldcolumn', 'spell' and 'list'
|
||||||
options. 'signcolumn' is changed to `auto` and
|
options. 'signcolumn' is changed to `auto` and
|
||||||
'colorcolumn' is cleared. The end-of-buffer region is
|
'colorcolumn' is cleared. 'statuscolumn' is changed to
|
||||||
hidden by setting `eob` flag of 'fillchars' to a space
|
empty. The end-of-buffer region is hidden by setting
|
||||||
char, and clearing the |hl-EndOfBuffer| region in
|
`eob` flag of 'fillchars' to a space char, and clearing
|
||||||
'winhighlight'.
|
the |hl-EndOfBuffer| region in 'winhighlight'.
|
||||||
|
|
||||||
• border: Style of (optional) window border. This can either
|
• border: Style of (optional) window border. This can either
|
||||||
be a string or an array. The string values are
|
be a string or an array. The string values are
|
||||||
|
@@ -114,8 +114,9 @@
|
|||||||
/// float where the text should not be edited. Disables
|
/// float where the text should not be edited. Disables
|
||||||
/// 'number', 'relativenumber', 'cursorline', 'cursorcolumn',
|
/// 'number', 'relativenumber', 'cursorline', 'cursorcolumn',
|
||||||
/// 'foldcolumn', 'spell' and 'list' options. 'signcolumn'
|
/// 'foldcolumn', 'spell' and 'list' options. 'signcolumn'
|
||||||
/// is changed to `auto` and 'colorcolumn' is cleared. The
|
/// is changed to `auto` and 'colorcolumn' is cleared.
|
||||||
/// end-of-buffer region is hidden by setting `eob` flag of
|
/// 'statuscolumn' is changed to empty. The end-of-buffer
|
||||||
|
/// region is hidden by setting `eob` flag of
|
||||||
/// 'fillchars' to a space char, and clearing the
|
/// 'fillchars' to a space char, and clearing the
|
||||||
/// |hl-EndOfBuffer| region in 'winhighlight'.
|
/// |hl-EndOfBuffer| region in 'winhighlight'.
|
||||||
/// - border: Style of (optional) window border. This can either be a string
|
/// - border: Style of (optional) window border. This can either be a string
|
||||||
|
@@ -786,6 +786,12 @@ void win_set_minimal_style(win_T *wp)
|
|||||||
free_string_option(wp->w_p_cc);
|
free_string_option(wp->w_p_cc);
|
||||||
wp->w_p_cc = xstrdup("");
|
wp->w_p_cc = xstrdup("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// statuscolumn: cleared
|
||||||
|
if (wp->w_p_stc != NULL && *wp->w_p_stc != NUL) {
|
||||||
|
free_string_option(wp->w_p_stc);
|
||||||
|
wp->w_p_stc = xstrdup("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void win_config_float(win_T *wp, FloatConfig fconfig)
|
void win_config_float(win_T *wp, FloatConfig fconfig)
|
||||||
|
@@ -1329,6 +1329,54 @@ describe('float window', function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("would not break 'minimal' style with statuscolumn set", function()
|
||||||
|
command('set number')
|
||||||
|
command('set signcolumn=yes')
|
||||||
|
command('set colorcolumn=1')
|
||||||
|
command('set cursorline')
|
||||||
|
command('set foldcolumn=1')
|
||||||
|
command('set statuscolumn=%l%s%C')
|
||||||
|
command('hi NormalFloat guibg=#333333')
|
||||||
|
feed('ix<cr>y<cr><esc>gg')
|
||||||
|
meths.open_win(0, false, {relative='editor', width=20, height=4, row=4, col=10, style='minimal'})
|
||||||
|
if multigrid then
|
||||||
|
screen:expect{grid=[[
|
||||||
|
## grid 1
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[2:----------------------------------------]|
|
||||||
|
[3:----------------------------------------]|
|
||||||
|
## grid 2
|
||||||
|
{20:1}{21: }{19: }{20: }{22:^x}{21: }|
|
||||||
|
{14:2 }{19: }{14: }{22:y} |
|
||||||
|
{14:3 }{19: }{14: }{22: } |
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
{0:~ }|
|
||||||
|
## grid 3
|
||||||
|
|
|
||||||
|
## grid 4
|
||||||
|
{15:x }|
|
||||||
|
{15:y }|
|
||||||
|
{15: }|
|
||||||
|
{15: }|
|
||||||
|
]], float_pos={[4] = {{id = 1001}, "NW", 1, 4, 10, true}}}
|
||||||
|
else
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{20:1}{21: }{19: }{20: }{22:^x}{21: }|
|
||||||
|
{14:2 }{19: }{14: }{22:y} |
|
||||||
|
{14:3 }{19: }{14: }{22: } {15:x } |
|
||||||
|
{0:~ }{15:y }{0: }|
|
||||||
|
{0:~ }{15: }{0: }|
|
||||||
|
{0:~ }{15: }{0: }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
it('can have border', function()
|
it('can have border', function()
|
||||||
local buf = meths.create_buf(false, false)
|
local buf = meths.create_buf(false, false)
|
||||||
meths.buf_set_lines(buf, 0, -1, true, {' halloj! ',
|
meths.buf_set_lines(buf, 0, -1, true, {' halloj! ',
|
||||||
|
Reference in New Issue
Block a user