chore: Deprecate unneeded utils, don't print enable/disable msg (#60)

This commit is contained in:
Toni Müller
2024-12-04 07:17:34 +01:00
committed by GitHub
parent 5fbcaac0a2
commit f8e3ac2857
5 changed files with 39 additions and 59 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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