2024-04-08 02:03:20 -07:00
|
|
|
local t = require('test.functional.testutil')(after_each)
|
2019-03-22 16:23:39 -07:00
|
|
|
|
2024-04-08 02:03:20 -07:00
|
|
|
local clear = t.clear
|
|
|
|
local command = t.command
|
|
|
|
local eq = t.eq
|
|
|
|
local fn = t.fn
|
|
|
|
local api = t.api
|
|
|
|
local mkdir = t.mkdir
|
|
|
|
local rmdir = t.rmdir
|
|
|
|
local write_file = t.write_file
|
2019-03-22 16:23:39 -07:00
|
|
|
|
|
|
|
describe(':help', function()
|
|
|
|
before_each(clear)
|
|
|
|
|
|
|
|
it('window closed makes cursor return to a valid win/buf #9773', function()
|
2024-04-08 02:03:20 -07:00
|
|
|
t.add_builddir_to_rtp()
|
2019-03-22 16:23:39 -07:00
|
|
|
command('help help')
|
2024-01-12 10:59:57 -07:00
|
|
|
eq(1001, fn.win_getid())
|
2019-03-22 16:23:39 -07:00
|
|
|
command('quit')
|
2024-01-12 10:59:57 -07:00
|
|
|
eq(1000, fn.win_getid())
|
2019-03-22 16:23:39 -07:00
|
|
|
|
|
|
|
command('autocmd WinNew * wincmd p')
|
|
|
|
|
|
|
|
command('help help')
|
|
|
|
-- Window 1002 is opened, but the autocmd switches back to 1000 and
|
|
|
|
-- creates the help buffer there instead.
|
2024-01-12 10:59:57 -07:00
|
|
|
eq(1000, fn.win_getid())
|
2019-03-22 16:23:39 -07:00
|
|
|
command('quit')
|
|
|
|
-- Before #9773, Nvim would crash on quitting the help window.
|
2024-01-12 10:59:57 -07:00
|
|
|
eq(1002, fn.win_getid())
|
2019-03-22 16:23:39 -07:00
|
|
|
end)
|
2023-06-10 21:23:11 -07:00
|
|
|
|
2023-06-11 00:29:51 -07:00
|
|
|
it('multibyte help tags work #23975', function()
|
2023-06-10 21:23:11 -07:00
|
|
|
mkdir('Xhelptags')
|
|
|
|
finally(function()
|
|
|
|
rmdir('Xhelptags')
|
|
|
|
end)
|
|
|
|
mkdir('Xhelptags/doc')
|
|
|
|
write_file('Xhelptags/doc/Xhelptags.txt', '*…*')
|
|
|
|
command('helptags Xhelptags/doc')
|
|
|
|
command('set rtp+=Xhelptags')
|
|
|
|
command('help …')
|
2024-01-12 10:59:57 -07:00
|
|
|
eq('*…*', api.nvim_get_current_line())
|
2023-06-10 21:23:11 -07:00
|
|
|
end)
|
2019-03-22 16:23:39 -07:00
|
|
|
end)
|