Karsten Hopp 90cef3
To: vim_dev@googlegroups.com
Karsten Hopp 90cef3
Subject: Patch 7.4.785
Karsten Hopp 90cef3
Fcc: outbox
Karsten Hopp 90cef3
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 90cef3
Mime-Version: 1.0
Karsten Hopp 90cef3
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 90cef3
Content-Transfer-Encoding: 8bit
Karsten Hopp 90cef3
------------
Karsten Hopp 90cef3
Karsten Hopp 90cef3
Patch 7.4.785
Karsten Hopp 90cef3
Problem:    On some systems automatically adding the missing EOL causes
Karsten Hopp 90cef3
            problems. Setting 'binary' has too many side effects.
Karsten Hopp 90cef3
Solution:   Add the 'fixeol' option, default on. (Pavel Samarkin)
Karsten Hopp 90cef3
Files:      src/buffer.c, src/fileio.c, src/memline.c, src/netbeans.c,
Karsten Hopp 90cef3
            src/ops.c, src/option.c, src/option.h, src/os_unix.c,
Karsten Hopp 90cef3
            src/os_win32.c, src/structs.h, src/testdir/Make_amiga.mak,
Karsten Hopp 90cef3
            src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
Karsten Hopp 90cef3
            src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
Karsten Hopp 90cef3
            src/testdir/Makefile, src/testdir/test_fixeol.in,
Karsten Hopp 90cef3
            src/testdir/test_fixeol.ok, runtime/doc/options.txt,
Karsten Hopp 90cef3
            runtime/optwin.vim
Karsten Hopp 90cef3
Karsten Hopp 90cef3
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/buffer.c	2015-06-19 14:41:44.777813290 +0200
Karsten Hopp 90cef3
--- src/buffer.c	2015-07-17 13:55:33.174783882 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 547,552 ****
Karsten Hopp 90cef3
--- 547,553 ----
Karsten Hopp 90cef3
      buf->b_shortname = FALSE;
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
      buf->b_p_eol = TRUE;
Karsten Hopp 90cef3
+     buf->b_p_fixeol = TRUE;
Karsten Hopp 90cef3
      buf->b_start_eol = TRUE;
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
      buf->b_p_bomb = FALSE;
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/fileio.c	2015-03-31 13:33:00.793524956 +0200
Karsten Hopp 90cef3
--- src/fileio.c	2015-07-17 13:57:26.777699252 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 2623,2632 ****
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
      /*
Karsten Hopp 90cef3
!      * Trick: We remember if the last line of the read didn't have
Karsten Hopp 90cef3
!      * an eol even when 'binary' is off, for when writing it again with
Karsten Hopp 90cef3
!      * 'binary' on.  This is required for
Karsten Hopp 90cef3
!      * ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work.
Karsten Hopp 90cef3
       */
Karsten Hopp 90cef3
      curbuf->b_no_eol_lnum = read_no_eol_lnum;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
--- 2623,2632 ----
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
      /*
Karsten Hopp 90cef3
!      * We remember if the last line of the read didn't have
Karsten Hopp 90cef3
!      * an eol even when 'binary' is off, to support turning 'fixeol' off,
Karsten Hopp 90cef3
!      * or writing the read again with 'binary' on.  The latter is required
Karsten Hopp 90cef3
!      * for ":autocmd FileReadPost *.gz set bin|'[,']!gunzip" to work.
Karsten Hopp 90cef3
       */
Karsten Hopp 90cef3
      curbuf->b_no_eol_lnum = read_no_eol_lnum;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 4547,4553 ****
Karsten Hopp 90cef3
  	/* write failed or last line has no EOL: stop here */
Karsten Hopp 90cef3
  	if (end == 0
Karsten Hopp 90cef3
  		|| (lnum == end
Karsten Hopp 90cef3
! 		    && write_bin
Karsten Hopp 90cef3
  		    && (lnum == buf->b_no_eol_lnum
Karsten Hopp 90cef3
  			|| (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol))))
