fix(winhl): do not crash when unsetting winhl in just opened window

fixes #19823
This commit is contained in:
bfredl
2022-08-18 09:43:07 +02:00
parent 02e9b5a8ee
commit 21b2906c9c
2 changed files with 17 additions and 1 deletions

View File

@@ -319,7 +319,7 @@ void update_window_hl(win_T *wp, bool invalid)
int ns_id = wp->w_ns_hl;
update_ns_hl(ns_id);
if (ns_id != wp->w_ns_hl_active) {
if (ns_id != wp->w_ns_hl_active || wp->w_ns_hl_attr == NULL) {
wp->w_ns_hl_active = ns_id;
wp->w_ns_hl_attr = *(NSHlAttr *)pmap_get(handle_T)(&ns_hl_attr, ns_id);