@@ -2210,9 +2210,13 @@ apply_autocmds_group(
2210
2210
ap -> last = FALSE;
2211
2211
ap -> last = TRUE;
2212
2212
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.
2213
2216
if (nesting == 1 )
2214
- // make sure cursor and topline are valid
2215
2217
check_lnums (TRUE);
2218
+ else
2219
+ check_lnums_nested (TRUE);
2216
2220
2217
2221
save_did_emsg = did_emsg ;
2218
2222
@@ -2830,7 +2834,7 @@ autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete)
2830
2834
}
2831
2835
}
2832
2836
2833
- group_name = dict_get_string (event_dict , ( char_u * ) "group" , TRUE);
2837
+ group_name = dict_get_string (event_dict , "group" , TRUE);
2834
2838
if (group_name == NULL || * group_name == NUL )
2835
2839
// if the autocmd group name is not specified, then use the current
2836
2840
// autocmd group
@@ -2865,7 +2869,7 @@ autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete)
2865
2869
{
2866
2870
varnumber_T bnum ;
2867
2871
2868
- bnum = dict_get_number_def (event_dict , ( char_u * ) "bufnr" , -1 );
2872
+ bnum = dict_get_number_def (event_dict , "bufnr" , -1 );
2869
2873
if (bnum == -1 )
2870
2874
continue ;
2871
2875
@@ -2905,13 +2909,13 @@ autocmd_add_or_delete(typval_T *argvars, typval_T *rettv, int delete)
2905
2909
pat = (char_u * )"" ;
2906
2910
}
2907
2911
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);
2910
2914
// if 'replace' is true, then remove all the commands associated with
2911
2915
// 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);
2913
2917
2914
- cmd = dict_get_string (event_dict , ( char_u * ) "cmd" , TRUE);
2918
+ cmd = dict_get_string (event_dict , "cmd" , TRUE);
2915
2919
if (cmd == NULL )
2916
2920
{
2917
2921
if (delete )
@@ -3073,8 +3077,7 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
3073
3077
// return only the autocmds in the specified group
3074
3078
if (dict_has_key (argvars [0 ].vval .v_dict , "group" ))
3075
3079
{
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);
3078
3081
if (name == NULL )
3079
3082
return ;
3080
3083
@@ -3098,8 +3101,7 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
3098
3101
{
3099
3102
int i ;
3100
3103
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);
3103
3105
if (name == NULL )
3104
3106
return ;
3105
3107
@@ -3124,8 +3126,7 @@ f_autocmd_get(typval_T *argvars, typval_T *rettv)
3124
3126
// return only the autocmds for the specified pattern
3125
3127
if (dict_has_key (argvars [0 ].vval .v_dict , "pattern" ))
3126
3128
{
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);
3129
3130
if (pat == NULL )
3130
3131
return ;
3131
3132
}
0 commit comments