fix(diagnostics): check for vim.diagnostics for 0.5.1 users

This commit is contained in:
Matt Leong 2021-10-20 13:09:06 -07:00
parent 093fbc0f78
commit 3265d8233a
2 changed files with 16 additions and 14 deletions

View file

@ -2,18 +2,20 @@ local icons = require('cosmic.core.theme.icons')
local M = {} local M = {}
function M.init() function M.init()
vim.diagnostic.config({ if vim.diagnostic ~= nil then
underline = true, vim.diagnostic.config({
update_in_insert = false, underline = true,
virtual_text = { update_in_insert = false,
spacing = 4, virtual_text = {
source = 'always', spacing = 4,
-- severity = 'error' source = 'always',
-- prefix = '👾', -- severity = 'error'
}, -- prefix = '👾',
signs = true, },
severity_sort = true, signs = true,
}) severity_sort = true,
})
end
local function do_diagnostic_signs() local function do_diagnostic_signs()
local signs = { local signs = {

View file

@ -33,7 +33,7 @@ _While CosmicNvim is geared specifically toward TypeScript/JavaScript developmen
### How to install ### How to install
_Requires Neovim (>=0.5.1)_ _Runs best on Neovim (>=0.6.0) but requires (>=0.5.1)_
Using [stow](https://www.gnu.org/software/stow/) Using [stow](https://www.gnu.org/software/stow/)
@ -64,7 +64,7 @@ You will need to set up Packers compiled file via the steps below:
1. Start NVIM 1. Start NVIM
2. Run `PackerUpdate` & `PackerCompile` 2. Run `PackerUpdate` & `PackerCompile`
3. Restart NVIM 3. Restart NVIM
4. Install LSPServers, `:LspInstallInfo` or `:LspInstall tsserver` 4. Install LSP servers, `:LspInstallInfo` or `:LspInstall tsserver`
_Install script coming soon..._ _Install script coming soon..._