mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2025-12-06 06:36:11 +00:00
chore: Deprecate unneeded utils, don't print enable/disable msg (#60)
This commit is contained in:
@@ -2,7 +2,6 @@ local M = {}
|
||||
|
||||
--- @class Config
|
||||
local cnf = require("auto-save.config")
|
||||
local echo = require("auto-save.utils.echo")
|
||||
local autocmds = require("auto-save.utils.autocommands")
|
||||
|
||||
local api = vim.api
|
||||
@@ -155,10 +154,8 @@ end
|
||||
function M.toggle()
|
||||
if autosave_running then
|
||||
M.off()
|
||||
echo("off")
|
||||
else
|
||||
M.on()
|
||||
echo("on")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
--- @deprecated
|
||||
local M = {}
|
||||
|
||||
--- @deprecated
|
||||
function M.set_of(list)
|
||||
local set = {}
|
||||
for i = 1, #list do
|
||||
@@ -8,6 +10,7 @@ function M.set_of(list)
|
||||
return set
|
||||
end
|
||||
|
||||
--- @deprecated
|
||||
function M.not_in(var, arr)
|
||||
if M.set_of(arr)[var] == nil then
|
||||
return true
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
local TITLE = "auto-save"
|
||||
|
||||
return function(msg, kind)
|
||||
local has_notify_plugin = pcall(require, "notify")
|
||||
local level = {}
|
||||
|
||||
if kind == "error" then
|
||||
level.log = vim.log.levels.ERROR
|
||||
level.type = "error"
|
||||
elseif kind == "warn" then
|
||||
level.log = vim.log.levels.WARN
|
||||
level.type = "error"
|
||||
else
|
||||
level.log = kind or vim.log.levels.INFO
|
||||
level.type = "info"
|
||||
end
|
||||
|
||||
if has_notify_plugin then
|
||||
vim.notify(msg, level.log, {
|
||||
title = TITLE,
|
||||
})
|
||||
else
|
||||
vim.notify(("%s: %s"):format(TITLE, msg), level.log)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user