fix: highlights were not working properly
This commit is contained in:
parent
2f728c7e0f
commit
f8a224ab0f
|
@ -46,7 +46,11 @@ local function init()
|
||||||
focus_on_open = true,
|
focus_on_open = true,
|
||||||
mappings = true,
|
mappings = true,
|
||||||
tmux = false,
|
tmux = false,
|
||||||
highlights = {},
|
highlights = {
|
||||||
|
-- There is an error indexing the attribute
|
||||||
|
NormalFloat = {},
|
||||||
|
FloatBorder = {}
|
||||||
|
},
|
||||||
-- Layout configurations
|
-- Layout configurations
|
||||||
layout_mapping = "<A-u>",
|
layout_mapping = "<A-u>",
|
||||||
views = {
|
views = {
|
||||||
|
|
|
@ -50,8 +50,7 @@ local Terminal = require("toggleterm.terminal").Terminal
|
||||||
---@field signcolumn string The signcolumn set by the user before the terminal buffer overrides it
|
---@field signcolumn string The signcolumn set by the user before the terminal buffer overrides it
|
||||||
local Lf = {}
|
local Lf = {}
|
||||||
|
|
||||||
local function setup_term(highlights)
|
local function setup_term()
|
||||||
vim.validate({highlights = {highlights, "table", true}})
|
|
||||||
terminal.setup(
|
terminal.setup(
|
||||||
{
|
{
|
||||||
size = function(term)
|
size = function(term)
|
||||||
|
@ -63,12 +62,11 @@ local function setup_term(highlights)
|
||||||
end,
|
end,
|
||||||
hide_numbers = true,
|
hide_numbers = true,
|
||||||
shade_filetypes = {},
|
shade_filetypes = {},
|
||||||
shade_terminals = true,
|
shade_terminals = false,
|
||||||
shading_factor = "1",
|
shading_factor = "1",
|
||||||
start_in_insert = true,
|
start_in_insert = true,
|
||||||
insert_mappings = false,
|
insert_mappings = false,
|
||||||
persist_size = true,
|
persist_size = true,
|
||||||
highlights = highlights
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -98,7 +96,7 @@ function Lf:new(config)
|
||||||
-- Needs to be grabbed here before the terminal buffer is created
|
-- Needs to be grabbed here before the terminal buffer is created
|
||||||
self.signcolumn = o.signcolumn
|
self.signcolumn = o.signcolumn
|
||||||
|
|
||||||
setup_term(self.cfg.highlights)
|
setup_term()
|
||||||
self:__create_term()
|
self:__create_term()
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
@ -114,12 +112,12 @@ function Lf:__create_term()
|
||||||
direction = self.cfg.direction,
|
direction = self.cfg.direction,
|
||||||
winblend = self.cfg.winblend,
|
winblend = self.cfg.winblend,
|
||||||
close_on_exit = true,
|
close_on_exit = true,
|
||||||
|
highlights = self.cfg.highlights,
|
||||||
float_opts = {
|
float_opts = {
|
||||||
border = self.cfg.border,
|
border = self.cfg.border,
|
||||||
width = math.floor(o.columns * self.cfg.width),
|
width = math.floor(o.columns * self.cfg.width),
|
||||||
height = math.floor(o.lines * self.cfg.height),
|
height = math.floor(o.lines * self.cfg.height),
|
||||||
winblend = self.cfg.winblend,
|
winblend = self.cfg.winblend,
|
||||||
highlights = {border = "Normal", background = "Normal"}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Reference in New Issue