Blob Blame History Raw
To: vim-dev@vim.org
Subject: Patch 7.1.201
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 7.1.201
Problem:    When reading stdin 'fenc' and 'ff are not set.
Solution:   Set the options after reading stdin. (Ben Schmidt)
Files:	    src/fileio.c


*** ../vim-7.1.200/src/fileio.c	Wed Jan  2 21:07:32 2008
--- src/fileio.c	Fri Jan  4 16:18:27 2008
***************
*** 221,231 ****
  {
      int		fd = 0;
      int		newfile = (flags & READ_NEW);
-     int		set_options = newfile || (eap != NULL && eap->read_edit);
      int		check_readonly;
      int		filtering = (flags & READ_FILTER);
      int		read_stdin = (flags & READ_STDIN);
      int		read_buffer = (flags & READ_BUFFER);
      linenr_T	read_buf_lnum = 1;	/* next line to read from curbuf */
      colnr_T	read_buf_col = 0;	/* next char to read from this line */
      char_u	c;
--- 221,232 ----
  {
      int		fd = 0;
      int		newfile = (flags & READ_NEW);
      int		check_readonly;
      int		filtering = (flags & READ_FILTER);
      int		read_stdin = (flags & READ_STDIN);
      int		read_buffer = (flags & READ_BUFFER);
+     int		set_options = newfile || read_buffer
+ 					   || (eap != NULL && eap->read_edit);
      linenr_T	read_buf_lnum = 1;	/* next line to read from curbuf */
      colnr_T	read_buf_col = 0;	/* next char to read from this line */
      char_u	c;
***************
*** 650,657 ****
  
      if (set_options)
      {
! 	curbuf->b_p_eol = TRUE;
! 	curbuf->b_start_eol = TRUE;
  #ifdef FEAT_MBYTE
  	curbuf->b_p_bomb = FALSE;
  	curbuf->b_start_bomb = FALSE;
--- 651,663 ----
  
      if (set_options)
      {
! 	/* Don't change 'eol' if reading from buffer as it will already be
! 	 * correctly set when reading stdin. */
! 	if (!read_buffer)
! 	{
! 	    curbuf->b_p_eol = TRUE;
! 	    curbuf->b_start_eol = TRUE;
! 	}
  #ifdef FEAT_MBYTE
  	curbuf->b_p_bomb = FALSE;
  	curbuf->b_start_bomb = FALSE;
*** ../vim-7.1.200/src/version.c	Fri Jan  4 16:00:10 2008
--- src/version.c	Fri Jan  4 16:27:01 2008
***************
*** 668,669 ****
--- 668,671 ----
  {   /* Add new patch number below this line */
+ /**/
+     201,
  /**/

-- 
A mathematician is a device for turning coffee into theorems.
					Paul Erdos
A computer programmer is a device for turning coffee into bugs.
					Bram Moolenaar

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///