mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
feat(api): allow win_close in cmdwin to close wins except previous
Disallow closing the previous window from `nvim_win_close`, as this will cause issues. Again, no telling how safe this is. It also requires exposing old_curwin. :/ Also note that it's possible for the `&cmdheight` to change if, for example, there are 2 tabpages and `nvim_win_close` is used to close the last window in the other tabpage while `&stal` is 1. This is addressed in a later commit.
This commit is contained in:
@@ -404,10 +404,11 @@ void nvim_win_close(Window window, Boolean force, Error *err)
|
||||
if (cmdwin_type != 0) {
|
||||
if (win == curwin) {
|
||||
cmdwin_result = Ctrl_C;
|
||||
} else {
|
||||
return;
|
||||
} else if (win == cmdwin_old_curwin) {
|
||||
api_set_error(err, kErrorTypeException, "%s", e_cmdwin);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
tabpage_T *tabpage = win_find_tabpage(win);
|
||||
|
Reference in New Issue
Block a user