changeset 25313:6b4475fbef86

(update_frame_line): If writing whole line, don't write trailing spaces unless we must.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 17 Aug 1999 22:44:37 +0000
parents 4d817651d5b4
children 2e0c4fbef65b
files src/dispnew.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispnew.c	Tue Aug 17 22:44:35 1999 +0000
+++ b/src/dispnew.c	Tue Aug 17 22:44:37 1999 +0000
@@ -4836,10 +4836,18 @@
   /* If display line has unknown contents, write the whole line.  */
   if (must_write_whole_line_p)
     {
-      cursor_to (vpos, 0);
-      write_glyphs (nbody, nlen);
+      if (!must_write_spaces)
+	while (nlen > 0 && CHAR_GLYPH_SPACE_P (nbody[nlen - 1]))
+	  --nlen;
+
+      if (nlen)
+	{
+	  cursor_to (vpos, 0);
+	  write_glyphs (nbody, nlen);
+	}
+      
       cursor_to (vpos, nlen);
-      clear_end_of_line (-1);
+      clear_end_of_line (olen);
       make_current (desired_matrix, current_matrix, vpos);
       return;
     }