From: Lars Ingebrigtsen Date: Wed, 1 Dec 2021 16:33:34 +0000 (+0100) Subject: Fix fencepost error in pixel-fill--fill-line X-Git-Tag: emacs-29.0.90~3630^2~10 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d086d4f91d159d554dd8d9200052a66ccf9c287a;p=emacs.git Fix fencepost error in pixel-fill--fill-line * lisp/textmodes/pixel-fill.el (pixel-fill--fill-line): Don't add a newline (and continuation) if we're at the end of the line. --- diff --git a/lisp/textmodes/pixel-fill.el b/lisp/textmodes/pixel-fill.el index 86fdd3c2ff4..f69696e1f56 100644 --- a/lisp/textmodes/pixel-fill.el +++ b/lisp/textmodes/pixel-fill.el @@ -127,10 +127,11 @@ prefix on subsequent lines." ;; Success; continue. (when (= (preceding-char) ?\s) (delete-char -1)) - (insert ?\n) - (when (> indentation 0) - (insert (propertize " " 'display - (list 'space :align-to (list indentation))))) + (unless (eobp) + (insert ?\n) + (when (> indentation 0) + (insert (propertize " " 'display + (list 'space :align-to (list indentation)))))) (setq start (point)) (pixel-fill--goto-pixel width))))