-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Soft wrap can be empty #6765
Comments
This is intentional. The newline character is always selectable in helix. What you are seeing is the newline char being wrapped to the next line. If that wasnt the case the cursor would disappear offscreen when selecting the newline char |
Makes sense. Kind of visually confusing, but I guess it just takes getting used to. |
I still believe this is confusing as wrapping the newline character is visually indistinguishable from a blank line apart from the missing line number and a wrap indicator (if non-blank). But despite being aware of it, it continues to fool me every time since it's unintuitive to look at line numbers or wrapping indicators. Here's the identical screen recording reproduced with the wrap indicator set to blank that matches common text editor UIs. Notice, the only empty line is demo.mov
[editor.soft-wrap]
enable = true
wrap-indicator = "" Here's the screen recording in VSCode. vscode.movA proposed solutionA simple fix could be to wrap at least the last two characters if the last one is the newline character. This would still cause the issue if there is trailing whitespace in the line but this is also the behavior of common text editor UIs. |
I had this issue as well, it happens more than I would think would happen. I understand this behavior is not a bug and the newline character should be selectable of course. But... I don't think this implementation is desirable for most people. I find it very confusing however when I use Helix those empty lines (except for the The soft-wrap feature already wraps an entire word to the next line when it does not fit on the line. Why wouldn't it treat the newline character the same as any other regular character? The newline character is not a word so it should not be wrapped as one. It is more like a I propose that the soft-wrap feature treats the newline character not as a whitespace, but as a 'normal character' (or like the I hope this will be reconsidered as it would improve the awesome soft-wrap feature even more! |
none of these special case solutions will be implemented. As I said many times before we will not special case newline characters. Currently the wrapping is pretty simple and essentially just wraps anything that counts as a word character together (as a word) and otherwise, everything as an individual characters (so there is no distinction between a period and a newline character for example). The way this will be improved is generally wrapping all trailing non-word chars with their preceding word as one unit. Duplicate of #6829 |
Summary
I'm occassionally experiencing an empty soft wrap. I suspect this happens due to the trailing newline character being treated as a "normal character" that is wrapped when the line width happens to be just right.
Here's a screenshot. Note, there is no trailing whitespace in the line.
Reproduction Steps
Note, it needs a bit of fiddling around with terminal width and/or zoom to hit the right line width but it happens often enough for me to hit quickly.
Here's a screen recording. Note, there is no trailing whitespace in the line, just inserting and deleting "k".
helix-bug.mov
Helix log
No response
Platform
macOS
Terminal Emulator
iTerm2
Helix Version
helix 23.03 (3cf0372)
The text was updated successfully, but these errors were encountered: