0

For example, | is the location of the cursor.

/*
 * This is a comment|
 */

Now I type Enter. I would prefer the screen becomes:

/*
 * This is a comment
 * |
 */

But in reality it is

/*
 * This is a comment
 |

How can I achieve the preferred screen in js2-mode?

1
  • Type M-j (bound to default-indent-new-line whose doc string says: Break line at point and indent. If a comment syntax is defined, call ‘comment-line-break-function’. ).
    – NickD
    Commented Apr 25 at 5:37

1 Answer 1

1

Type M-j, bound to default-indent-new-line whose doc string says:

Break line at point and indent.
If a comment syntax is defined, call ‘comment-line-break-function’.

That should work in most programming modes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.