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

Wrong indentation after import `scala.util.Try` #132

Closed jilen closed 7 years ago

jilen commented 7 years ago

screenshot from 2017-03-23 11-54-19

Seems Try was treat as keyword

fommil commented 7 years ago

Pull request with fix?

hvesalai commented 7 years ago

Can't reproduce. Also try as a keyword would be the same color as import. Now it is in different color meaning it is (at least by fontlock) detected as type.

It almost looks like you have case-insensitive regex and that is causing the problem.

hvesalai commented 7 years ago

https://www.gnu.org/software/emacs/manual/html_node/emacs/Search-Case.html

Have you touched case-fold-search? What is its value?

jilen commented 7 years ago
case-fold-search is a variable defined in ‘C source code’.
Its value is t

  Automatically becomes buffer-local when set.

Documentation:
Non-nil if searches and matches should ignore case.

You can customize this variable.

[back]
hvesalai commented 7 years ago

Hmm... I also have t

jilen commented 7 years ago

Force set it to nil solve my issue

(defun setup-scala ()
    (setq case-fold-search nil))

(add-hook 'scala-mode-hook 'setup-scala)
hvesalai commented 7 years ago

Ok, but that doesn't explain the bug since I have it also se to t and don't have the bug