Skip to content

fix editor punctuation width#297741

Merged
alexdima merged 2 commits intomicrosoft:mainfrom
neruthes:patch-1
Feb 28, 2026
Merged

fix editor punctuation width#297741
alexdima merged 2 commits intomicrosoft:mainfrom
neruthes:patch-1

Conversation

@neruthes
Copy link
Contributor

Close #242138

This PR adds a simple one-line text-spacing-trim: space-all; for .monaco-editor.

Investigations showed that the issue was not introduced by an active change in this repository; instead, it might come from an upstream change of default value. So I am not creating a PR for a new setting entry.

Inserting `text-spacing-trim: space-all;` for `.monaco-editor`
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Notes for myself:
image

Was space-all the default? No. The initial/default value is normal, not space-all. The formal definition table states: Initial value: normal. The normal value applies kerning/trimming rules to CJK punctuation — collapsing spacing between adjacent punctuation, and adjusting punctuation at line starts/ends. space-all is the opt-out value that leaves all CJK full-width punctuation at full width (no trimming).

You might be thinking of the behavior before browsers implemented text-spacing-trim — when no browser supported it, the effective behavior was equivalent to space-all (no punctuation trimming happened). So in practice, space-all matches what users historically saw, but it was never the spec default.

Is space-all more appropriate for a code editor? Yes, very likely. In a code editor:

@alexdima alexdima enabled auto-merge (squash) February 28, 2026 19:47
@alexdima alexdima added this to the March 2026 milestone Feb 28, 2026
@alexdima alexdima merged commit c7d2d62 into microsoft:main Feb 28, 2026
18 checks passed
@neruthes neruthes deleted the patch-1 branch March 1, 2026 05:58
DonJayamanne pushed a commit that referenced this pull request Mar 2, 2026
Inserting `text-spacing-trim: space-all;` for `.monaco-editor`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bring good old full width punctuations back

3 participants