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

fill-paragraph does not behave properly in comments #55

Open
dchenbecker opened this issue Mar 13, 2020 · 0 comments · May be fixed by #78
Open

fill-paragraph does not behave properly in comments #55

dchenbecker opened this issue Mar 13, 2020 · 0 comments · May be fixed by #78

Comments

@dchenbecker
Copy link

I noticed that if I manually wrap text in a comment, it does not handle the fact that it's in a comment. For example, with fill-column set to 10:

/**
 * This is a really long test with fill-column set to 10.
 */
class Foo : Bar() {
}

wraps to:

/** * This
is a
really
long test
with
fill-column
set to 10.
*/ class
Foo :
Bar() { }

But I would expect it to wrap to:

/**
 * This is 
 * a 
 * really
 * long
 * test
 * with 
 * fill-column
 * set to
 * 10.
 */
class Foo : Bar() {
}

That is, not wrap the code outside of the column, and to match the comment prefix asterisk. This is the behavior that java-mode exhibits. I've started looking at how java-mode handles this, but it's getting complicated quickly. I tried following what it's doing and set:

  (substitute-key-definition 'fill-paragraph 'c-fill-paragraph
			     kotlin-mode-map global-map)

But that doesn't work properly. I'm happy to help if someone can give me pointers on where to look.

@taku0 taku0 linked a pull request Mar 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant