fix(events): make v:event readonly in more events (#18070)

This makes v:event readonly in these four events:
- ChanInfo
- ChanOpen
- RecordingLeave
- TermClose
This commit is contained in:
zeertzjq
2022-04-11 11:32:15 +08:00
committed by GitHub
parent cdfb045ea0
commit f89ca7194f
4 changed files with 35 additions and 0 deletions

View File

@@ -336,6 +336,7 @@ void terminal_close(Terminal *term, int status)
save_v_event_T save_v_event;
dict_T *dict = get_v_event(&save_v_event);
tv_dict_add_nr(dict, S_LEN("status"), status);
tv_dict_set_keys_readonly(dict);
apply_autocmds(EVENT_TERMCLOSE, NULL, NULL, false, buf);
restore_v_event(dict, &save_v_event);
}