Fix bug that occurs in last line of paragraph when there's no
authorChris Hanson <org/chris-hanson/cph>
Mon, 22 Feb 1993 19:32:01 +0000 (19:32 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 22 Feb 1993 19:32:01 +0000 (19:32 +0000)
whitespace in the line and it's longer than the fill column.

v7/src/edwin/fill.scm

index d604bbedb7ebaf566309c264a28d23e6a1b1d905..f0e4298585d96930711a763672da3835e0b75ba0 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: fill.scm,v 1.57 1992/12/02 18:08:39 cph Exp $
+;;;    $Id: fill.scm,v 1.58 1993/02/22 19:32:01 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
@@ -211,12 +211,14 @@ Prefix arg means justify as well."
                      (delete-horizontal-space point)
                      (if (mark< point end) (insert-newline point))
                      (if justify?
-                         (fill:call-with-line-marks (mark-1+ point)
-                                                    fill-prefix
-                           (lambda (start end)
-                             (fill:justify-line start end fill-column))))
+                         (fill:call-with-line-marks
+                          (if (mark< point end) (mark-1+ point) point)
+                          fill-prefix
+                          (lambda (start end)
+                            (fill:justify-line start end fill-column))))
                      (if fill-prefix (insert-string fill-prefix point))))
-               (loop)))))
+               (if (mark< point end)
+                   (loop))))))
       (mark-temporary! point)
       (mark-temporary! end)
       (mark-temporary! start))))