aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2024-01-28 13:03:56 +0000
committerGitHub <noreply@github.com>2024-01-28 13:03:56 +0000
commita757195a602bf502fcdb702887bf72f50d6e1717 (patch)
tree41f77c24ddfb88b82eaf1c6a5748036276eea2f9 /src/nvim/api
parent74e695d22715e52f5561a185583b8c23d4fa0dd6 (diff)
parentd85f180f26c0570c2510c899a0bf0023ec55a692 (diff)
downloadrneovim-a757195a602bf502fcdb702887bf72f50d6e1717.tar.gz
rneovim-a757195a602bf502fcdb702887bf72f50d6e1717.tar.bz2
rneovim-a757195a602bf502fcdb702887bf72f50d6e1717.zip
Merge pull request #24704 from seandewar/cmdwin-madness
vim-patch:9.1.{0047,0048,0049}: fun cmdwin fixes
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/vim.c2
-rw-r--r--src/nvim/api/win_config.c2
-rw-r--r--src/nvim/api/window.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index eea9b54a5c..4bd8f551db 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -1022,7 +1022,7 @@ Integer nvim_open_term(Buffer buffer, Dict(open_term) *opts, Error *err)
return 0;
}
- if (cmdwin_type != 0 && buf == curbuf) {
+ if (buf == cmdwin_buf) {
api_set_error(err, kErrorTypeException, "%s", e_cmdwin);
return 0;
}
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index ccbd341fd2..6df86683c1 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -181,7 +181,7 @@ Window nvim_open_win(Buffer buffer, Boolean enter, Dict(float_config) *config, E
if (!buf) {
return 0;
}
- if (cmdwin_type != 0 && (enter || buf == curbuf)) {
+ if ((cmdwin_type != 0 && enter) || buf == cmdwin_buf) {
api_set_error(err, kErrorTypeException, "%s", e_cmdwin);
return 0;
}
diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c
index 00126c64f1..4ac7e47832 100644
--- a/src/nvim/api/window.c
+++ b/src/nvim/api/window.c
@@ -61,7 +61,7 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err)
if (!win || !buf) {
return;
}
- if (cmdwin_type != 0 && (win == curwin || win == cmdwin_old_curwin || buf == curbuf)) {
+ if (win == cmdwin_win || win == cmdwin_old_curwin || buf == cmdwin_buf) {
api_set_error(err, kErrorTypeException, "%s", e_cmdwin);
return;
}