Skip to content

Commit e5b541d

Browse files
committed
Another minor tweak to avoid nil indent arithmetic...
1 parent 4fa5e3e commit e5b541d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/lean/indent.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,17 @@ function M.indentexpr(linenr)
114114
return math.max(0, sorry - shiftwidth - 1)
115115
end
116116

117-
local _, last_indent = last:find '^%s+'
117+
local _, last_indent = last:find '^%s*'
118118

119119
if is_enclosed(linenr - 1, 0) then
120120
if is_enclosed(linenr - 2, 0) then
121121
return last_indent
122122
end
123-
return (last_indent or 0) + shiftwidth
123+
return last_indent + shiftwidth
124124
end
125125

126126
if INDENT_AFTER:match_str(last) then
127-
return (last_indent or 0) + shiftwidth
127+
return last_indent + shiftwidth
128128
end
129129

130130
if focuses_at(last, last_indent + 1) then

0 commit comments

Comments
 (0)