-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
don't break on hyphen with :reflow #8569
don't break on hyphen with :reflow #8569
Conversation
I think this could just be the default behaviour. Hypenization seems like it's almost never what you want in a plaintext document. |
f5c5738
to
840633d
Compare
I changed the default to adopt the new behavior, if that's ok with everyone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need a config option for this? If it's sane behavior in all cases then I think we should just hardcode it and get rid of the config option. If it makes sense to break on hyphens only for some languages then this should be language-level configuration instead of editor-wide
book/src/configuration.md
Outdated
@@ -65,6 +65,7 @@ Its settings will be merged with the configuration directory `config.toml` and t | |||
| `workspace-lsp-roots` | Directories relative to the workspace root that are treated as LSP roots. Should only be set in `.helix/config.toml` | `[]` | | |||
| `default-line-ending` | The line ending to use for new documents. Can be `native`, `lf`, `crlf`, `ff`, `cr` or `nel`. `native` uses the platform's native line ending (`crlf` on Windows, otherwise `lf`). | `native` | | |||
| `insert-final-newline` | Whether to automatically insert a trailing line-ending on write if missing | `true` | | |||
| `no-break-on-hyphen` | Disable linebreak on hyphen when using `:reflow` | `true` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do introduce this option it should be named so that it's clear that it's for the reflow command, like reflow-break-on-hyphen
Yeah I meant that we can hard-coded it and wouldn't need a config |
Ok, I made a commit that reverted all changes and only has the behavior to not break in a hyphen. I guess the branch name is inaccurate now since there is no config option that changes this behavior. Is this ok with everyone? |
brnahc names don't really matter, don't worry about it |
This PR adds a new config option
editor.no-break-on-hyphen
that if set totrue
, will cause:reflow
to not line-break on a hyphen. (By default this isfalse
, which is the previous behavior.)A use case for this behavior is in LaTeX, where if a line-break exists between a word, a hyphen, and another word, the hyphen'd words will not be properly displayed in the generated .pdf .
Please let me know if I made a mistake.