aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
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;
}