feat(lua): add notify_once() (#16956)

Like vim.notify(), but only displays the notification once.
This commit is contained in:
Gregory Anders
2022-01-06 11:10:56 -07:00
committed by GitHub
parent 2f779e3361
commit d78e46679d
5 changed files with 106 additions and 48 deletions

View File

@@ -10,14 +10,6 @@ local uv = vim.loop
local npcall = vim.F.npcall
local split = vim.split
local _warned = {}
local warn_once = function(message)
if not _warned[message] then
vim.api.nvim_err_writeln(message)
_warned[message] = true
end
end
local M = {}
local default_border = {
@@ -1928,7 +1920,6 @@ function M.lookup_section(settings, section)
end
M._get_line_byte_from_position = get_line_byte_from_position
M._warn_once = warn_once
M.buf_versions = {}