Karsten Hopp 90cef3
  	{
Karsten Hopp 90cef3
--- 4547,4553 ----
Karsten Hopp 90cef3
  	/* write failed or last line has no EOL: stop here */
Karsten Hopp 90cef3
  	if (end == 0
Karsten Hopp 90cef3
  		|| (lnum == end
Karsten Hopp 90cef3
! 		    && (write_bin || !buf->b_p_fixeol)
Karsten Hopp 90cef3
  		    && (lnum == buf->b_no_eol_lnum
Karsten Hopp 90cef3
  			|| (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol))))
Karsten Hopp 90cef3
  	{
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/memline.c	2015-07-12 17:52:50.728095726 +0200
Karsten Hopp 90cef3
--- src/memline.c	2015-07-17 13:58:04.193342051 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 5361,5368 ****
Karsten Hopp 90cef3
  	if (ffdos)
Karsten Hopp 90cef3
  	    size += lnum - 1;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
! 	/* Don't count the last line break if 'bin' and 'noeol'. */
Karsten Hopp 90cef3
! 	if (buf->b_p_bin && !buf->b_p_eol && buf->b_ml.ml_line_count == lnum)
Karsten Hopp 90cef3
  	    size -= ffdos + 1;
Karsten Hopp 90cef3
      }
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
--- 5361,5370 ----
Karsten Hopp 90cef3
  	if (ffdos)
Karsten Hopp 90cef3
  	    size += lnum - 1;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
! 	/* Don't count the last line break if 'noeol' and ('bin' or
Karsten Hopp 90cef3
! 	 * 'nofixeol'). */
Karsten Hopp 90cef3
! 	if ((!buf->b_p_fixeol || buf->b_p_bin) && !buf->b_p_eol
Karsten Hopp 90cef3
! 					   && buf->b_ml.ml_line_count == lnum)
Karsten Hopp 90cef3
  	    size -= ffdos + 1;
Karsten Hopp 90cef3
      }
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/netbeans.c	2015-03-20 18:11:44.967196356 +0100
Karsten Hopp 90cef3
--- src/netbeans.c	2015-07-17 13:55:33.182783805 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 3802,3808 ****
Karsten Hopp 90cef3
  	    }
Karsten Hopp 90cef3
  	}
Karsten Hopp 90cef3
  	/* Correction for when last line doesn't have an EOL. */
Karsten Hopp 90cef3
! 	if (!bufp->b_p_eol && bufp->b_p_bin)
Karsten Hopp 90cef3
  	    char_count -= eol_size;
Karsten Hopp 90cef3
      }
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
--- 3802,3808 ----
Karsten Hopp 90cef3
  	    }
Karsten Hopp 90cef3
  	}
Karsten Hopp 90cef3
  	/* Correction for when last line doesn't have an EOL. */
Karsten Hopp 90cef3
! 	if (!bufp->b_p_eol && (bufp->b_p_bin || !bufp->b_p_fixeol))
Karsten Hopp 90cef3
  	    char_count -= eol_size;
Karsten Hopp 90cef3
      }
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/ops.c	2015-07-17 13:22:43.157523671 +0200
Karsten Hopp 90cef3
--- src/ops.c	2015-07-17 13:58:25.945134391 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 7052,7058 ****
Karsten Hopp 90cef3
  					   &char_count_cursor, len, eol_size);
Karsten Hopp 90cef3
  		    if (lnum == curbuf->b_ml.ml_line_count
Karsten Hopp 90cef3
  			    && !curbuf->b_p_eol
Karsten Hopp 90cef3
! 			    && curbuf->b_p_bin
Karsten Hopp 90cef3
  			    && (long)STRLEN(s) < len)
Karsten Hopp 90cef3
  			byte_count_cursor -= eol_size;
Karsten Hopp 90cef3
  		}
Karsten Hopp 90cef3
--- 7052,7058 ----
Karsten Hopp 90cef3
  					   &char_count_cursor, len, eol_size);
Karsten Hopp 90cef3
  		    if (lnum == curbuf->b_ml.ml_line_count
Karsten Hopp 90cef3
  			    && !curbuf->b_p_eol
Karsten Hopp 90cef3
! 			    && (curbuf->b_p_bin || !curbuf->b_p_fixeol)
Karsten Hopp 90cef3
  			    && (long)STRLEN(s) < len)
Karsten Hopp 90cef3
  			byte_count_cursor -= eol_size;
Karsten Hopp 90cef3
  		}
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 7076,7082 ****
Karsten Hopp 90cef3
  	}
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
  	/* Correction for when last line doesn't have an EOL. */
Karsten Hopp 90cef3
! 	if (!curbuf->b_p_eol && curbuf->b_p_bin)
Karsten Hopp 90cef3
  	    byte_count -= eol_size;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
  	if (VIsual_active)
Karsten Hopp 90cef3
--- 7076,7082 ----
Karsten Hopp 90cef3
  	}
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
  	/* Correction for when last line doesn't have an EOL. */
