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
Toggle word wrap no longer works in 1.9 #19842
Comments
Mastering line wrappingThere are two important settings in VS Code that control line wrapping.
It is important to understand the need for two distinct settings and how to tweak them to suit your use-case: Examples (with explanations):
|
Has this behavior changed with 1.9? It used to be that I had Is there no way to set up this use case now? |
What has changed in 1.9 is that toggling from the action will write to the user settings Perhaps there are some workspace settings that override these values? (i.e. workspace settings override user settings) |
I think it is counterintuitive that any wrapping occurs when
|
@Bill-Stewart That was how it was working before. Still I agree that it is counter-intuitive.. |
The entry in your table for |
Sorry, meant this:
|
@Bill-Stewart You can express those 3 options with a single setting,
And in fact, that's what
Your proposal removes the I'm not sure what we're debating here. There are 2 categories of users that care about wrapping: Mild interest in wrappingOnly care about viewport wrapping => use Expert, high interest in wrappingCare about the precise conditions when wrapping occurs => now also use |
Hi Alex, thanks for the explanation. I guess I was just trying to point out that, at minimum, it seems quite counterintuitive to me there is any wrapping at all when |
@alexandrudima Why not change it to
This way the use case of "usually wrap the lines, but when needed turn off the wrapping with the hotkey" is preserved. At the moment I'm setting As an alternative revert to the 1.8 logic so that:
|
Thanks for the additional ideas. Just as a notice, nothing has changed in the semantics of these two settings with 1.9.0. The only thing that has changed in 1.9.0 is that the action to toggle word wrap now writes @CaselIT So your proposal would be ?:
|
I think that something has changed since I've had Regarding the table, yes that would be my proposal.
|
I'd like to suggest that the action to toggle word wrapping should toggle the user setting if and only if there is no workspace setting. That would avoid this unexpected behavior. |
What about those of us who open a mix of files at the same time? e.g.
The old behavior worked great; I'd just hit ctrl-z on the text files I opened. Now I have to hit ctrl+z every time I tab between a text file and a source file. |
@alexandrudima just to know since this issue is closed, is some work planned for this issue to implement the behavior you mentioned in #19842 (comment) ? Alternatively would a PR be accepted? |
@tbfleming - I believe this is because the |
Maybe there should be an option to disable that persistence? Why was that change even made? Nothing else that I know of changes the settings file like that. |
I tried, but setting I was actually getting used to column editing features of VSCode, causing me to change from my tried and trusted Notepad++ to VSCode more and more often... Until this bug. I can no longer use those features because no matter what I do, all my lines wrap. Is there a simple way to downgrade to < 1.9? |
Please do some more testing. Word wrap is horribly broken for my uses. I never even knew about the wrappingColumn setting... just using Toggle Word Wrap when needed / convenient. But I just came here because since 1.9.0 it's not working. It's stuck in wrapped mode. Now I can't use column editing features anymore and lost most of the benefits of VSCode... It's definitely not 'nothing has changed'! |
The change was that the IMHO some settings should read a default from |
So toggling word-wrap on one editor window enables it for all? That sounds really weird to me. |
@Download yes |
Yes sounds a lot better. |
The Toggle Word Wrap action now persists to user settings because the rest of the View actions persist to user settings. Toggle Word Wrap in 1.8.1
1.9.0
I am really sorry for the pain this change is causing, please simply review your workbench settings and remove
|
It still seems to me like the meaning of Moreover, I don't think my use case for
Setting |
@alexandrudima
Ha! Conflicting requirements... Always fun! I think the way to solve this would be to create an extra level in the settings hierarchy. In addition to defaults / global / user settings / settings per filetype, you should store settings per file. Once a file is opened and the word wrap toggle is used, you store the setting under the filepath as key: {
"filesettings": {
"src/myfile.js": {
"wordwrap": true
}
}
} When a file is opened, you gather the value for if |
@Download |
Thank you @alexandrudima ! |
We have decided in today's standup that for 1.10 , we make Toggle Word Wrap "in memory" again ( #21291). i.e. it will not write to user settings, and it will apply only to the current editor instance. It also means that the wrapping is highly transient. i.e. any touch of the settings.json will lead to it being lost. This is being tracked in #21487 |
Used to be able to toggle word wrap on and off with alt-z and changing "editor.wordWrap": to either true or false manually has no effect either.
It seems the only way to change the wrapping is to update the settings and change "editor.wrappingColumn" to -1 (for no wrap) and anything else for wrapping
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: