Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdent line after an anon func argument #21

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

idbrii
Copy link
Contributor

@idbrii idbrii commented Jan 15, 2022

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

Fix anonymous function argument causes following line to be incorrectly
indented.

Add tests:

indented chained functions:
    worked before and still works
indented chained anonymous function arguments:
    broken before and now works
@idbrii idbrii marked this pull request as draft March 9, 2022 16:29
@idbrii
Copy link
Contributor Author

idbrii commented Mar 9, 2022

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

@idbrii idbrii marked this pull request as ready for review March 9, 2022 17:45
@idbrii idbrii marked this pull request as draft March 9, 2022 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant