Allow \n to trigger a softwrap#231120
Merged
alexdima merged 4 commits intomicrosoft:mainfrom Jul 14, 2025
rfon6ngy:patch-1
Merged
Allow \n to trigger a softwrap#231120alexdima merged 4 commits intomicrosoft:mainfrom rfon6ngy:patch-1
alexdima merged 4 commits intomicrosoft:mainfrom
rfon6ngy:patch-1
Conversation
Contributor
Author
|
I'm open to discussions about:
|
alexdima
requested changes
Oct 29, 2024
Member
alexdima
left a comment
There was a problem hiding this comment.
Nice idea! Could you please implement this behind a setting, maybe something like editor.wrapOnEscapedLineFeeds or maybe you have a better idea for a name.
Contributor
Author
|
Hi @alexdima sorry for the delay. I'm on holiday today so yeah I've hidden the feature behind a See for yourself: default config with |
Contributor
Author
|
@microsoft-github-policy-service agree |
Contributor
Author
|
@alexdima do you need anything else ? |
This comment was marked as spam.
This comment was marked as spam.
Contributor
Author
|
Seems like I'm not the first one with this idea... |
ThiH69
approved these changes
Dec 21, 2024
alexdima
approved these changes
Jul 14, 2025
sandy081
approved these changes
Jul 14, 2025
This was referenced Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


ref: #231118 (2024) + #89120 (2020)
Goal
This PR add soft-wrapping on literal
\nin addition to viewport and column based limitation wheneditor.wrapOnEscapedLineFeedsis enabled.So this JSON declaration


would be shown as
previous failed attempts:
There are currently no extension API that would allow a language-specific extension to hint the editor into soft-wrapping at specific offset. So I create a test extension that would inject `` and `\n` in the editor view (using `InlayHints` and `createTextEditorDecorationType`) but none of them worked and were rendered inline
So the only way was to add the wrapping detection in the
createLineBreaksmethod of theMonospaceLineBreaksComputerFactory