Fix bad newline after line no in contexter

This commit is contained in:
daedsidog 2024-03-16 03:20:35 +02:00
parent 4e8b91670a
commit cf357adbd2
2 changed files with 11 additions and 8 deletions

View file

@ -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

View file

@ -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)