Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.
84 stars 39 forks source link

Add customize option for continuation-indent #132

Open djlindstr opened 6 years ago

djlindstr commented 6 years ago

It would be good if "continuation indent" could be customized. If I need to add line breaks in the parameter list, groovy-mode doesn't give me much choice on how to control indentation of the rest of the arguments.

This example is not very nice - the indentation depends on the length of the function name:

fun(arg1: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
    arg2: 234) {
    doThis()
    andThat()
}

The next one is more readable, but the argument list still lines up with the body, and we now need extra rows for the function name and argument list:

fun(
    arg1: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
    arg2: 234
) {
    doThis()
    andThat()
}

I would like to have this option:

fun(arg1: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
        arg2: 234) {
    doThis()
    andThat()
}

This would correspond to (c-set-offset 'arglist-cont-nonempty '++) in cc-mode, but I think that we can come up with a simpler customization option. :)