diff --git a/gptel-contexter.el b/gptel-contexter.el index 3c7ffc2..960c22d 100644 --- a/gptel-contexter.el +++ b/gptel-contexter.el @@ -408,13 +408,13 @@ REGIONS is a list of pairs of (start, end) lists." (setq lineno (line-number-at-pos start))) ;; We do not need to insert a line number indicator on ;; inline regions. - (unless (or region-inline region-continuous - (insert (format " (Line %d)" lineno)))))) + (unless (or region-inline region-continuous) + (insert (format " (Line %d)" lineno))))) (if is-top-snippet - (setq is-top-snippet nil) - (when (and (not region-inline) - (not region-continuous)) - (insert "\n"))) + (setq is-top-snippet nil)) + (when (and (not region-inline) + (not region-continuous)) + (insert "\n")) (let (substring) (with-current-buffer buffer (setq substring diff --git a/gptel.el b/gptel.el index dba1b76..6dccb47 100644 --- a/gptel.el +++ b/gptel.el @@ -1579,8 +1579,11 @@ context for the ediff session." (interactive "p") (gptel--previous-variant (- arg))) -(cl-defun gptel-clean-up-llm-code (buffer beg end) - "Clean up LLM response between BEG & END in BUFFER." +(defun gptel-clean-up-llm-code (buffer beg end) + "Clean up LLM response between BEG & END in BUFFER. + +Removes any markup formatting and indents the code within the parameters of the +current buffer." (with-current-buffer buffer (save-excursion (let* ((res-beg beg)