Unexpected wrap?
Check for existing issues
- [X] Completed
Describe the bug / provide steps to reproduce it
def payload(slug, offset=0, length=15):
return {
"query": "query TagPageQuery($short: String, $slug: String!, $order: String, $offset: Int!, $length: Int!) {\n locale(short: $short) {\n tag(slug: $slug) {\n cacheKey\n id\n slug\n avatar\n createdAt\n updatedAt\n redirectRelativeUrl\n alternates {\n cacheKey\n short\n domain\n id\n code\n __typename\n }\n tagTranslates {\n cacheKey\n id\n title\n metaTitle\n pageTitle\n description\n metaDescription\n keywords\n __typename\n }\n posts(order: $order, offset: $offset, length: $length) {\n data {\n cacheKey\n id\n slug\n views\n postTranslate {\n cacheKey\n id\n title\n avatar\n published\n publishedHumanFormat\n leadText\n author {\n cacheKey\n id\n slug\n authorTranslates {\n cacheKey\n id\n name\n __typename\n }\n __typename\n }\n __typename\n }\n category {\n cacheKey\n id\n __typename\n }\n author {\n cacheKey\n id\n slug\n authorTranslates {\n cacheKey\n id\n name\n __typename\n }\n __typename\n }\n postBadge {\n cacheKey\n id\n label\n postBadgeTranslates {\n cacheKey\n id\n title\n __typename\n }\n __typename\n }\n showShares\n showStats\n __typename\n }\n postsCount\n __typename\n }\n __typename\n }\n __typename\n }\n}",
"operationName": "TagPageQuery",
"variables": {
"slug": slug,
"order": "postPublishedTime",
"offset": offset,
"length": length,
"short": "en",
"cacheTimeInMS": 300000,
},
}
If soft wrap is off, the text looks like (it wraps at about 500 chars)
In Emacs it looks like
If soft wrap is on, it looks like
Not sure if this is a bug...when soft wrap is off, why it looks like 'semi-soft wrap'?
Environment
Zed: v0.97.5 (preview) OS: macOS 13.2.1 Memory: 32 GiB Architecture: x86_64
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.
If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.
No response
UPDATE: Please disregard. Wrapping is functioning correctly. The problem was that my code had quotation marks around the 'true' value for newline which prevented the settings file from being parsed correctly. I’m leaving my comment here in case others have values in quotes (and shouldn't have).
Incorrect: "ensure_final_newline_on_save": “true”,
Correct: "ensure_final_newline_on_save": true,
<- My original comment ->
I don’t know if this is related but wrapping—at least with HTML files—seems not correct. My preferred line length settings are set to 80-characters with HTML specifically set as:
"languages": {
"HTML": {
"soft_wrap": "preferred_line_length"
}
}
Toggling soft wrap works but it seems to be at editor width not preferred line length. This is the case whether I specifically set the wrap behavior for HTML in my settings file or not.
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. Are you able to reproduce this issue in the latest version of Zed? If so, please let us know by commenting on this issue and we will keep it open; otherwise, we'll close it in a week. Feel free to open a new issue if you're seeing this message after the issue has been closed. Thanks for your help!
Still happens in
Zed: v0.154.1 (Zed Preview)
OS: macOS 15.0.0
Memory: 32 GiB
Architecture: x86_64
This appears fixed in Zed Preview 0.155.0. Thanks for following up on this issue.
It still happens here
Zed: v0.155.1 (Zed Preview)
OS: macOS 15.0.0
Memory: 32 GiB
Architecture: x86_64
I see. But my post was in reference to Markdown or plain text files. In those, the matter seems fixed.
Seeing this issue in txt files as well (but more importantly for me, in log files).
Seeing this issue in txt files as well (but more importantly for me, in log files).
Yes, I just encountered an instance this past week with a comma again but I can’t remember how I reproduced it.
The issue is very easy to reproduce, in fact, when the text does not include spaces or other symbols (excluding whole word wrap), you'll find that with soft wrap turned off, there are only a maximum of 512 characters per line.
I believe this is intentional on Zed for issue https://github.com/zed-industries/zed/issues/834 and as a limit of MAX_LINE_LEN 512 in PR https://github.com/zed-industries/zed/pull/866.
This is make sense, but it makes inconvenient for Zed to work with some files such as logs or CSVs.
@as-cii @nathansobo could you please reconsider this decision to wrap at a certain point no matter user settings? This is almost the only thing that I need to go back to VS Code for.
This is make sense, but it makes inconvenient for Zed to work with some files such as logs or CSVs.
Agreed. In my case, I want to edit log files with very long lines and multi-cursor. Selecting part of the text and using "shift+end" does not actually select the end of the line (as defined by the next newline character) but instead only selects text until the soft-wrap.
IMO, with soft-wrapping off, Zed should simply not soft-wrap at all.
Hi there! 👋 We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days. Thanks for your help!
The issue is relevant.
Zed wraps 513th character (column 514 in status bar) even with "soft_wrap": "none":
Screenshot
It's hardcoded:
- https://github.com/zed-industries/zed/blob/v0.205.9/crates/editor/src/element.rs#L8438
- https://github.com/zed-industries/zed/blob/v0.205.9/crates/editor/src/editor.rs#L221
but inconvenient for the reasons described above.