You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(whitespace): add newline and carriage-return indicators
The whitespace indicator feature could reveal spaces and tabs (leading,
inner, and trailing) but gave no way to see line endings: an LF file and
a CRLF file rendered identically, and nothing marked where lines end.
Add two config options, both off by default and gated by the existing
whitespace_show master toggle:
- whitespace_newlines: render ↵ at the end of every line.
- whitespace_carriage_returns: render ␍ for the CR half of the line
break, so a CRLF file shows ␍↵ where an LF file shows ↵, and a
Classic-Mac CR buffer shows ␍. (Stray CR bytes that are not part of
the buffer's line ending already render as <0D> escapes.)
The newline's view cell previously always rendered as empty. It now
renders the indicator glyph(s) with the whitespace-indicator color,
counts the emitted cells toward the row's rendered columns (the ␍↵ pair
is two cells while the pipeline gives \n width 1) so tail fills and
blank-line guides stay aligned, and keeps the end-of-line cursor on the
indicator cell rather than one past it. A virtual-space cursor parked on
the newline byte keeps its indicator at the virtual column instead of
lighting up the glyph.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015rBfqYynfutZdebh9hbZHG
Copy file name to clipboardExpand all lines: crates/fresh-editor/plugins/config-schema.json
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,8 @@
95
95
"whitespace_tabs_leading": true,
96
96
"whitespace_tabs_inner": true,
97
97
"whitespace_tabs_trailing": true,
98
+
"whitespace_newlines": false,
99
+
"whitespace_carriage_returns": false,
98
100
"use_tabs": false,
99
101
"tab_size": 4,
100
102
"auto_indent": true,
@@ -651,6 +653,18 @@
651
653
"default": true,
652
654
"x-section": "Whitespace"
653
655
},
656
+
"whitespace_newlines": {
657
+
"description": "Show newline indicators (↵) at the end of every line.\nDefault: false",
658
+
"type": "boolean",
659
+
"default": false,
660
+
"x-section": "Whitespace"
661
+
},
662
+
"whitespace_carriage_returns": {
663
+
"description": "Show carriage-return indicators (␍) for the CR half of CRLF line\nendings, next to the newline position. Stray CR bytes that are not\npart of the buffer's line ending always render as `<0D>` escapes.\nDefault: false",
664
+
"type": "boolean",
665
+
"default": false,
666
+
"x-section": "Whitespace"
667
+
},
654
668
"use_tabs": {
655
669
"description": "Whether pressing Tab inserts a tab character instead of spaces.\nThis is the global default; individual languages can override it\nvia their own `use_tabs` setting.\nDefault: false (insert spaces)",
0 commit comments