markdown-ts-mode: Fix computing code block current region (bug#81219)

This ensures that commands such as 'comment-or-uncomment-region'
operate on the correct region in the work buffer.

* lisp/textmodes/markdown-ts-mode.el (markdown-ts--run-command-in-code-block):
Fix adj-region-beg and adj-region-end.
This commit is contained in:
Stéphane Marks 2026-06-10 13:34:22 -04:00 committed by Eli Zaretskii
parent c3bc049549
commit ca7c8208b7

View file

@ -3214,8 +3214,8 @@ ARGS are captured by `markdown-ts--maybe-run-command-in-code-block'."
(region-end (use-region-end))
(adj-point (1+ (- orig-point beg)))
(adj-mark (when orig-mark (1+ (- orig-mark beg))))
(adj-region-beg (when region-beg (1+ (- orig-point region-beg))))
(adj-region-end (when region-end (1+ (- orig-point region-end))))
(adj-region-beg (when region-beg (1+ (- region-beg beg))))
(adj-region-end (when region-end (1+ (- region-end beg))))
(point-delta 0)
(ignore-output
(memq command markdown-ts-code-block-ignore-output-commands))