fix lazyloading for autosave.nvim
This commit is contained in:
		
							parent
							
								
									299ce1cde3
								
							
						
					
					
						commit
						f016bf634e
					
				| @ -1,5 +1,7 @@ | ||||
| local M = {} | ||||
| 
 | ||||
| local config = require("core.utils").load_config() | ||||
| 
 | ||||
| M.autopairs = function() | ||||
|    local present1, autopairs = pcall(require, "nvim-autopairs") | ||||
|    local present2, autopairs_completion = pcall(require, "nvim-autopairs.completion.cmp") | ||||
| @ -23,7 +25,7 @@ M.autosave = function() | ||||
|    end | ||||
| 
 | ||||
|    autosave.setup { | ||||
|       enabled = vim.g.auto_save or false, -- takes boolean value from init.lua | ||||
|       enabled = config.options.plugin.autosave, -- takes boolean value from chadrc.lua | ||||
|       execution_message = "autosaved at : " .. vim.fn.strftime "%H:%M:%S", | ||||
|       events = { "InsertLeave", "TextChanged" }, | ||||
|       conditions = { | ||||
| @ -38,7 +40,6 @@ M.autosave = function() | ||||
| end | ||||
| 
 | ||||
| M.better_escape = function() | ||||
|    local config = require("core.utils").load_config() | ||||
|    vim.g.better_escape_interval = config.options.plugin.esc_insertmode_timeout or 300 | ||||
| end | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user