Better handling of nvim .5 vs .6

This commit is contained in:
ViViDboarder 2021-12-14 16:20:07 -08:00
parent ca13faf07a
commit 052f75718d
2 changed files with 24 additions and 8 deletions

View File

@ -16,6 +16,16 @@ local function config_dark_notify()
}
end
-- Pin version dependent packages
pinned_commits = {}
if vim.fn.has('nvim-0.6.0') ~= 1 then
if vim.fn.has "nvim-0.5.1" == 1 then
pinned_commits["telescope"] = "80cdb00b221f69348afc4fb4b701f51eb8dd3120"
elseif vim.fn.has "nvim-0.5.0" == 1 then
pinned_commits["telescope"] = "587a10d1494d8ffa1229246228f0655db2f0a48a"
end
end
return require('packer').startup(function(use)
-- Load things faster!
use {'lewis6991/impatient.nvim', config = [[require('impatient')]]}
@ -237,6 +247,7 @@ return require('packer').startup(function(use)
"nvim-lua/plenary.nvim",
"nvim-lua/popup.nvim",
},
commit = pinned_commits["telescope"],
config = function() require("plugins.telescope") end,
}
--[[

View File

@ -60,6 +60,11 @@ function M.config_lualine(theme_name)
}
end
local diagnostic_plugin = "nvim_diagnostic"
if vim.fn.has('nvim-0.6.0') ~= 1 then
diagnostic_plugin = "nvim_lsp"
end
require("lualine").setup {
options = {
theme = theme_name,
@ -74,7 +79,7 @@ function M.config_lualine(theme_name)
lualine_x = { M.custom_ffenc, "filetype" },
lualine_y = { "progress", "location" },
lualine_z = {
{"diagnostics", sources = {"nvim_diagnostic"}},
{ "diagnostics", sources = { diagnostic_plugin } },
{ M.mixed_indent, color = { bg = "#de4f1f" } },
{ M.trailing_whitespace, color = { bg = "#de4f1f" } },
},