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

No way to concatenate continuous lines #132

Open
dduan opened this issue Jan 3, 2020 · 2 comments
Open

No way to concatenate continuous lines #132

dduan opened this issue Jan 3, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@dduan
Copy link
Owner

dduan commented Jan 3, 2020

When an docstring entry spans multiple lines, there's no option to join them in addition to breaking over-the-column-limit lines up to newlines. Sometimes user may prefer automatic joining behavior. For example, when authoring comments, I may add some words in one line of comment as an edit and it would be nice when this comment gets folded into multiple lines, the next line can join up with end of the last newly created lines, as opposed to stay on the next line.

@dduan dduan added the enhancement New feature or request label Jan 3, 2020
@dduan
Copy link
Owner Author

dduan commented Jan 27, 2020

The biggest challenge is the formatting logic is a big hairball right now and working on it is unpleasant. I have some intuition for how to improve but it requires some energy and dedication to get it going.

@mattt
Copy link

mattt commented Jan 30, 2020

I can make a case for there being three desirable behaviors here:

  • Do nothing: Generate warnings, but don't change the input.
  • Column Wrap: If a line exceeds a specified width, insert a new line at the first whitespace counting backward from that width.
  • Re-render: Parse and re-render everything with CommonMark at a specified width, wiping out any soft line breaks.

If a user is sensitive to ragged edges caused by inserted newlines, then they'd be likely to want the more drastic "re-render everything to the 'one true format'" option (a la gofmt / prettier). I think any attempt to fill in ragged edges by changing downstream content will be a lot of work for something that's worse than the alternatives.

There's also a school of thought that Markdown's whitespace insensitivity can be exploited to make prose easier to read and write. For folks like me who subscribe to that, the first option (warn only) would be the most appealing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants