@@ -9378,13 +9378,14 @@ at the END of code blocks."
9378
9378
(if (fboundp 'edit-indirect-region)
9379
9379
(if-let* ((bounds (markdown-get-enclosing-fenced-block-construct))
9380
9380
(fence-begin (nth 0 bounds))
9381
- (fence-end (nth 1 bounds))
9382
- (original-point (point))
9383
- (original-column (current-column))
9384
- (begin (progn (goto-char fence-begin) (line-beginning-position 2)))
9385
- (end (progn (goto-char fence-end) (line-beginning-position 1)))
9386
- (original-line (- (line-number-at-pos original-point) (line-number-at-pos begin))))
9387
- (let* ((indentation (progn (goto-char fence-begin) (current-indentation)))
9381
+ (fence-end (nth 1 bounds)))
9382
+ (let* ((original-line (line-number-at-pos))
9383
+ (original-column (current-column))
9384
+ (begin (progn (goto-char fence-begin) (line-beginning-position 2)))
9385
+ (line (max 0 (- original-line (line-number-at-pos) 1)))
9386
+ (indentation (current-indentation))
9387
+ (column (max 0 (- original-column indentation)))
9388
+ (end (progn (goto-char fence-end) (line-beginning-position 1)))
9388
9389
(lang (markdown-code-block-lang))
9389
9390
(mode (or (and lang (markdown-get-lang-mode lang))
9390
9391
markdown-edit-code-block-default-mode))
@@ -9404,8 +9405,8 @@ at the END of code blocks."
9404
9405
(when (> indentation 0) ;; un-indent in edit-indirect buffer
9405
9406
(indent-rigidly (point-min) (point-max) (- indentation)))
9406
9407
(goto-char (point-min))
9407
- (forward-line (max 0 original- line) )
9408
- (move-to-column (max 0 (- original- column indentation)) )))
9408
+ (forward-line line)
9409
+ (move-to-column column)))
9409
9410
(user-error "Not inside a GFM or tilde fenced code block"))
9410
9411
(when (y-or-n-p "Package edit-indirect needed to edit code blocks. Install it now? ")
9411
9412
(package-refresh-contents)
0 commit comments