Karsten Hopp 90cef3
! 	if (!curbuf->b_p_eol && (curbuf->b_p_bin || !curbuf->b_p_fixeol))
Karsten Hopp 90cef3
  	    byte_count -= eol_size;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
  	if (VIsual_active)
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/option.c	2015-07-17 13:03:42.108357465 +0200
Karsten Hopp 90cef3
--- src/option.c	2015-07-17 13:55:33.186783767 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 98,103 ****
Karsten Hopp 90cef3
--- 98,104 ----
Karsten Hopp 90cef3
  # define PV_INC		OPT_BOTH(OPT_BUF(BV_INC))
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
  #define PV_EOL		OPT_BUF(BV_EOL)
Karsten Hopp 90cef3
+ #define PV_FIXEOL	OPT_BUF(BV_FIXEOL)
Karsten Hopp 90cef3
  #define PV_EP		OPT_BOTH(OPT_BUF(BV_EP))
Karsten Hopp 90cef3
  #define PV_ET		OPT_BUF(BV_ET)
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 306,311 ****
Karsten Hopp 90cef3
--- 307,313 ----
Karsten Hopp 90cef3
  static char_u	*p_ofu;
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
  static int	p_eol;
Karsten Hopp 90cef3
+ static int	p_fixeol;
Karsten Hopp 90cef3
  static int	p_et;
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
  static char_u	*p_fenc;
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 1169,1174 ****
Karsten Hopp 90cef3
--- 1171,1179 ----
Karsten Hopp 90cef3
  			    {(char_u *)"", (char_u *)0L}
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
  			    SCRIPTID_INIT},
