mirror of
				https://github.com/folke/lazy.nvim.git
				synced 2025-10-31 14:31:04 +00:00 
			
		
		
		
	refactor: reloader
This commit is contained in:
		
					parent
					
						
							
								025520d083
							
						
					
				
			
			
				commit
				
					
						f4d57485b0
					
				
			
		
					 2 changed files with 20 additions and 12 deletions
				
			
		|  | @ -92,7 +92,10 @@ function M.pretty_trace(opts) | |||
|   return #trace > 0 and ("\n\n# stacktrace:\n" .. table.concat(trace, "\n")) or "" | ||||
| end | ||||
| 
 | ||||
| ---@generic R | ||||
| ---@param fn fun():R | ||||
| ---@param opts? string|{msg:string, on_error:fun(msg)} | ||||
| ---@return R | ||||
| function M.try(fn, opts) | ||||
|   opts = type(opts) == "string" and { msg = opts } or opts or {} | ||||
|   local msg = opts.msg | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue