aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-29 21:07:29 +0800
committerGitHub <noreply@github.com>2022-11-29 21:07:29 +0800
commitd311c5481dede47d752fa39cb00d728ba18ef5bc (patch)
treedd2c01f384b4c3713a1d9c5b976cd7c0f8c91fcd /src/nvim/diff.c
parent89f0987bde8124f8fcbbcbf8320dbdabe0d69ba9 (diff)
parent95f5cf96912727a1ede055211645ac9779f3da44 (diff)
downloadrneovim-d311c5481dede47d752fa39cb00d728ba18ef5bc.tar.gz
rneovim-d311c5481dede47d752fa39cb00d728ba18ef5bc.tar.bz2
rneovim-d311c5481dede47d752fa39cb00d728ba18ef5bc.zip
Merge pull request #21234 from zeertzjq/vim-9.0.0965
vim-patch:9.0.{0965,0966,0967}: using one window for executing autocommands is insufficient
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 1ae0e91cda..64a142fa0e 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -2943,8 +2943,13 @@ void ex_diffgetput(exarg_T *eap)
// Need to make the other buffer the current buffer to be able to make
// changes in it.
- // set curwin/curbuf to buf and save a few things
+ // Set curwin/curbuf to buf and save a few things.
aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]);
+ if (curbuf != curtab->tp_diffbuf[idx_other]) {
+ // Could not find a window for this buffer, the rest is likely to
+ // fail.
+ goto theend;
+ }
}
const int idx_from = eap->cmdidx == CMD_diffget ? idx_other : idx_cur;