From d086d4f91d159d554dd8d9200052a66ccf9c287a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 1 Dec 2021 17:33:34 +0100 Subject: [PATCH] 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. --- lisp/textmodes/pixel-fill.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)))) -- 2.39.2