hvesalai / emacs-scala-mode

The definitive scala-mode for emacs
http://ensime.org
GNU General Public License v3.0
361 stars 68 forks source link

cannot insert a space #96

Closed mamciek closed 9 years ago

mamciek commented 9 years ago

I open new file e.g. hello.scala and start typing: package or class or any text, but I cannot type whitspace! I can insert whitespace inside some text, but not after or before. I am using the latest version from melpa

hvesalai commented 9 years ago

This is strange. I cannot reproduce with my settings. Must be some interaction with other packages. Which emacs version?

mamciek commented 9 years ago

I have figured it out. I had aggressive indent mode turned on, which was causing problem.

eipplusone commented 6 years ago

I believe this was closed prematurely.

Anyone using aggressive-indent-mode is going to have this problem.

Here's the relevant issue for the other repo - https://github.com/Malabarba/aggressive-indent-mode/issues/87

I must say, it's quite annoying to not be able to type space when you just start out with Scala:)

fommil commented 6 years ago

isn't the problem then with aggressive-indent-mode?

eipplusone commented 6 years ago

I'm not entirely sure, I haven't looked too much into it. If understand correctly scala-mode defines some whitespace cleanup functions - maybe to clean whitespace lets say after a semicolon? The aggressive-indent-mode job is to run indent functions essentially anytime buffer changes(ignoring the semicolon rule), hence the issue. From a quick glance it appears that scala-mode tries to be advanced in indents - maybe the right approach is to declare incompatibility with agressive-indent-mode and disable it for scala buffers and document that?

fommil commented 6 years ago

yeah that could work, we would accept a PR to do that (I don't know how to do what you're suggesting)... also needs to work when aggressive-indent-mode is not installed.

fommil commented 6 years ago

I'd also accept an entry in the docs to let it be known that they are incompatible...