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

Inappropriate Indentation for classes with keyword names #163

Open
nosewings opened this issue Oct 18, 2020 · 2 comments
Open

Inappropriate Indentation for classes with keyword names #163

nosewings opened this issue Oct 18, 2020 · 2 comments
Labels

Comments

@nosewings
Copy link

Minimal example:

case class For()

On the line after this class declaration, pressing Tab causes an indentation. The same happens if I name the class If or While, but not, e.g., Foo.

@nosewings nosewings changed the title Scala-mode indents inappropriately for classes with keyword names Inappropriate Indentation for classes with keyword names Oct 18, 2020
@nosewings
Copy link
Author

On further inspection, I believe this is caused by the use of looking-at in scala-syntax:looking-back-token here, called from scala-indent:body-p here. M-x toggle-case-fold-search fixes the problem, so I'm not sure whether it should still be considered a bug.

@hvesalai
Copy link
Owner

Yes it's a bug. You shouldn't have to set anything. We need to add (let ((case-fold-search nil))) into all functions that use looking-at to fix this.

The best way would be to implement it once in scala-mode-lib.el (call it scala-lib:looking-at) and use that instead of the original.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Searching-and-Case.html

@hvesalai hvesalai added the Bug label Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants