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,6 +2,7 @@ local icons = require('cosmic.core.theme.icons')
local M = {} local M = {}
function M.init() function M.init()
if vim.diagnostic ~= nil then
vim.diagnostic.config({ vim.diagnostic.config({
underline = true, underline = true,
update_in_insert = false, update_in_insert = false,
@ -14,6 +15,7 @@ function M.init()
signs = true, signs = true,
severity_sort = 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..._