aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorSean Dewar <6256228+seandewar@users.noreply.github.com>2024-03-19 12:59:44 +0000
committerSean Dewar <6256228+seandewar@users.noreply.github.com>2024-03-19 16:13:52 +0000
commit6091df6b7a0674a7215c5c1d2d93a1b37e9121b5 (patch)
tree4598b7647c1e29f1e18b5f26fe054f405bb44a70 /src/nvim/diff.c
parentd5c23d72a5e4d2abb0903e58c4953fa0303d4ad6 (diff)
downloadrneovim-6091df6b7a0674a7215c5c1d2d93a1b37e9121b5.tar.gz
rneovim-6091df6b7a0674a7215c5c1d2d93a1b37e9121b5.tar.bz2
rneovim-6091df6b7a0674a7215c5c1d2d93a1b37e9121b5.zip
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).
Diffstat (limited to 'src/nvim/diff.c')
0 files changed, 0 insertions, 0 deletions