mirror of
				https://github.com/folke/lazy.nvim.git
				synced 2025-10-31 06:21:14 +00:00 
			
		
		
		
	fix(cache): reload file if compiled code is incompatible. Fixes #225
This commit is contained in:
		
					parent
					
						
							
								4e3a973f85
							
						
					
				
			
			
				commit
				
					
						b8c5ab5dae
					
				
			
		
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -158,7 +158,10 @@ function M.load(modkey, modpath) | |||
|     entry.used = os.time() | ||||
|     if M.eq(entry.hash, hash) then | ||||
|       -- found in cache and up to date | ||||
|       return loadstring(entry.chunk --[[@as string]], "@" .. entry.modpath) | ||||
|       local chunk, err = loadstring(entry.chunk --[[@as string]], "@" .. entry.modpath) | ||||
|       if not (err and err:find("cannot load incompatible bytecode", 1, true)) then | ||||
|         return chunk, err | ||||
|       end | ||||
|     end | ||||
|   else | ||||
|     entry = { hash = hash, modpath = modpath, used = os.time() } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue