We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6211f93 commit 0dc4bc2Copy full SHA for 0dc4bc2
lua/indentmini/init.lua
@@ -87,8 +87,11 @@ local function make_snapshot(lnum)
87
local parent = node:parent()
88
if parent then
89
local p_srow = parent:range()
90
- indent = get_indent_lnum(p_srow + 1)
91
- indent = indent + context.step
+ -- usually top of file does not have indent so skiped
+ if p_srow > 0 then
92
+ indent = get_indent_lnum(p_srow + 1)
93
+ indent = indent + context.step
94
+ end
95
end
96
97
local packed = pack_snapshot(true, indent, indent)
0 commit comments