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

Correct indention inside of block after empty line #18

Closed
tonini opened this issue Jun 28, 2013 · 3 comments
Closed

Correct indention inside of block after empty line #18

tonini opened this issue Jun 28, 2013 · 3 comments

Comments

@tonini
Copy link
Contributor

tonini commented Jun 28, 2013

Currently the indention after empty lines inside and after blocks aren't working as excepted.

Instead of:

a = 2

b = a + 3

c = a + b

We got:

a = 2

    b = a + 3

            c = a + b

And

Instead of:

defmodule FooBar do
  def foo do
    if true, do: IO.puts \"yay\"
    20
  end

  def bar do
    if true, do: IO.puts \"yay\"
    20
  end
end

We got:

defmodule FooBar do
  def foo do
    if true, do: IO.puts "yay"
    20
  end

def bar do
  if true, do: IO.puts "yay"
  20
end
end

/cc @antifuchs

@tonini
Copy link
Contributor Author

tonini commented Jun 28, 2013

@antifuchs You're the lisp master and also have an idea how smie is working. ;)

It would be great if you find some time to check it out. 👍

I made some test for it: 3dced4e

cheers

sam

tomterl added a commit to tomterl/emacs-elixir that referenced this issue Mar 10, 2014
This is, if not a fix, a workaround for half of elixir-editors#18. In my elixir files
this produces no indentation errors; maybe you can test this against
your setup and see if it doesn't raise any red flags for you.

I don't know enough smie (yet), to look after the statement indentation
error, that is the other error reported in elixir-editors#18.
@mattdeboard
Copy link
Contributor

The issue on this ticket is the same as on #38: An incorrect value being returned by the smie-indent-after-keyword function in smie.el. I'm working on it now.

@mattdeboard
Copy link
Contributor

This is actually more annoying than the other, and I'm realizing that the fix I made in #48 is kind of a hack. It seems like there is something "wrong"/incomplete with the grammar specification. All of these indentation issues have a common ancestor I'm just having a hard time sorting out what it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants