-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Allow \n to trigger a softwrap #231120
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
Allow \n to trigger a softwrap #231120
Conversation
|
I'm open to discussions about:
|
GhislainC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
paul-ay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok for me
Amaury2T
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing to me !
alexdima
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
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 |
|
@microsoft-github-policy-service agree |
|
@alexdima do you need anything else ? |
This comment was marked as spam.
This comment was marked as spam.
|
Seems like I'm not the first one with this idea... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you and apologies for the slow turn-around time!


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