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))) (setq lineno (line-number-at-pos start)))
;; We do not need to insert a line number indicator on ;; We do not need to insert a line number indicator on
;; inline regions. ;; inline regions.
(unless (or region-inline region-continuous (unless (or region-inline region-continuous)
(insert (format " (Line %d)" lineno)))))) (insert (format " (Line %d)" lineno)))))
(if is-top-snippet (if is-top-snippet
(setq is-top-snippet nil) (setq is-top-snippet nil))
(when (and (not region-inline) (when (and (not region-inline)
(not region-continuous)) (not region-continuous))
(insert "\n"))) (insert "\n"))
(let (substring) (let (substring)
(with-current-buffer buffer (with-current-buffer buffer
(setq substring (setq substring

View file

@ -1579,8 +1579,11 @@ context for the ediff session."
(interactive "p") (interactive "p")
(gptel--previous-variant (- arg))) (gptel--previous-variant (- arg)))
(cl-defun gptel-clean-up-llm-code (buffer beg end) (defun gptel-clean-up-llm-code (buffer beg end)
"Clean up LLM response between BEG & END in BUFFER." "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 (with-current-buffer buffer
(save-excursion (save-excursion
(let* ((res-beg beg) (let* ((res-beg beg)