@@ -2210,9 +2210,13 @@ apply_autocmds_group(
22102210 ap -> last = FALSE;
22112211 ap -> last = TRUE;
22122212
2213+ // Make sure cursor and topline are valid. The first time the current
2214+ // values are saved, restored by reset_lnums(). When nested only the
2215+ // values are corrected when needed.
22132216 if (nesting == 1 )
2214- // make sure cursor and topline are valid
22152217 check_lnums (TRUE);
2218+ else
2219+ check_lnums_nested (TRUE);
22162220
22172221 save_did_emsg = did_emsg ;
22182222
@@ -2830,7 +2834,7 @@ autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete)
28302834 }
28312835 }
28322836
2833- group_name = dict_get_string (event_dict , ( char_u * ) "group" , TRUE);
2837+ group_name = dict_get_string (event_dict , "group" , TRUE);
28342838 if (group_name == NULL || * group_name == NUL )
28352839 // if the autocmd group name is not specified, then use the current
28362840 // autocmd group
@@ -2865,7 +2869,7 @@ autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete)
28652869 {
28662870 varnumber_T bnum ;
28672871
2868- bnum = dict_get_number_def (event_dict , ( char_u * ) "bufnr" , -1 );
2872+ bnum = dict_get_number_def (event_dict , "bufnr" , -1 );
28692873 if (bnum == -1 )
28702874 continue ;
28712875
@@ -2905,13 +2909,13 @@ autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete)
29052909 pat = (char_u * )"" ;
29062910 }
29072911
2908- once = dict_get_bool (event_dict , ( char_u * ) "once" , FALSE);
2909- nested = dict_get_bool (event_dict , ( char_u * ) "nested" , FALSE);
2912+ once = dict_get_bool (event_dict , "once" , FALSE);
2913+ nested = dict_get_bool (event_dict , "nested" , FALSE);
29102914 // if 'replace' is true, then remove all the commands associated with
29112915 // this autocmd event/group and add the new command.
2912- replace = dict_get_bool (event_dict , ( char_u * ) "replace" , FALSE);
2916+ replace = dict_get_bool (event_dict , "replace" , FALSE);
29132917
2914- cmd = dict_get_string (event_dict , ( char_u * ) "cmd" , TRUE);
2918+ cmd = dict_get_string (event_dict , "cmd" , TRUE);
29152919 if (cmd == NULL )
29162920 {
29172921 if (delete )
@@ -3073,8 +3077,7 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
30733077 // return only the autocmds in the specified group
30743078 if (dict_has_key (argvars [0 ].vval .v_dict , "group" ))
30753079 {
3076- name = dict_get_string (argvars [0 ].vval .v_dict ,
3077- (char_u * )"group" , TRUE);
3080+ name = dict_get_string (argvars [0 ].vval .v_dict , "group" , TRUE);
30783081 if (name == NULL )
30793082 return ;
30803083
@@ -3098,8 +3101,7 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
30983101 {
30993102 int i ;
31003103
3101- name = dict_get_string (argvars [0 ].vval .v_dict ,
3102- (char_u * )"event" , TRUE);
3104+ name = dict_get_string (argvars [0 ].vval .v_dict , "event" , TRUE);
31033105 if (name == NULL )
31043106 return ;
31053107
@@ -3124,8 +3126,7 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
31243126 // return only the autocmds for the specified pattern
31253127 if (dict_has_key (argvars [0 ].vval .v_dict , "pattern" ))
31263128 {
3127- pat = dict_get_string (argvars [0 ].vval .v_dict ,
3128- (char_u * )"pattern" , TRUE);
3129+ pat = dict_get_string (argvars [0 ].vval .v_dict , "pattern" , TRUE);
31293130 if (pat == NULL )
31303131 return ;
31313132 }
0 commit comments