The cm-hr line decoration that draws the rule was applied unconditionally,
so placing the cursor on a horizontal rule showed both the rule and the raw
"---". Only style the line (and hide its glyphs) when the cursor is on a
different line; on the rule's own line, emit nothing so the raw "---" shows
for editing — matching how headings/blockquotes reveal their markers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`.cm-hr` is a line decoration on a `.cm-line`, and it used `margin: 1em 0`
for the rule's vertical spacing. A vertical margin on a line is not part of
the box CodeMirror measures for its height map, so each `---` added ~32px of
height that CM6 didn't account for — shifting the caret/click mapping for
every line below the rule downward, compounding with each additional rule.
This read as "clicking anywhere puts the cursor a couple lines too low."
Use padding (which is inside the measured box) for the spacing and draw the
rule with a centered pseudo-element instead of a top border.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reserve the CodeMirror scroller's scrollbar gutter with
`scrollbar-gutter: stable` so content no longer shifts left when a
document first grows tall enough to need a vertical scrollbar.
Add a non-passive wheel listener to the tile tab strip so a vertical
mouse wheel scrolls it horizontally while the pointer is over it
(trackpad horizontal gestures still work via the dominant axis).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pressing Enter after a code fence left the new line outside the block
background until the closing ``` was typed. The per-line loop decremented
endLine whenever node.to sat at a line start — but @lezer/markdown only
puts node.to at a line start for an *unterminated* block (the newline just
typed), never for a closed one (whose node ends on the closing-fence line).
So the decrement only ever dropped the active editing line. Remove it: the
loop now paints every line the node spans, keeping the cursor's line — and
the closing ``` — inside the block, while closed blocks still stop at the
fence line and never paint the blank line after.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cm-codeblock line decoration carried vertical margin, per-line
padding, and border-radius, so each code line rendered as its own rounded
box with the editor background showing through the gaps between lines.
Drop the vertical margin and give the block horizontal padding only, then
tag the first/last block lines (cm-codeblock-first / -last) to add the
vertical padding and rounded corners — the run now reads as one
continuous box.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
cm-inline-code was applied only to the text between the backticks, so
when the markers were visible (cursor near) the highlight box stopped
short of them. Style the whole InlineCode node instead — backticks
included — matching the bold/italic content-mark pattern. When the
backticks are hidden they collapse to zero width inside the same box, so
the far-cursor appearance is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Proximity reveal used a 2-char window, so after typing a closing marker
(e.g. the second *) the markers stayed visible until the cursor moved 3
characters past them. Set PROXIMITY_CHARS to 0 so markers reveal only
while the cursor is within/touching the span and hide the moment it moves
one character past the closing marker. Affects bold, italic, strikethrough,
inline code, and links.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>