Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lua/indentmini/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ local function on_line(_, _, bufnr, row)
-- 1 1 2 2 3 3
local total = context.mixup and math.ceil(sp.indent / context.tabstop) or sp.indent - 1
local step = context.mixup and 1 or context.step
local higroup = 'IndentLine'
local higroup = 'Normal'
for i = 1, total, step do
local col = i - 1
local level = context.mixup and i or math.floor(col / context.step) + 1
Expand All @@ -267,9 +267,13 @@ local function on_line(_, _, bufnr, row)
then
local row_in_curblock = context.range_srow
and (row > context.range_srow and row < context.range_erow)
if opt.only_current and row_in_curblock and level == context.cur_inlevel then

if row_in_curblock and level == context.cur_inlevel then
higroup = 'IndentLineCurrent'
elseif not opt.only_current then
higroup = 'IndentLine'
end

opt.config.virt_text[1][2] = higroup
if sp.is_empty and col > 0 then
opt.config.virt_text_win_col = not context.mixup and i - 1 - context.leftcol
Expand Down