Karsten Hopp 90cef3
+     {"fixendofline",  "fixeol", P_BOOL|P_VI_DEF|P_RSTAT,
Karsten Hopp 90cef3
+ 			    (char_u *)&p_fixeol, PV_FIXEOL,
Karsten Hopp 90cef3
+ 			    {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
Karsten Hopp 90cef3
      {"fkmap",	    "fk",   P_BOOL|P_VI_DEF,
Karsten Hopp 90cef3
  #ifdef FEAT_FKMAP
Karsten Hopp 90cef3
  			    (char_u *)&p_fkmap, PV_NONE,
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 7781,7786 ****
Karsten Hopp 90cef3
--- 7786,7796 ----
Karsten Hopp 90cef3
      {
Karsten Hopp 90cef3
  	redraw_titles();
Karsten Hopp 90cef3
      }
Karsten Hopp 90cef3
+     /* when 'fixeol' is changed, redraw the window title */
Karsten Hopp 90cef3
+     else if ((int *)varp == &curbuf->b_p_fixeol)
Karsten Hopp 90cef3
+     {
Karsten Hopp 90cef3
+ 	redraw_titles();
Karsten Hopp 90cef3
+     }
Karsten Hopp 90cef3
  # ifdef FEAT_MBYTE
Karsten Hopp 90cef3
      /* when 'bomb' is changed, redraw the window title and tab page text */
Karsten Hopp 90cef3
      else if ((int *)varp == &curbuf->b_p_bomb)
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 10176,10181 ****
Karsten Hopp 90cef3
--- 10186,10192 ----
Karsten Hopp 90cef3
  	case PV_OFU:	return (char_u *)&(curbuf->b_p_ofu);
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
  	case PV_EOL:	return (char_u *)&(curbuf->b_p_eol);
Karsten Hopp 90cef3
+ 	case PV_FIXEOL:	return (char_u *)&(curbuf->b_p_fixeol);
Karsten Hopp 90cef3
  	case PV_ET:	return (char_u *)&(curbuf->b_p_et);
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
  	case PV_FENC:	return (char_u *)&(curbuf->b_p_fenc);
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 11894,11899 ****
Karsten Hopp 90cef3
--- 11905,11911 ----
Karsten Hopp 90cef3
   * from when editing started (save_file_ff() called).
Karsten Hopp 90cef3
   * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
Karsten Hopp 90cef3
   * changed and 'binary' is not set.
Karsten Hopp 90cef3
+  * Also when 'endofline' was changed and 'fixeol' is not set.
Karsten Hopp 90cef3
   * When "ignore_empty" is true don't consider a new, empty buffer to be
Karsten Hopp 90cef3
   * changed.
Karsten Hopp 90cef3
   */
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 11912,11918 ****
Karsten Hopp 90cef3
  	return FALSE;
Karsten Hopp 90cef3
      if (buf->b_start_ffc != *buf->b_p_ff)
Karsten Hopp 90cef3
  	return TRUE;
Karsten Hopp 90cef3
!     if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
Karsten Hopp 90cef3
  	return TRUE;
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
      if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb)
Karsten Hopp 90cef3
--- 11924,11930 ----
Karsten Hopp 90cef3
  	return FALSE;
Karsten Hopp 90cef3
      if (buf->b_start_ffc != *buf->b_p_ff)
Karsten Hopp 90cef3
  	return TRUE;
Karsten Hopp 90cef3
!     if ((buf->b_p_bin || !buf->b_p_fixeol) && buf->b_start_eol != buf->b_p_eol)
Karsten Hopp 90cef3
  	return TRUE;
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
      if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb)
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/option.h	2015-06-19 14:41:44.777813290 +0200
Karsten Hopp 90cef3
--- src/option.h	2015-07-17 13:55:33.186783767 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 962,967 ****
Karsten Hopp 90cef3
--- 962,968 ----
Karsten Hopp 90cef3
      , BV_INC
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
      , BV_EOL
Karsten Hopp 90cef3
+     , BV_FIXEOL
Karsten Hopp 90cef3
      , BV_EP
Karsten Hopp 90cef3
      , BV_ET
Karsten Hopp 90cef3
      , BV_FENC
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/os_unix.c	2015-03-31 13:33:00.801524871 +0200
Karsten Hopp 90cef3
--- src/os_unix.c	2015-07-17 13:55:33.186783767 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 4624,4630 ****
Karsten Hopp 90cef3
  				/* Finished a line, add a NL, unless this line
Karsten Hopp 90cef3
  				 * should not have one. */
Karsten Hopp 90cef3
  				if (lnum != curbuf->b_op_end.lnum
Karsten Hopp 90cef3
! 					|| !curbuf->b_p_bin
Karsten Hopp 90cef3
  					|| (lnum != curbuf->b_no_eol_lnum
Karsten Hopp 90cef3
  					    && (lnum !=
Karsten Hopp 90cef3
  						    curbuf->b_ml.ml_line_count
Karsten Hopp 90cef3
--- 4624,4631 ----
Karsten Hopp 90cef3
  				/* Finished a line, add a NL, unless this line
Karsten Hopp 90cef3
  				 * should not have one. */
Karsten Hopp 90cef3
  				if (lnum != curbuf->b_op_end.lnum
Karsten Hopp 90cef3
! 					|| (!curbuf->b_p_bin
Karsten Hopp 90cef3
! 					    && curbuf->b_p_fixeol)
Karsten Hopp 90cef3
  					|| (lnum != curbuf->b_no_eol_lnum
Karsten Hopp 90cef3
  					    && (lnum !=
Karsten Hopp 90cef3
  						    curbuf->b_ml.ml_line_count
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/os_win32.c	2015-03-24 17:12:04.477113277 +0100
Karsten Hopp 90cef3
--- src/os_win32.c	2015-07-17 13:55:33.190783729 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 4173,4179 ****
Karsten Hopp 90cef3
  	    /* Finished a line, add a NL, unless this line should not have
Karsten Hopp 90cef3
  	     * one. */
Karsten Hopp 90cef3
  	    if (lnum != curbuf->b_op_end.lnum
Karsten Hopp 90cef3
! 		|| !curbuf->b_p_bin
Karsten Hopp 90cef3
  		|| (lnum != curbuf->b_no_eol_lnum
Karsten Hopp 90cef3
  		    && (lnum != curbuf->b_ml.ml_line_count
Karsten Hopp 90cef3
  			|| curbuf->b_p_eol)))
Karsten Hopp 90cef3
--- 4173,4180 ----
Karsten Hopp 90cef3
  	    /* Finished a line, add a NL, unless this line should not have
Karsten Hopp 90cef3
  	     * one. */
Karsten Hopp 90cef3
  	    if (lnum != curbuf->b_op_end.lnum
Karsten Hopp 90cef3
! 		|| (!curbuf->b_p_bin
Karsten Hopp 90cef3
! 		    && curbuf->b_p_fixeol)
Karsten Hopp 90cef3
  		|| (lnum != curbuf->b_no_eol_lnum
Karsten Hopp 90cef3
  		    && (lnum != curbuf->b_ml.ml_line_count
Karsten Hopp 90cef3
  			|| curbuf->b_p_eol)))
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/structs.h	2015-04-13 16:16:31.221091470 +0200
Karsten Hopp 90cef3
--- src/structs.h	2015-07-17 13:55:33.190783729 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 635,641 ****
Karsten Hopp 90cef3
      int		ml_flags;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
      infoptr_T	*ml_stack;	/* stack of pointer blocks (array of IPTRs) */
Karsten Hopp 90cef3
!     int		ml_stack_top;	/* current top if ml_stack */
Karsten Hopp 90cef3
      int		ml_stack_size;	/* total number of entries in ml_stack */
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
      linenr_T	ml_line_lnum;	/* line number of cached line, 0 if not valid */
Karsten Hopp 90cef3
--- 635,641 ----
Karsten Hopp 90cef3
      int		ml_flags;
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
      infoptr_T	*ml_stack;	/* stack of pointer blocks (array of IPTRs) */
Karsten Hopp 90cef3
!     int		ml_stack_top;	/* current top of ml_stack */
Karsten Hopp 90cef3
      int		ml_stack_size;	/* total number of entries in ml_stack */
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
      linenr_T	ml_line_lnum;	/* line number of cached line, 0 if not valid */
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 1586,1591 ****
Karsten Hopp 90cef3
--- 1586,1592 ----
Karsten Hopp 90cef3
      char_u	*b_p_ofu;	/* 'omnifunc' */
Karsten Hopp 90cef3
  #endif
Karsten Hopp 90cef3
      int		b_p_eol;	/* 'endofline' */
Karsten Hopp 90cef3
+     int		b_p_fixeol;	/* 'fixendofline' */
Karsten Hopp 90cef3
      int		b_p_et;		/* 'expandtab' */
Karsten Hopp 90cef3
      int		b_p_et_nobin;	/* b_p_et saved for binary mode */
Karsten Hopp 90cef3
  #ifdef FEAT_MBYTE
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/Make_amiga.mak	2015-07-10 14:43:29.556722605 +0200
Karsten Hopp 90cef3
--- src/testdir/Make_amiga.mak	2015-07-17 14:01:03.567629733 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 45,50 ****
Karsten Hopp 90cef3
--- 45,51 ----
Karsten Hopp 90cef3
  		test_command_count.out \
Karsten Hopp 90cef3
  		test_erasebackword.out \
Karsten Hopp 90cef3
  		test_eval.out \
Karsten Hopp 90cef3
+ 		test_fixeol.out \
Karsten Hopp 90cef3
  		test_increment.out \
Karsten Hopp 90cef3
  		test_insertcount.out \
Karsten Hopp 90cef3
  		test_listchars.out \
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 195,200 ****
Karsten Hopp 90cef3
--- 196,202 ----
Karsten Hopp 90cef3
  test_erasebackword.out: test_erasebackword.in
Karsten Hopp 90cef3
  test_eval.out: test_eval.in
Karsten Hopp 90cef3
  test_increment.out: test_increment.in
Karsten Hopp 90cef3
+ test_fixeol.out: test_fixeol.in
Karsten Hopp 90cef3
  test_insertcount.out: test_insertcount.in
Karsten Hopp 90cef3
  test_listchars.out: test_listchars.in
Karsten Hopp 90cef3
  test_listlbr.out: test_listlbr.in
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/Make_dos.mak	2015-07-10 14:43:29.556722605 +0200
Karsten Hopp 90cef3
--- src/testdir/Make_dos.mak	2015-07-17 14:00:58.519677917 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 44,49 ****
Karsten Hopp 90cef3
--- 44,50 ----
Karsten Hopp 90cef3
  		test_command_count.out \
Karsten Hopp 90cef3
  		test_erasebackword.out \
Karsten Hopp 90cef3
  		test_eval.out \
Karsten Hopp 90cef3
+ 		test_fixeol.out \
Karsten Hopp 90cef3
  		test_increment.out \
Karsten Hopp 90cef3
  		test_insertcount.out \
Karsten Hopp 90cef3
  		test_listchars.out \
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/Make_ming.mak	2015-07-10 14:43:29.556722605 +0200
Karsten Hopp 90cef3
--- src/testdir/Make_ming.mak	2015-07-17 14:01:15.847512519 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 66,71 ****
Karsten Hopp 90cef3
--- 66,72 ----
Karsten Hopp 90cef3
  		test_command_count.out \
Karsten Hopp 90cef3
  		test_erasebackword.out \
Karsten Hopp 90cef3
  		test_eval.out \
Karsten Hopp 90cef3
+ 		test_fixeol.out \
Karsten Hopp 90cef3
  		test_increment.out \
Karsten Hopp 90cef3
  		test_insertcount.out \
Karsten Hopp 90cef3
  		test_listchars.out \
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/Make_os2.mak	2015-07-10 14:43:29.556722605 +0200
Karsten Hopp 90cef3
--- src/testdir/Make_os2.mak	2015-07-17 14:01:25.883416724 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 46,51 ****
Karsten Hopp 90cef3
--- 46,52 ----
Karsten Hopp 90cef3
  		test_command_count.out \
Karsten Hopp 90cef3
  		test_erasebackword.out \
Karsten Hopp 90cef3
  		test_eval.out \
Karsten Hopp 90cef3
+ 		test_fixeol.out \
Karsten Hopp 90cef3
  		test_increment.out \
Karsten Hopp 90cef3
  		test_insertcount.out \
Karsten Hopp 90cef3
  		test_listchars.out \
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/Make_vms.mms	2015-07-10 14:43:29.556722605 +0200
Karsten Hopp 90cef3
--- src/testdir/Make_vms.mms	2015-07-17 14:01:36.355316767 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 4,10 ****
Karsten Hopp 90cef3
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp 90cef3
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp 90cef3
  #
Karsten Hopp 90cef3
! # Last change:  2015 Jul 10
Karsten Hopp 90cef3
  #
Karsten Hopp 90cef3
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp 90cef3
  # Edit the lines in the Configuration section below to select.
Karsten Hopp 90cef3
--- 4,10 ----
Karsten Hopp 90cef3
  # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
Karsten Hopp 90cef3
  #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
Karsten Hopp 90cef3
  #
Karsten Hopp 90cef3
! # Last change:  2015 Jul 17
Karsten Hopp 90cef3
  #
Karsten Hopp 90cef3
  # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
Karsten Hopp 90cef3
  # Edit the lines in the Configuration section below to select.
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 105,110 ****
Karsten Hopp 90cef3
--- 105,111 ----
Karsten Hopp 90cef3
  	 test_command_count.out \
Karsten Hopp 90cef3
  	 test_erasebackword.out \
Karsten Hopp 90cef3
  	 test_eval.out \
Karsten Hopp 90cef3
+ 	 test_fixeol.out \
Karsten Hopp 90cef3
  	 test_increment.out \
Karsten Hopp 90cef3
  	 test_insertcount.out \
Karsten Hopp 90cef3
  	 test_listchars.out \
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/Makefile	2015-07-10 14:43:29.556722605 +0200
Karsten Hopp 90cef3
--- src/testdir/Makefile	2015-07-17 14:01:46.679218225 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 42,47 ****
Karsten Hopp 90cef3
--- 42,48 ----
Karsten Hopp 90cef3
  		test_command_count.out \
Karsten Hopp 90cef3
  		test_erasebackword.out \
Karsten Hopp 90cef3
  		test_eval.out \
Karsten Hopp 90cef3
+ 		test_fixeol.out \
Karsten Hopp 90cef3
  		test_increment.out \
Karsten Hopp 90cef3
  		test_insertcount.out \
Karsten Hopp 90cef3
  		test_listchars.out \
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/test_fixeol.in	2015-07-17 14:14:20.856020508 +0200
Karsten Hopp 90cef3
--- src/testdir/test_fixeol.in	2015-07-17 13:55:33.190783729 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 0 ****
Karsten Hopp 90cef3
--- 1,40 ----
Karsten Hopp 90cef3
+ Tests for 'fixeol'                         vim: set ft=vim :
Karsten Hopp 90cef3
+  
Karsten Hopp 90cef3
+ STARTTEST
Karsten Hopp 90cef3
+ :" first write two test files – with and without trailing EOL
Karsten Hopp 90cef3
+ :" use Unix fileformat for consistency
Karsten Hopp 90cef3
+ :set ff=unix
Karsten Hopp 90cef3
+ :enew!
Karsten Hopp 90cef3
+ awith eol?:w! XXEol
Karsten Hopp 90cef3
+ :enew!
Karsten Hopp 90cef3
+ :set noeol nofixeol
Karsten Hopp 90cef3
+ awithout eol?:w! XXNoEol
Karsten Hopp 90cef3
+ :set eol fixeol
Karsten Hopp 90cef3
+ :bwipe XXEol XXNoEol
Karsten Hopp 90cef3
+ :"
Karsten Hopp 90cef3
+ :" try editing files with 'fixeol' disabled
Karsten Hopp 90cef3
+ :e! XXEol
Karsten Hopp 90cef3
+ ostays eol?:set nofixeol
Karsten Hopp 90cef3
+ :w! XXTestEol
Karsten Hopp 90cef3
+ :e! XXNoEol
Karsten Hopp 90cef3
+ ostays without?:set nofixeol
Karsten Hopp 90cef3
+ :w! XXTestNoEol
Karsten Hopp 90cef3
+ :bwipe XXEol XXNoEol XXTestEol XXTestNoEol
Karsten Hopp 90cef3
+ :set fixeol
Karsten Hopp 90cef3
+ :"
Karsten Hopp 90cef3
+ :" Append "END" to each file so that we can see what the last written char was.
Karsten Hopp 90cef3
+ ggdGaEND?:w >>XXEol
Karsten Hopp 90cef3
+ :w >>XXNoEol
Karsten Hopp 90cef3
+ :w >>XXTestEol
Karsten Hopp 90cef3
+ :w >>XXTestNoEol
Karsten Hopp 90cef3
+ :"
Karsten Hopp 90cef3
+ :" Concatenate the results
Karsten Hopp 90cef3
+ :e! test.out
Karsten Hopp 90cef3
+ a0?:$r XXEol
Karsten Hopp 90cef3
+ :$r XXNoEol
Karsten Hopp 90cef3
+ Go1?:$r XXTestEol
Karsten Hopp 90cef3
+ :$r XXTestNoEol
Karsten Hopp 90cef3
+ :w
Karsten Hopp 90cef3
+ :qa!
Karsten Hopp 90cef3
+ ENDTEST
Karsten Hopp 90cef3
+ 
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/testdir/test_fixeol.ok	2015-07-17 14:14:20.860020470 +0200
Karsten Hopp 90cef3
--- src/testdir/test_fixeol.ok	2015-07-17 13:55:33.190783729 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 0 ****
Karsten Hopp 90cef3
--- 1,10 ----
Karsten Hopp 90cef3
+ 0
Karsten Hopp 90cef3
+ with eol
Karsten Hopp 90cef3
+ END
Karsten Hopp 90cef3
+ without eolEND
Karsten Hopp 90cef3
+ 1
Karsten Hopp 90cef3
+ with eol
Karsten Hopp 90cef3
+ stays eol
Karsten Hopp 90cef3
+ END
Karsten Hopp 90cef3
+ without eol
Karsten Hopp 90cef3
+ stays withoutEND
Karsten Hopp 90cef3
*** ../vim-7.4.784/runtime/doc/options.txt	2015-07-10 18:18:35.575206298 +0200
Karsten Hopp 90cef3
--- runtime/doc/options.txt	2015-07-17 14:13:33.036477520 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 2670,2684 ****
Karsten Hopp 90cef3
  			local to buffer
Karsten Hopp 90cef3
  			{not in Vi}
Karsten Hopp 90cef3
  	When writing a file and this option is off and the 'binary' option
Karsten Hopp 90cef3
! 	is on, no <EOL> will be written for the last line in the file.  This
Karsten Hopp 90cef3
! 	option is automatically set when starting to edit a new file, unless
Karsten Hopp 90cef3
! 	the file does not have an <EOL> for the last line in the file, in
Karsten Hopp 90cef3
! 	which case it is reset.  Normally you don't have to set or reset this
Karsten Hopp 90cef3
! 	option.  When 'binary' is off the value is not used when writing the
Karsten Hopp 90cef3
! 	file.  When 'binary' is on it is used to remember the presence of a
Karsten Hopp 90cef3
! 	<EOL> for the last line in the file, so that when you write the file
Karsten Hopp 90cef3
! 	the situation from the original file can be kept.  But you can change
Karsten Hopp 90cef3
! 	it if you want to.
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
  			     *'equalalways'* *'ea'* *'noequalalways'* *'noea'*
Karsten Hopp 90cef3
  'equalalways' 'ea'	boolean	(default on)
Karsten Hopp 90cef3
--- 2671,2686 ----
Karsten Hopp 90cef3
  			local to buffer
Karsten Hopp 90cef3
  			{not in Vi}
Karsten Hopp 90cef3
  	When writing a file and this option is off and the 'binary' option
Karsten Hopp 90cef3
! 	is on, or 'fixeol' option is off, no <EOL> will be written for the
Karsten Hopp 90cef3
! 	last line in the file.  This option is automatically set or reset when
Karsten Hopp 90cef3
! 	starting to edit a new file, depending on whether file has an <EOL>
Karsten Hopp 90cef3
! 	for the last line in the file.  Normally you don't have to set or
Karsten Hopp 90cef3
! 	reset this option.
Karsten Hopp 90cef3
! 	When 'binary' is off and 'fixeol' is on the value is not used when
Karsten Hopp 90cef3
! 	writing the file.  When 'binary' is on or 'fixeol' is off it is used
Karsten Hopp 90cef3
! 	to remember the presence of a <EOL> for the last line in the file, so
Karsten Hopp 90cef3
! 	that when you write the file the situation from the original file can
Karsten Hopp 90cef3
! 	be kept.  But you can change it if you want to.
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
  			     *'equalalways'* *'ea'* *'noequalalways'* *'noea'*
Karsten Hopp 90cef3
  'equalalways' 'ea'	boolean	(default on)
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 3063,3068 ****
Karsten Hopp 90cef3
--- 3065,3081 ----
Karsten Hopp 90cef3
  	  fold:c	Folded			|hl-Folded|
Karsten Hopp 90cef3
  	  diff:c	DiffDelete		|hl-DiffDelete|
Karsten Hopp 90cef3
  
Karsten Hopp 90cef3
+ 		*'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'*
Karsten Hopp 90cef3
+ 'fixendofline' 'fixeol'	boolean	(default on)
Karsten Hopp 90cef3
+ 			local to buffer
Karsten Hopp 90cef3
+ 			{not in Vi}
Karsten Hopp 90cef3
+ 	When writing a file and this option is on, <EOL> at the end of file
Karsten Hopp 90cef3
+ 	will be restored if missing. Turn this option off if you want to
Karsten Hopp 90cef3
+ 	preserve the situation from the original file.
Karsten Hopp 90cef3
+ 	When the 'binary' option is set the value of this option doesn't
Karsten Hopp 90cef3
+ 	matter.
Karsten Hopp 90cef3
+ 	See the 'endofline' option.
Karsten Hopp 90cef3
+ 
Karsten Hopp 90cef3
  					*'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
Karsten Hopp 90cef3
  'fkmap' 'fk'		boolean (default off)			*E198*
Karsten Hopp 90cef3
  			global
Karsten Hopp 90cef3
*** ../vim-7.4.784/runtime/optwin.vim	2014-06-25 14:39:35.098348584 +0200
Karsten Hopp 90cef3
--- runtime/optwin.vim	2015-07-17 14:04:18.181772220 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 949,954 ****
Karsten Hopp 90cef3
--- 954,962 ----
Karsten Hopp 90cef3
  call append("$", "endofline\tlast line in the file has an end-of-line")
Karsten Hopp 90cef3
  call append("$", "\t(local to buffer)")
Karsten Hopp 90cef3
  call <SID>BinOptionL("eol")
Karsten Hopp 90cef3
+ call append("$", "fixeol\tfixes missing end-of-line at end of text file")
Karsten Hopp 90cef3
+ call append("$", "\t(local to buffer)")
Karsten Hopp 90cef3
+ call <SID>BinOptionL("fixeol")
Karsten Hopp 90cef3
  if has("multi_byte")
Karsten Hopp 90cef3
    call append("$", "bomb\tprepend a Byte Order Mark to the file")
Karsten Hopp 90cef3
    call append("$", "\t(local to buffer)")
Karsten Hopp 90cef3
*** ../vim-7.4.784/src/version.c	2015-07-17 13:42:17.778373909 +0200
Karsten Hopp 90cef3
--- src/version.c	2015-07-17 13:54:24.543439196 +0200
Karsten Hopp 90cef3
***************
Karsten Hopp 90cef3
*** 743,744 ****
Karsten Hopp 90cef3
--- 743,746 ----
Karsten Hopp 90cef3
  {   /* Add new patch number below this line */
Karsten Hopp 90cef3
+ /**/
Karsten Hopp 90cef3
+     785,
Karsten Hopp 90cef3
  /**/
Karsten Hopp 90cef3
Karsten Hopp 90cef3
-- 
Karsten Hopp 90cef3
A computer without Windows is like a fish without a bicycle.
Karsten Hopp 90cef3
Karsten Hopp 90cef3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 90cef3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 90cef3
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 90cef3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///