refactor(lua): replace vim.cmd use with API calls (#19283)

Signed-off-by: Raphael <glephunter@gmail.com>
This commit is contained in:
Raphael
2022-07-10 00:40:32 +08:00
committed by GitHub
parent 7dbe6b1a46
commit 6b1a8f23d7
4 changed files with 71 additions and 87 deletions

View File

@@ -11,6 +11,7 @@ M.priorities = {
---@private
function M.create(higroup, hi_info, default)
vim.deprecate('vim.highlight.create', 'vim.api.nvim_set_hl', '0.9')
local options = {}
-- TODO: Add validation
for k, v in pairs(hi_info) do
@@ -28,6 +29,7 @@ end
---@private
function M.link(higroup, link_to, force)
vim.deprecate('vim.highlight.link', 'vim.api.nvim_set_hl', '0.9')
vim.cmd(string.format([[highlight%s link %s %s]], force and '!' or ' default', higroup, link_to))
end