mirror of
				https://github.com/minetest-mods/i3.git
				synced 2025-11-04 10:05:31 +01:00 
			
		
		
		
	Searches are now additive (Google-like)
This commit is contained in:
		
							
								
								
									
										17
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								init.lua
									
									
									
									
									
								
							@@ -117,6 +117,10 @@ end
 | 
			
		||||
local old_is_creative_enabled = core.is_creative_enabled
 | 
			
		||||
 | 
			
		||||
function core.is_creative_enabled(name)
 | 
			
		||||
	if name == "" then
 | 
			
		||||
		return old_is_creative_enabled(name)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	return check_privs(name, {creative = true}) or old_is_creative_enabled(name)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -616,7 +620,18 @@ local function search(data)
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		else
 | 
			
		||||
			to_add = find(search_in, filter, 1, true)
 | 
			
		||||
			local ok = true
 | 
			
		||||
 | 
			
		||||
			for keyword in gmatch(filter, "%S+") do
 | 
			
		||||
				if not find(search_in, keyword, 1, true) then
 | 
			
		||||
					ok = nil
 | 
			
		||||
					break
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			if ok then
 | 
			
		||||
				to_add = true
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		if to_add then
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user