neovim/test/functional/api
Sean Dewar 6091df6b7a
fix(api): nvim_create_buf assert fails if autocmds set &swapfile
Problem: assertion failure in nvim_create_buf if buflist_new autocommands open
a swapfile when "scratch" is set.

Solution: block autocommands when setting up the buffer; fire them later
instead.

Note that, unlike buflist_new, I don't check if autocommands aborted script
processing; the buffer is already created and configured at that point, so might
as well return the handle anyway.

Rather than repeat try_{start,end} and {un}block_autocmds for each relevant
operation, just do it at the start and near the end. This means that, if
TermResponse fires from unblock_autocmds for whatever reason, it can see the
buffer in an already configured state if we didn't bail due to an error (plus
it's probably a bit cleaner this way).
2024-03-19 16:13:52 +00:00
..
autocmd_spec.lua test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
buffer_spec.lua fix(api): fix set_lines viewport adjustment, but this time good 2024-03-14 10:56:24 +01:00
buffer_updates_spec.lua refactor(tests): get channel id via nvim_get_chan_info #27441 2024-02-12 05:50:39 -08:00
command_spec.lua test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
extmark_spec.lua feat(extmarks): subpriorities (relative to declaration order) (#27131) 2024-01-28 21:13:58 -06:00
highlight_spec.lua test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
keymap_spec.lua feat(api): support getting abbreviations (#26868) 2024-01-20 08:08:44 +08:00
menu_spec.lua refactor: format test/* 2024-01-03 02:09:29 +01:00
proc_spec.lua test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
rpc_fixture.lua refactor: format test/* 2024-01-03 02:09:29 +01:00
server_notifications_spec.lua refactor(tests): get channel id via nvim_get_chan_info #27441 2024-02-12 05:50:39 -08:00
server_requests_spec.lua refactor(tests): get channel id via nvim_get_chan_info #27441 2024-02-12 05:50:39 -08:00
tabpage_spec.lua fix(api): patch some cmdwin/textlock holes 2024-03-08 23:24:06 +00:00
ui_spec.lua test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
version_spec.lua test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
vim_spec.lua fix(api): nvim_create_buf assert fails if autocmds set &swapfile 2024-03-19 16:13:52 +00:00
window_spec.lua fix(api): update grid cursor in nvim_win_set_cursor() 2024-03-15 09:15:50 +01:00