-
Notifications
You must be signed in to change notification settings - Fork 33.5k
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
base: main
Are you sure you want to change the base?
Allow \n to trigger a softwrap #231120
Conversation
I'm open to discussions about:
|
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
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
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 !
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 |
dfa2613
to
65fe597
Compare
@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... |
ref: #231118 (2024) + #89120 (2020)
Goal
This PR add soft-wrapping on literal
\n
in addition to viewport and column based limitation wheneditor.wrapOnEscapedLineFeeds
is enabled.So this JSON declaration


would be shown as
previous failed attempts:
There are currently no extension 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
createLineBreaks
method of theMonospaceLineBreaksComputerFactory