fix: preserve cursor position when stripping heading formatting

This commit is contained in:
olivier committed 2026-11-11 21:58:43 -05:00
1 parent aec145604a
commit 31c58b0cd3
2 files changed
+54 -12

No files matched your search

+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project are documented in this file.
Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [1.2.1] - 2026-11-11
### Fixed
- **Toggle Heading (strip formatting) left the cursor before the new marker on an
empty line.** Running *Toggle Heading - H1…H6 (strip formatting)* on an empty line
produced `|### ` instead of `### |`: the line was rewritten with `setLine`, which
maps a caret at column 0 to before the inserted text. The line replacement and the
cursor position are now set in a single transaction; the cursor keeps its position
relative to the line's text, also accounting for removed bold/italic markers.
(`src/ToggleHeading.ts`)
## [1.2.0] - 2026-10-08
### Added