immerrr/lua-mode — Issue #22: Single-line conditionals can confuse indenting
Author: rrthomas
Created: 2012-01-17 17:28:24+00:00
State: open

Try feeding the following code to lua-mode, and re-indent. The third line is indented an extra level, but it shouldn't be. However, the problem is minor, as the fourth line ("end") is correctly left alone.

function f (s, o)
if type (o) == "string" then return s .. o else return s .. tostring (o) end
return tostring (s) .. tostring (o)
end