2024-04-20 08:44:13 -07:00
|
|
|
local t = require('test.testutil')
|
|
|
|
local n = require('test.functional.testnvim')()
|
2016-04-17 11:23:30 -07:00
|
|
|
local Screen = require('test.functional.ui.screen')
|
2016-06-17 10:37:07 -07:00
|
|
|
|
2024-04-20 08:44:13 -07:00
|
|
|
local clear = n.clear
|
|
|
|
local command = n.command
|
|
|
|
local api = n.api
|
|
|
|
local feed = n.feed
|
2024-04-08 02:03:20 -07:00
|
|
|
local eq = t.eq
|
2016-06-17 10:37:07 -07:00
|
|
|
|
2016-11-16 16:33:45 -07:00
|
|
|
describe('matchparen', function()
|
2024-03-25 12:06:28 -07:00
|
|
|
local screen --- @type test.functional.ui.screen
|
2016-04-17 11:23:30 -07:00
|
|
|
|
|
|
|
before_each(function()
|
2019-08-05 01:25:49 -07:00
|
|
|
clear { args = { '-u', 'NORC' } }
|
2016-04-17 11:23:30 -07:00
|
|
|
screen = Screen.new(20, 5)
|
2016-08-09 06:11:04 -07:00
|
|
|
screen:set_default_attr_ids({
|
|
|
|
[0] = { bold = true, foreground = 255 },
|
|
|
|
[1] = { bold = true },
|
|
|
|
})
|
2016-04-17 11:23:30 -07:00
|
|
|
end)
|
|
|
|
|
|
|
|
it('uses correct column after i_<Up>. Vim patch 7.4.1296', function()
|
2017-04-08 14:12:26 -07:00
|
|
|
command('set noautoindent nosmartindent nocindent laststatus=0')
|
2024-01-12 10:59:57 -07:00
|
|
|
eq(1, api.nvim_get_var('loaded_matchparen'))
|
2016-04-17 11:23:30 -07:00
|
|
|
feed('ivoid f_test()<cr>')
|
|
|
|
feed('{<cr>')
|
|
|
|
feed('}')
|
|
|
|
|
|
|
|
-- critical part: up + cr should result in an empty line in between the
|
|
|
|
-- brackets... if the bug is there, the empty line will be before the '{'
|
|
|
|
feed('<up>')
|
|
|
|
feed('<cr>')
|
|
|
|
|
|
|
|
screen:expect([[
|
|
|
|
void f_test() |
|
|
|
|
{ |
|
|
|
|
^ |
|
|
|
|
} |
|
|
|
|
{1:-- INSERT --} |
|
2016-08-09 06:11:04 -07:00
|
|
|
]])
|
2016-04-17 11:23:30 -07:00
|
|
|
end)
|
|
|
|
end)
|