Fix vc-hg-log-edit-toggle-amend

* lisp/vc/log-edit.el (log-edit--toggle-amend): Handle the case
when the VCS returns log entry that doesn't end with a newline
(bug#66423).
This commit is contained in:
Dmitry Gutov 2023-10-14 20:47:57 +03:00
parent c0ffa8958e
commit fe62315ef3

View file

@ -1219,7 +1219,10 @@ line of MSG."
(let ((pt (point)))
(and (zerop (forward-line 1))
(looking-at "\n\\|\\'")
(let ((summary (buffer-substring-no-properties pt (1- (point)))))
(let ((summary (buffer-substring-no-properties pt
(if (bolp)
(1- (point))
(point)))))
(skip-chars-forward " \n")
(delete-region pt (point))
(log-edit-set-header "Summary" summary)))))))