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

Funny indenting for functions #26

Closed
rrthomas opened this issue Jan 19, 2012 · 3 comments
Closed

Funny indenting for functions #26

rrthomas opened this issue Jan 19, 2012 · 3 comments

Comments

@rrthomas
Copy link
Contributor

Consider the following code:

local function f ()
return function g()
foo ()
end
end

Note that lua-mode indents the first "end" to line up with the second "function" keyword. But in that case, to be consistent, it should have indented lines 2 and 3 much more. My preferred solution would be for it to indent the first "end" by only two spaces, to line up with the "return". (I have lua-indent-level set to 2, but no other customization.)

@rrthomas
Copy link
Contributor Author

Another example:

_G.op["=="] = function (a, b)
return a == b
end
_G.op["~="] = function (a, b)
return a ~= b
end

Here, end is indented by lua-mode to line up with function. But:

_G.op["+"] = function (a, b)
return a + b
end
_G.op["-"] = function (a, b)
return a - b
end

Here, end is not indented. Both methods are consistent, but only one should be used!

immerrr added a commit that referenced this issue Mar 16, 2013
- completely rewritten left-shifter expression regexp
- reduced extra parsing work in cases when block-start token is already
  at (current-indentation).
@immerrr
Copy link
Owner

immerrr commented Mar 16, 2013

Hi there

This issue (and some others) should be fixed with the new commit. Please, see if it works for you.

Cheers

@immerrr
Copy link
Owner

immerrr commented Sep 10, 2013

Autumn cleanup, closing. Feel free to re-request assistance should the issue persist.

@immerrr immerrr closed this as completed Sep 10, 2013
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

No branches or pull requests

2 participants