When the slash-star comment style is used and the comment contains a keyword like "if" or "for", then the next line is incorrectly indented. For example,
/* Comment contains if */
def foo = true
/* Comment contains for */
def bar = true
/* Clean comment, no problem */
def x = false
// This is fine either way -> if for
def y = false
This appears in groovy mode version 2.1 and in emacs version 26.1
Looking at your code in groovy-mode.el, it looks like that the function groovy--prev-code-line is incorrectly returning the comment lines between // as normal code to the function groovy-indent-line which is adding an additional indent level for the if or for blocks it "sees" in the comment.
I'll submit a merge request with what I think will fix the issue.
When the slash-star comment style is used and the comment contains a keyword like "if" or "for", then the next line is incorrectly indented. For example,
This appears in groovy mode version 2.1 and in emacs version 26.1
Looking at your code in groovy-mode.el, it looks like that the function groovy--prev-code-line is incorrectly returning the comment lines between / / as normal code to the function groovy-indent-line which is adding an additional indent level for the if or for blocks it "sees" in the comment.
I'll submit a merge request with what I think will fix the issue.