Skip to content

Commit

Permalink
feat: added markdown support to logging methods
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 7, 2022
1 parent 853d4f7 commit 6e4d994
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lua/lsp-settings/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,28 @@ function M.exists(fname)
return (stat and stat.type) or false
end

function M.log(msg, hl)
vim.notify(msg, vim.log.levels.INFO, { title = "Lsp Settings" })
function M.notify(msg, level)
vim.notify(msg, level, {
title = "Lsp Settings",
on_open = function(win)
vim.api.nvim_win_set_option(win, "conceallevel", 3)
local buf = vim.api.nvim_win_get_buf(win)
vim.api.nvim_buf_set_option(buf, "filetype", "markdown")
vim.api.nvim_win_set_option(win, "spell", false)
end,
})
end

function M.warn(msg)
vim.notify(msg, vim.log.levels.WARN, { title = "Lsp Settings" })
M.notify(msg, vim.log.levels.WARN)
end

function M.error(msg)
vim.notify(msg, vim.log.levels.ERROR, { title = "Lsp Settings" })
M.notify(msg, vim.log.levels.ERROR)
end

function M.info(msg)
vim.notify(msg, vim.log.levels.INFO, { title = "Lsp Settings" })
M.notify(msg, vim.log.levels.INFO)
end

return M

0 comments on commit 6e4d994

Please sign in to comment.