mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 04:28:33 +00:00
chore(docs): clarify vim.notify log_level parameter (#16436)
This commit is contained in:

committed by
GitHub

parent
150a5922aa
commit
72d62aa6aa
@@ -1200,20 +1200,16 @@ inspect({object}, {options}) *vim.inspect()*
|
|||||||
https://github.com/kikito/inspect.lua
|
https://github.com/kikito/inspect.lua
|
||||||
https://github.com/mpeterv/vinspect
|
https://github.com/mpeterv/vinspect
|
||||||
|
|
||||||
make_dict_accessor({scope}, {handle}) *vim.make_dict_accessor()*
|
notify({msg}, {log_level}, {opts}) *vim.notify()*
|
||||||
TODO: Documentation
|
|
||||||
|
|
||||||
notify({msg}, {log_level}, {_opts}) *vim.notify()*
|
|
||||||
Notification provider
|
Notification provider
|
||||||
|
|
||||||
Without a runtime, writes to :Messages
|
Without a runtime, writes to :Messages
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{msg} Content of the notification to show to the
|
{msg} string Content of the notification to show to
|
||||||
user
|
the user
|
||||||
{log_level} Optional log level
|
{log_level} number|nil enum from vim.log.levels
|
||||||
{opts} Dictionary with optional options (timeout,
|
{opts} table|nil additional options (timeout, etc)
|
||||||
etc)
|
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
:help nvim_notify
|
:help nvim_notify
|
||||||
|
@@ -323,6 +323,7 @@ end
|
|||||||
do
|
do
|
||||||
local validate = vim.validate
|
local validate = vim.validate
|
||||||
|
|
||||||
|
--@private
|
||||||
local function make_dict_accessor(scope, handle)
|
local function make_dict_accessor(scope, handle)
|
||||||
validate {
|
validate {
|
||||||
scope = {scope, 's'};
|
scope = {scope, 's'};
|
||||||
@@ -422,11 +423,10 @@ end
|
|||||||
---
|
---
|
||||||
--- Without a runtime, writes to :Messages
|
--- Without a runtime, writes to :Messages
|
||||||
---@see :help nvim_notify
|
---@see :help nvim_notify
|
||||||
---@param msg Content of the notification to show to the user
|
---@param msg string Content of the notification to show to the user
|
||||||
---@param log_level Optional log level
|
---@param log_level number|nil enum from vim.log.levels
|
||||||
---@param opts Dictionary with optional options (timeout, etc)
|
---@param opts table|nil additional options (timeout, etc)
|
||||||
function vim.notify(msg, log_level, _opts)
|
function vim.notify(msg, log_level, opts) -- luacheck: no unused
|
||||||
|
|
||||||
if log_level == vim.log.levels.ERROR then
|
if log_level == vim.log.levels.ERROR then
|
||||||
vim.api.nvim_err_writeln(msg)
|
vim.api.nvim_err_writeln(msg)
|
||||||
elseif log_level == vim.log.levels.WARN then
|
elseif log_level == vim.log.levels.WARN then
|
||||||
|
Reference in New Issue
Block a user