2021-03-01 16:49:41 -07:00
|
|
|
-- See also: src/nvim/testdir/test_options.vim
|
2016-04-23 16:53:11 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
2014-11-06 19:54:49 -07:00
|
|
|
local command, clear = helpers.command, helpers.clear
|
2016-02-08 22:10:55 -07:00
|
|
|
local source, expect = helpers.source, helpers.expect
|
2021-03-01 16:49:41 -07:00
|
|
|
local exc_exec = helpers.exc_exec;
|
|
|
|
local matches = helpers.matches;
|
|
|
|
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([[
|
|
|
|
|
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
~ |
|
|
|
|
|
|
|
|
|
scroll=7 |
|
|
|
|
Last set from changed window size |
|
|
|
|
Press ENTER or type command to continue^ |
|
|
|
|
]])
|
|
|
|
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)
|