jcollard / elm-mode

Elm mode for emacs
GNU General Public License v3.0
375 stars 67 forks source link

Indentation isn't working properly #17

Closed gsingh93 closed 9 years ago

gsingh93 commented 9 years ago

After installing elm-mode, I made a new elm file and typed:

main : Element

and then hit enter. The next line was automatically indented 5 spaces, when it shouldn't have been indented at all. I then typed main = and hit tab twice, which unindented the line to the beginning, which is what I want. I then typed out the rest of the line, hit enter, and the line was again indented to 5 spaces.

This is obviously not the correct functionality. Are you experiencing this too, or is it just me?

jcollard commented 9 years ago

Just tested this and I am not experiencing this issue.

What version of emacs are you using?

Is there anything else in the file?

gsingh93 commented 9 years ago

I'm using Emacs 24.4.1 on Arch Linux. What I described in the issue is the only thing in the file.

I thought maybe some other minor mode I had was messing with it, so I tried starting emacs with the -q flag to make sure all other packages weren't loaded. Then I used load-file to load elm-mode.elc from the elpa install directory. I get the same behavior described above.

I've been using haskell-mode in the mean time, and that mode is working fine.

maxsnew commented 9 years ago

Are you sure you don't have electric-indent-mode on? That was the problem for me.

gsingh93 commented 9 years ago

@maxsnew That was it, thanks!

Just curious though, I tried a lot of major/minor modes for different languages, and I haven't had this problem before. What exactly in the design of this mode causes a problem with electric-indent-mode?