BREAKING CHANGES: plugin rewrite

This commit is contained in:
Pocco81
2022-07-31 00:27:43 -05:00
parent 8df684bcb3
commit 0288839edd
18 changed files with 430 additions and 807 deletions
-19
View File
@@ -1,19 +0,0 @@
" GPL-3.0 License
" prevent the plugin from loading twice
if exists('g:loaded_autosave') | finish | endif
let s:save_cpo = &cpo " save user coptions
set cpo&vim " reset them to defaults
" Interface {{{
command! ASToggle lua require'autosave.main'.main('toggle')
" }}}
let &cpo = s:save_cpo " restore after
unlet s:save_cpo
" set to true the var that controls the plugin's loading
let g:loaded_autosave = 1
+15
View File
@@ -0,0 +1,15 @@
if vim.g.loaded_auto_save then
return
end
vim.g.loaded_auto_save = true
local command = vim.api.nvim_create_user_command
local cnf = require("auto-save.config").options
command("AToggle", function()
require("auto-save").toggle()
end, {})
if cnf.enabled then
require("auto-save").on()
end