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

Add setting similar to word_separators for word wrap locations #3149

Open
RheingoldRiver opened this issue Dec 15, 2019 · 0 comments
Open

Add setting similar to word_separators for word wrap locations #3149

RheingoldRiver opened this issue Dec 15, 2019 · 0 comments

Comments

@RheingoldRiver
Copy link

Problem description

Punctuation adjacent to a word without any whitespace is able to wrap to the next line on its own, or be left behind on its own prior to a word wrapping. This is a problem not only in terms of personal preference, but also because it makes it impossible to see if there's an accidental whitespace character inside of quotes sometimes.

Plaintext wrapping properly:
image

Code text wrapping incorrectly:
image

Concern about extra whitespace:
image

Preferred solution

Add a preference called "word_wrap_locations" which is a list of regex with a ! or other character indicating where wraps are permitted. For example, to wrap only at whitespace, you could set !\s and \s!. To allow wrapping before a period that's a method call, but NOT before a period that's the end of a sentence (for example in a comment or raw string) you could do !\.\w

Alternatives

  • Add a preference to set word wrapping to behave like plaintext inside of quotations
  • Make a preference for word_wrap_style that can be either plaintext or code and then that can be set by users per language or globally.

Related Issues

This issue is related to #2356, but I think the problem there is a more specific case of this, and motivated for a different reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants