Skip to content
Prev Previous commit
Next Next commit
fix(heading): put anchor in front of cursor and first letter
This allows typing even at the beginning of the heading
as the cursor now is between the anchor and the first letter.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud authored and mejo- committed Jul 29, 2024
commit 007bae69eb2ed53b12ed0c371b9a6073dc82924e
6 changes: 5 additions & 1 deletion src/plugins/headingAnchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function anchorDecorations(doc, headings) {
* @return {Decoration}
*/
function decorationForHeading(heading) {
return Decoration.widget(heading.offset + 1, anchorForHeading(heading))
return Decoration.widget(
heading.offset + 1,
anchorForHeading(heading),
{ side: -1 },
)
}

/**
Expand Down