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

Wrapping settings are confusing #21262

Closed
alexdima opened this issue Feb 23, 2017 · 1 comment
Closed

Wrapping settings are confusing #21262

alexdima opened this issue Feb 23, 2017 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

alexdima commented Feb 23, 2017

The problem

There are two important settings in VS Code that control line wrapping.

  • editor.wrappingColumn (300 by default)
  • and editor.wordWrap (false by default)

Examples (with explanations):

wordWrap wrappingColumn Behaviour
false N > 0 Lines will wrap at N
false 0 Lines will wrap at viewport_column
false -1 Lines will never wrap.
true N > 0 Lines will wrap at min(viewport_column, N)
true 0 Lines will wrap at viewport_column
true -1 Lines will never wrap.

The fact that wrappingColumn is the primary setting and that we wrap at 300 by default is causing a lot of pain.

For example, the Toggle Word Wrap action toggles wordWrap: false | true in user settings. But if wrappingColumn is also configured, the action becomes a no-op.


The proposal

The proposal is to focus on the most important use-cases and to make wordWrap the primary setting.

To prevent unexpected behaviours for folks already using wrappingColumn, it will be completely ignored (deprecated) and a new setting editor.wordWrapColumn will take part of its attributes:

editor.wordWrap Behaviour
"off" Lines will never wrap.
"on" Lines will wrap at viewport
"wordWrapColumn" Lines will wrap at editor.wordWrapColumn
"bounded" Lines will wrap at min(viewport, editor.wordWrapColumn)

The defaults change to => wordWrap: "off", wordWrapColumn: 80

The Toggle Word Wrap action should toggle wordWrap: "on" | "off" in user settings. There is a separate issue #20675, tracking that the Toggle Word Wrap should not persist to user settings or do so in a per-buffer way.

@alexdima
Copy link
Member Author

After today's standup discussion, we will rename "fixed" to "wordWrapColumn" and "clamped" to "bounded"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

2 participants