mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	vim-patch:8.1.0414: v:option_old is cleared when using :set in OptionSet autocmd
Problem:    v:option_old and v:option_new are cleared when using :set in
            OptionSet autocmd. (Gary Johnson)
Solution:   Don't trigger OptionSet recursively.
3f3fb0b147
			
			
This commit is contained in:
		@@ -4019,7 +4019,8 @@ static char *set_bool_option(const int opt_idx, char_u *const varp,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  options[opt_idx].flags |= P_WAS_SET;
 | 
					  options[opt_idx].flags |= P_WAS_SET;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (!starting) {
 | 
					  // Don't do this while starting up or recursively.
 | 
				
			||||||
 | 
					  if (!starting && *get_vim_var_str(VV_OPTION_TYPE) == NUL) {
 | 
				
			||||||
    char buf_old[2];
 | 
					    char buf_old[2];
 | 
				
			||||||
    char buf_new[2];
 | 
					    char buf_new[2];
 | 
				
			||||||
    char buf_type[7];
 | 
					    char buf_type[7];
 | 
				
			||||||
@@ -4393,7 +4394,8 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  options[opt_idx].flags |= P_WAS_SET;
 | 
					  options[opt_idx].flags |= P_WAS_SET;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (!starting && errmsg == NULL) {
 | 
					  // Don't do this while starting up, failure or recursively.
 | 
				
			||||||
 | 
					  if (!starting && errmsg == NULL && *get_vim_var_str(VV_OPTION_TYPE) == NUL) {
 | 
				
			||||||
    char buf_old[NUMBUFLEN];
 | 
					    char buf_old[NUMBUFLEN];
 | 
				
			||||||
    char buf_new[NUMBUFLEN];
 | 
					    char buf_new[NUMBUFLEN];
 | 
				
			||||||
    char buf_type[7];
 | 
					    char buf_type[7];
 | 
				
			||||||
@@ -4426,7 +4428,10 @@ static char *set_num_option(int opt_idx, char_u *varp, long value,
 | 
				
			|||||||
static void trigger_optionsset_string(int opt_idx, int opt_flags,
 | 
					static void trigger_optionsset_string(int opt_idx, int opt_flags,
 | 
				
			||||||
                                      char *oldval, char *newval)
 | 
					                                      char *oldval, char *newval)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  if (oldval != NULL && newval != NULL) {
 | 
					  // Don't do this recursively.
 | 
				
			||||||
 | 
					  if (oldval != NULL
 | 
				
			||||||
 | 
					      && newval != NULL
 | 
				
			||||||
 | 
					      && *get_vim_var_str(VV_OPTION_TYPE) == NUL) {
 | 
				
			||||||
    char buf_type[7];
 | 
					    char buf_type[7];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vim_snprintf(buf_type, ARRAY_SIZE(buf_type), "%s",
 | 
					    vim_snprintf(buf_type, ARRAY_SIZE(buf_type), "%s",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user