fix: highlights

This commit is contained in:
Folke Lemaitre 2022-11-20 23:34:35 +01:00
parent 57d024ef19
commit 35b1f98ac7
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
4 changed files with 10 additions and 17 deletions

View File

@ -1,5 +1,5 @@
Util = require("lazy.util") local Util = require("lazy.util")
Config = require("lazy.config") local Config = require("lazy.config")
local M = {} local M = {}

View File

@ -15,21 +15,15 @@ M.colors = {
Special = "@punctuation.special", Special = "@punctuation.special",
} }
M.did_setup = true M.did_setup = false
function M.set_hl() function M.set_hl()
for hl_group, opts in pairs(M.colors) do for hl_group, opts in pairs(M.colors) do
hl_group = "Lazy" .. hl_group
if type(opts) == "string" then if type(opts) == "string" then
opts = { opts = { link = opts }
link = opts,
}
end end
opts.default = true opts.default = true
vim.api.nvim_set_hl(0, "Lazy" .. hl_group, opts)
vim.api.nvim_set_hl(0, hl_group, opts)
end end
end end

View File

@ -1,3 +1,4 @@
local Util = require("lazy.util")
local Render = require("lazy.view.render") local Render = require("lazy.view.render")
local M = {} local M = {}
@ -71,11 +72,8 @@ function M.show()
local render = Util.throttle(30, function() local render = Util.throttle(30, function()
vim.bo[buf].modifiable = true vim.bo[buf].modifiable = true
Render.render_plugins(buf, win, 2) Render.render_plugins(buf, win, 2)
vim.bo[buf].modifiable = false vim.bo[buf].modifiable = false
vim.cmd.redraw() vim.cmd.redraw()
end) end)

View File

@ -1,8 +1,9 @@
---@alias TextString {str: string, hl?:string, extmark?:table} local Config = require("lazy.config")
---@alias TextLine TextString[]
---@alias TextSegment {str: string, hl?:string, extmark?:table}
---@class Text ---@class Text
---@field _lines TextLine[] ---@field _lines TextSegment[][]
local Text = {} local Text = {}
function Text.new() function Text.new()