mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(vim.opt): #14708 Now lets you put duplicate values in wildmode
This commit is contained in:
		| @@ -325,9 +325,12 @@ local convert_value_to_vim = (function() | ||||
|       return result | ||||
|     end, | ||||
|  | ||||
|     [OptionTypes.ARRAY] = function(_, value) | ||||
|     [OptionTypes.ARRAY] = function(info, value) | ||||
|       if type(value) == "string" then return value end | ||||
|       return table.concat(remove_duplicate_values(value), ",") | ||||
|       if not info.allows_duplicates then | ||||
|         value = remove_duplicate_values(value) | ||||
|       end | ||||
|       return table.concat(value, ",") | ||||
|     end, | ||||
|  | ||||
|     [OptionTypes.MAP] = function(_, value) | ||||
|   | ||||
| @@ -7765,6 +7765,7 @@ static Dictionary vimoption2dict(vimoption_T *opt) | ||||
|     } | ||||
|     PUT(dict, "type", CSTR_TO_OBJ(type)); | ||||
|     PUT(dict, "default", def); | ||||
|     PUT(dict, "allows_duplicates", BOOL(!(opt->flags & P_NODUP))); | ||||
|  | ||||
|     return dict; | ||||
| } | ||||
|   | ||||
| @@ -3152,7 +3152,7 @@ return { | ||||
|       full_name='wildmode', abbreviation='wim', | ||||
|       short_desc=N_("mode for 'wildchar' command-line expansion"), | ||||
|       type='string', list='onecomma', scope={'global'}, | ||||
|       deny_duplicates=true, | ||||
|       deny_duplicates=false, | ||||
|       vim=true, | ||||
|       varname='p_wim', | ||||
|       defaults={if_true={vi="", vim="full"}} | ||||
|   | ||||
| @@ -1569,7 +1569,15 @@ describe('lua stdlib', function() | ||||
|       eq(wildignore, 'super_first,first,foo') | ||||
|     end) | ||||
|  | ||||
|   end) | ||||
|     it('should not remove duplicates from wildmode: #14708', function() | ||||
|       local wildmode = exec_lua [[ | ||||
|         vim.opt.wildmode = {"full", "list", "full"} | ||||
|         return vim.o.wildmode | ||||
|       ]] | ||||
|  | ||||
|       eq(wildmode, 'full,list,full') | ||||
|     end) | ||||
|   end) -- vim.opt | ||||
|  | ||||
|   it('vim.cmd', function() | ||||
|     exec_lua [[ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 TJ DeVries
					TJ DeVries