@@ -9331,7 +9331,7 @@ position."
9331
9331
(defvar-local markdown--edit-indirect-committed-position nil)
9332
9332
9333
9333
(defun markdown--edit-indirect-save-committed-position ()
9334
- "Set where editing is committed to a local variable in the parent buffer."
9334
+ "Save where editing is committed in a local variable in the parent buffer."
9335
9335
(if-let* ((parent-buffer (overlay-buffer edit-indirect--overlay))
9336
9336
((with-current-buffer parent-buffer
9337
9337
(derived-mode-p 'markdown-mode)))
@@ -9343,7 +9343,7 @@ position."
9343
9343
(advice-add #'edit-indirect--commit :after #'markdown--edit-indirect-save-committed-position))
9344
9344
9345
9345
(defun markdown--edit-indirect-move-to-committed-position ()
9346
- "Move the point in the code block corresponding to the saved committed position' ."
9346
+ "Move the point in the code block corresponding to the saved committed position."
9347
9347
(when-let* ((pos markdown--edit-indirect-committed-position)
9348
9348
(bounds (markdown-get-enclosing-fenced-block-construct))
9349
9349
(fence-begin (nth 0 bounds)))
@@ -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