vim-lua
vim-lua copied to clipboard
Outdent line after an anon func argument
Fix anonymous function argument causes following line to be incorrectly indented.
Previously, it would give indentation like this:
data = self.kitchen
:digestCheese(function()
return 1
end)
self:Func() -- wrong indentation
data = self.kitchen
:eatCheese({fn = function()
return 10
end})
:digestCheese() -- wrong indentation
Now, it's like this:
data = self.kitchen
:digestCheese(function()
return 1
end)
self:Func()
data = self.kitchen
:eatCheese({fn = function()
return 10
end})
:digestCheese()
Add vader.vim tests:
- indented chained functions:
- worked before and still works
- indented chained anonymous function arguments:
- broken before and now works
- indented non first argument anonymous function:
- broken before and now works
Convert to draft: This causes incorrect indentation after an anonymous function in some cases.
if level then
local room = self:find(function(r)
return r.name == level
end)
if room then -- here
print(room)
end
end
local p = self.input:getActiveControls(function(value)
local name_remap = {
}
return name_remap[value] or value
end)
print(p) -- here