mirror of
https://github.com/neovim/neovim.git
synced 2026-07-04 08:35:13 +00:00
feat(lua): add notify_once() (#17010)
Like vim.notify(), but only displays the notification once. This function prints a warning message to the user only once per Nvim session. This is useful for things we want the user to see without being overwhelmed with warning messages (for example, the deprecation messages in LSP diagnostics).
This commit is contained in:
committed by
GitHub
parent
11dafcaf05
commit
f365e68293
@@ -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 = {
|
||||
@@ -1933,7 +1925,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 = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user