From 7a2d7dcf376984d02037d541be0e12c66745269a Mon Sep 17 00:00:00 2001 From: glepnir Date: Wed, 28 Aug 2024 17:15:37 +0800 Subject: [PATCH] fix: remove unnecessary check --- 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 bfe0b13..e347025 100644 --- a/lua/indentmini/init.lua +++ b/lua/indentmini/init.lua @@ -55,7 +55,7 @@ end --- @return integer the shiftwidth value of bufnr local function get_shiftw_value(bufnr) local handle = find_buffer_by_handle(bufnr, ffi.new('Error')) - return handle and get_sw_value(handle) or 0 + return get_sw_value(handle) end --- store the line data in snapshot and update the blank line indent @@ -166,7 +166,7 @@ local function on_line(_, _, bufnr, row) for i = 1, sp.indent - 1, context.step do local col = i - 1 local level = math.floor(col / context.step) + 1 - if not vim.bo[bufnr].expandtab or context.is_tab then + if context.is_tab then col = level - 1 end if