diff --git a/lua/ibl/indent.lua b/lua/ibl/indent.lua index 3f35a16..433c4b0 100644 --- a/lua/ibl/indent.lua +++ b/lua/ibl/indent.lua @@ -73,6 +73,7 @@ M.get = function(whitespace, opts, indent_state) table.insert(whitespace_tbl, M.whitespace.TAB_FILL) end end + spaces = 0 else local mod = (spaces + tabs + extra) % shiftwidth if utils.tbl_contains(indent_state.stack, spaces + tabs) then diff --git a/specs/features/indent_spec.lua b/specs/features/indent_spec.lua index 6c45198..f2405ea 100644 --- a/specs/features/indent_spec.lua +++ b/specs/features/indent_spec.lua @@ -63,7 +63,7 @@ describe("indent", function() it("mix of tabs and spaces", function() local whitespace_tbl, _ = indent.get(" ", opts, { cap = false, stack = { 0 } }) - assert.are.same(whitespace_tbl, { INDENT, SPACE, TAB_START, TAB_END, SPACE, TAB_START_SINGLE }) + assert.are.same(whitespace_tbl, { INDENT, SPACE, TAB_START, TAB_END, SPACE, TAB_START, TAB_FILL, TAB_END }) end) it("mix of tabs and spaces with vartabstop", function()