From e9a2093fc1f3f0e43aef9826a8c8628818aa19f6 Mon Sep 17 00:00:00 2001 From: glepnir Date: Mon, 6 May 2024 19:14:57 +0800 Subject: [PATCH] fix wrong condition --- lua/indentmini/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/indentmini/init.lua b/lua/indentmini/init.lua index a4a05c8..ea768c4 100644 --- a/lua/indentmini/init.lua +++ b/lua/indentmini/init.lua @@ -120,8 +120,8 @@ local function on_line(_, _, bufnr, row) -- only render visible part of screen local toprow = vim.fn.line('w0') - 2 local botrow = vim.fn.line('w$') - 1 - srow = math.max(math.max(toprow, srow), 0) - erow = math.max(math.min(botrow, erow), api.nvim_buf_line_count(data.buf) - 1) + srow = math.max(toprow, srow) + erow = math.min(botrow, erow) local level = math.floor(curindent / shiftw) for i = srow + 1, erow, 1 do api.nvim_set_hl(