From 3f81f5c7a451f93a48103af4f1c31fd5f31d687f Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Wed, 27 Jan 2021 15:09:02 +0100 Subject: feat: adds vim.notify Adds function to notify the user like this: `:lua vim.notify("hello user")` embeds log levels vim.log.levels. you can then reassign vim.notify to for instance ``` function notify_external(msg, log_level, opts) vim.fn.jobstart({"notify-send", msg }) end ``` --- runtime/lua/vim/lsp/log.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'runtime/lua/vim/lsp/log.lua') diff --git a/runtime/lua/vim/lsp/log.lua b/runtime/lua/vim/lsp/log.lua index b6e91e37b9..4e8d2d4202 100644 --- a/runtime/lua/vim/lsp/log.lua +++ b/runtime/lua/vim/lsp/log.lua @@ -10,13 +10,7 @@ local log = {} -- Can be used to lookup the number from the name or the name from the number. -- Levels by name: 'trace', 'debug', 'info', 'warn', 'error' -- Level numbers begin with 'trace' at 0 -log.levels = { - TRACE = 0; - DEBUG = 1; - INFO = 2; - WARN = 3; - ERROR = 4; -} +log.levels = vim.log.levels -- Default log level is warn. local current_log_level = log.levels.WARN -- cgit