mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
fix(terminal): set local values of window options (#29326)
This commit is contained in:
parent
4a24940980
commit
5def8714ad
@ -290,15 +290,15 @@ do
|
|||||||
vim.bo.undolevels = -1
|
vim.bo.undolevels = -1
|
||||||
vim.bo.scrollback = vim.o.scrollback < 0 and 10000 or math.max(1, vim.o.scrollback)
|
vim.bo.scrollback = vim.o.scrollback < 0 and 10000 or math.max(1, vim.o.scrollback)
|
||||||
vim.bo.textwidth = 0
|
vim.bo.textwidth = 0
|
||||||
vim.wo.wrap = false
|
vim.wo[0][0].wrap = false
|
||||||
vim.wo.list = false
|
vim.wo[0][0].list = false
|
||||||
|
|
||||||
-- This is gross. Proper list options support when?
|
-- This is gross. Proper list options support when?
|
||||||
local winhl = vim.o.winhighlight
|
local winhl = vim.o.winhighlight
|
||||||
if winhl ~= '' then
|
if winhl ~= '' then
|
||||||
winhl = winhl .. ','
|
winhl = winhl .. ','
|
||||||
end
|
end
|
||||||
vim.wo.winhighlight = winhl .. 'StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC'
|
vim.wo[0][0].winhighlight = winhl .. 'StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC'
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ describe(':terminal buffer', function()
|
|||||||
screen:expect([[
|
screen:expect([[
|
||||||
ab^c |
|
ab^c |
|
||||||
{4:~ }|
|
{4:~ }|
|
||||||
{17:========== }|
|
{5:========== }|
|
||||||
rows: 2, cols: 50 |
|
rows: 2, cols: 50 |
|
||||||
{2: } |
|
{2: } |
|
||||||
{18:========== }|
|
{18:========== }|
|
||||||
|
@ -12,6 +12,26 @@ local eval = n.eval
|
|||||||
local skip = t.skip
|
local skip = t.skip
|
||||||
local is_os = t.is_os
|
local is_os = t.is_os
|
||||||
|
|
||||||
|
describe(':terminal window', function()
|
||||||
|
before_each(clear)
|
||||||
|
|
||||||
|
it('sets local values of window options #29325', function()
|
||||||
|
command('setglobal wrap list')
|
||||||
|
command('terminal')
|
||||||
|
eq({ 0, 0, 1 }, eval('[&l:wrap, &wrap, &g:wrap]'))
|
||||||
|
eq({ 0, 0, 1 }, eval('[&l:list, &list, &g:list]'))
|
||||||
|
command('enew')
|
||||||
|
eq({ 1, 1, 1 }, eval('[&l:wrap, &wrap, &g:wrap]'))
|
||||||
|
eq({ 1, 1, 1 }, eval('[&l:list, &list, &g:list]'))
|
||||||
|
command('buffer #')
|
||||||
|
eq({ 0, 0, 1 }, eval('[&l:wrap, &wrap, &g:wrap]'))
|
||||||
|
eq({ 0, 0, 1 }, eval('[&l:list, &list, &g:list]'))
|
||||||
|
command('new')
|
||||||
|
eq({ 1, 1, 1 }, eval('[&l:wrap, &wrap, &g:wrap]'))
|
||||||
|
eq({ 1, 1, 1 }, eval('[&l:list, &list, &g:list]'))
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
describe(':terminal window', function()
|
describe(':terminal window', function()
|
||||||
local screen
|
local screen
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user