comparison src/evalwindow.c @ 34194:a522c6c0127b v9.1.0047

patch 9.1.0047: issues with temp curwin/buf while cmdwin is open Commit: https://github.com/vim/vim/commit/988f74311c26ea9917e84fbae608de226dba7e5f Author: Sean Dewar <seandewar@users.noreply.github.com> Date: Wed Aug 16 14:17:36 2023 +0100 patch 9.1.0047: issues with temp curwin/buf while cmdwin is open Problem: Things that temporarily change/restore curwin/buf (e.g: win_execute, some autocmds) may break assumptions that curwin/buf is the cmdwin when "cmdwin_type != 0", causing issues. Solution: Expose the cmdwin's real win/buf and check that instead. Also try to ensure these variables are NULL if "cmdwin_type == 0", allowing them to be used directly in most cases without checking cmdwin_type. (Sean Dewar) Alternatively, we could ban win_execute in the cmdwin and audit all places that temporarily change/restore curwin/buf, but I didn't notice any problems arising from allowing this (standard cmdwin restrictions still apply, so things that may actually break the cmdwin are still forbidden). closes: #12819 Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 23 Jan 2024 23:00:04 +0100
parents b89cfd86e18e
children 37b4c89ba420
comparison
equal deleted inserted replaced
34193:00b0bd66410b 34194:a522c6c0127b
1074 #endif 1074 #endif
1075 #ifdef FEAT_PROP_POPUP 1075 #ifdef FEAT_PROP_POPUP
1076 else if (WIN_IS_POPUP(wp)) 1076 else if (WIN_IS_POPUP(wp))
1077 rettv->vval.v_string = vim_strsave((char_u *)"popup"); 1077 rettv->vval.v_string = vim_strsave((char_u *)"popup");
1078 #endif 1078 #endif
1079 else if (wp == curwin && cmdwin_type != 0) 1079 else if (wp == cmdwin_win)
1080 rettv->vval.v_string = vim_strsave((char_u *)"command"); 1080 rettv->vval.v_string = vim_strsave((char_u *)"command");
1081 #ifdef FEAT_QUICKFIX 1081 #ifdef FEAT_QUICKFIX
1082 else if (bt_quickfix(wp->w_buffer)) 1082 else if (bt_quickfix(wp->w_buffer))
1083 rettv->vval.v_string = vim_strsave((char_u *) 1083 rettv->vval.v_string = vim_strsave((char_u *)
1084 (wp->w_llist_ref != NULL ? "loclist" : "quickfix")); 1084 (wp->w_llist_ref != NULL ? "loclist" : "quickfix"));