2023-03-06 20:13:04 -07:00
|
|
|
-- See also: test/old/testdir/test_options.vim
|
2024-04-09 04:26:16 -07:00
|
|
|
local t = require('test.functional.testutil')()
|
2024-04-08 02:03:20 -07:00
|
|
|
local command, clear = t.command, t.clear
|
|
|
|
local source, expect = t.source, t.expect
|
|
|
|
local exc_exec = t.exc_exec
|
|
|
|
local matches = t.matches
|
2021-03-01 16:49:41 -07:00
|
|
|
local Screen = require('test.functional.ui.screen')
|
2014-10-22 15:34:54 -07:00
|
|
|
|
|
|
|
describe('options', function()
|
|
|
|
setup(clear)
|
|
|
|
|
2016-02-08 22:10:55 -07:00
|
|
|
it('should not throw any exception', function()
|
2014-11-04 11:48:18 -07:00
|
|
|
command('options')
|
2014-10-22 15:34:54 -07:00
|
|
|
end)
|
|
|
|
end)
|
2016-02-08 22:10:55 -07:00
|
|
|
|
|
|
|
describe('set', function()
|
2021-03-01 16:49:41 -07:00
|
|
|
before_each(clear)
|
2016-02-08 22:10:55 -07:00
|
|
|
|
|
|
|
it("should keep two comma when 'path' is changed", function()
|
|
|
|
source([[
|
|
|
|
set path=foo,,bar
|
|
|
|
set path-=bar
|
|
|
|
set path+=bar
|
|
|
|
$put =&path]])
|
|
|
|
|
|
|
|
expect([[
|
2017-09-24 11:42:48 -07:00
|
|
|
|
2016-02-08 22:10:55 -07:00
|
|
|
foo,,bar]])
|
|
|
|
end)
|
2021-03-01 16:49:41 -07:00
|
|
|
|
|
|
|
it('winminheight works', function()
|
|
|
|
local screen = Screen.new(20, 11)
|
|
|
|
screen:attach()
|
|
|
|
source([[
|
|
|
|
set wmh=0 stal=2
|
|
|
|
below sp | wincmd _
|
|
|
|
below sp | wincmd _
|
|
|
|
below sp | wincmd _
|
|
|
|
below sp
|
|
|
|
]])
|
|
|
|
matches('E36: Not enough room', exc_exec('set wmh=1'))
|
|
|
|
end)
|
2021-03-01 21:01:09 -07:00
|
|
|
|
2021-03-13 08:09:09 -07:00
|
|
|
it('winminheight works with tabline', function()
|
|
|
|
local screen = Screen.new(20, 11)
|
|
|
|
screen:attach()
|
|
|
|
source([[
|
|
|
|
set wmh=0 stal=2
|
|
|
|
split
|
|
|
|
split
|
|
|
|
split
|
|
|
|
split
|
|
|
|
tabnew
|
|
|
|
]])
|
|
|
|
matches('E36: Not enough room', exc_exec('set wmh=1'))
|
|
|
|
end)
|
|
|
|
|
2021-03-01 21:01:09 -07:00
|
|
|
it('scroll works', function()
|
|
|
|
local screen = Screen.new(42, 16)
|
|
|
|
screen:attach()
|
|
|
|
source([[
|
|
|
|
set scroll=2
|
|
|
|
set laststatus=2
|
|
|
|
]])
|
|
|
|
command('verbose set scroll?')
|
|
|
|
screen:expect([[
|
|
|
|
|
|
2024-03-22 03:02:52 -07:00
|
|
|
{1:~ }|*11
|
|
|
|
{3: }|
|
2021-03-01 21:01:09 -07:00
|
|
|
scroll=7 |
|
|
|
|
Last set from changed window size |
|
2024-03-22 03:02:52 -07:00
|
|
|
{6:Press ENTER or type command to continue}^ |
|
2021-03-01 21:01:09 -07:00
|
|
|
]])
|
|
|
|
end)
|
2021-12-24 22:30:34 -07:00
|
|
|
|
|
|
|
it('foldcolumn and signcolumn to empty string is disallowed', function()
|
|
|
|
matches('E474: Invalid argument: fdc=', exc_exec('set fdc='))
|
|
|
|
matches('E474: Invalid argument: scl=', exc_exec('set scl='))
|
|
|
|
end)
|
2016-02-08 22:10:55 -07:00
|
|
|
end)
|