Skip to content

Commit 0ab6a35

Browse files
committed
fix: remove unnecessary higroup
1 parent f0839ba commit 0ab6a35

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lua/indentmini/init.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ local function on_line(_, _, bufnr, row)
251251
-- 1 1 2 2 3 3
252252
local total = context.mixup and math.ceil(sp.indent / context.tabstop) or sp.indent - 1
253253
local step = context.mixup and 1 or context.step
254+
local higroup = 'IndentLine'
254255
for i = 1, total, step do
255256
local col = i - 1
256257
local level = context.mixup and i or math.floor(col / context.step) + 1
@@ -266,10 +267,8 @@ local function on_line(_, _, bufnr, row)
266267
then
267268
local row_in_curblock = context.range_srow
268269
and (row > context.range_srow and row < context.range_erow)
269-
local higroup = row_in_curblock and level == context.cur_inlevel and 'IndentLineCurrent'
270-
or 'IndentLine'
271-
if opt.only_current and row_in_curblock and level ~= context.cur_inlevel then
272-
higroup = 'IndentLineCurHide'
270+
if opt.only_current and row_in_curblock and level == context.cur_inlevel then
271+
higroup = 'IndentLineCurrent'
273272
end
274273
opt.config.virt_text[1][2] = higroup
275274
if sp.is_empty and col > 0 then
@@ -322,9 +321,5 @@ return {
322321
opt.config.virt_text = { { conf.char or '' } }
323322
opt.minlevel = conf.minlevel or 1
324323
set_provider(ns, { on_win = on_win, on_line = on_line })
325-
if opt.only_current and vim.opt.cursorline then
326-
local bg = api.nvim_get_hl(0, { name = 'CursorLine' }).bg
327-
api.nvim_set_hl(0, 'IndentLineCurHide', { fg = bg })
328-
end
329324
end,
330325
}

0 commit comments

Comments
 (0)