aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/log.lua
diff options
context:
space:
mode:
authorDingcheng Yue <darwinsenior@gmail.com>2021-04-10 00:00:45 +0100
committerDingcheng Yue <darwinsenior@gmail.com>2021-04-16 11:43:20 +0100
commit6974d0c6c18f683256c3f96b902eae79660b5590 (patch)
tree4d5a7c7e0b16f9b88c57506ff7330ed5a084eb0d /runtime/lua/vim/lsp/log.lua
parent8a1a256b44f7fe9f0d878d4d28d7f41f8157c4ea (diff)
downloadrneovim-6974d0c6c18f683256c3f96b902eae79660b5590.tar.gz
rneovim-6974d0c6c18f683256c3f96b902eae79660b5590.tar.bz2
rneovim-6974d0c6c18f683256c3f96b902eae79660b5590.zip
lsp: deep copy vim.lsp.log when reloading
If vim.lsp.log is loaded the second time, the vim.log.levels will be modified with additional entries from 0-5. This will cause the require to fail as level:lower does not exists on numbered value.
Diffstat (limited to 'runtime/lua/vim/lsp/log.lua')
-rw-r--r--runtime/lua/vim/lsp/log.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/log.lua b/runtime/lua/vim/lsp/log.lua
index 331e980e67..471a311c16 100644
--- a/runtime/lua/vim/lsp/log.lua
+++ b/runtime/lua/vim/lsp/log.lua
@@ -10,7 +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 = vim.log.levels
+log.levels = vim.deepcopy(vim.log.levels)
-- Default log level is warn.
local current_log_level = log.levels.WARN