Karsten Hopp d4e77d
To: vim-dev@vim.org
Karsten Hopp d4e77d
Subject: patch 7.1.066
Karsten Hopp d4e77d
Fcc: outbox
Karsten Hopp d4e77d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp d4e77d
Mime-Version: 1.0
Karsten Hopp d4e77d
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp d4e77d
Content-Transfer-Encoding: 8bit
Karsten Hopp d4e77d
------------
Karsten Hopp d4e77d
Karsten Hopp d4e77d
Patch 7.1.066
Karsten Hopp d4e77d
Problem:    When 'bomb' is set or reset the file should be considered
Karsten Hopp d4e77d
	    modified.  (Tony Mechelynck)
Karsten Hopp d4e77d
Solution:   Handle like 'endofline'. (Martin Toft)
Karsten Hopp d4e77d
Files:	    src/buffer.c, src/fileio.c, src/option.c, src/structs.h
Karsten Hopp d4e77d
Karsten Hopp d4e77d
Karsten Hopp d4e77d
*** ../vim-7.1.065/src/buffer.c	Mon Aug  6 22:27:12 2007
Karsten Hopp d4e77d
--- src/buffer.c	Sat Aug 11 16:56:57 2007
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 502,507 ****
Karsten Hopp d4e77d
--- 502,508 ----
Karsten Hopp d4e77d
      buf->b_start_eol = TRUE;
Karsten Hopp d4e77d
  #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
      buf->b_p_bomb = FALSE;
Karsten Hopp d4e77d
+     buf->b_start_bomb = FALSE;
Karsten Hopp d4e77d
  #endif
Karsten Hopp d4e77d
      buf->b_ml.ml_mfp = NULL;
Karsten Hopp d4e77d
      buf->b_ml.ml_flags = ML_EMPTY;		/* empty buffer */
Karsten Hopp d4e77d
*** ../vim-7.1.065/src/fileio.c	Tue Jul 10 17:09:51 2007
Karsten Hopp d4e77d
--- src/fileio.c	Sat Aug 11 16:56:57 2007
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 654,659 ****
Karsten Hopp d4e77d
--- 654,660 ----
Karsten Hopp d4e77d
  	curbuf->b_start_eol = TRUE;
Karsten Hopp d4e77d
  #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
  	curbuf->b_p_bomb = FALSE;
Karsten Hopp d4e77d
+ 	curbuf->b_start_bomb = FALSE;
Karsten Hopp d4e77d
  #endif
Karsten Hopp d4e77d
      }
Karsten Hopp d4e77d
  
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 912,918 ****
Karsten Hopp d4e77d
--- 913,922 ----
Karsten Hopp d4e77d
  	file_rewind = FALSE;
Karsten Hopp d4e77d
  #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
  	if (set_options)
Karsten Hopp d4e77d
+ 	{
Karsten Hopp d4e77d
  	    curbuf->b_p_bomb = FALSE;
Karsten Hopp d4e77d
+ 	    curbuf->b_start_bomb = FALSE;
Karsten Hopp d4e77d
+ 	}
Karsten Hopp d4e77d
  	conv_error = 0;
Karsten Hopp d4e77d
  #endif
Karsten Hopp d4e77d
      }
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 1361,1367 ****
Karsten Hopp d4e77d
--- 1365,1374 ----
Karsten Hopp d4e77d
  		    size -= blen;
Karsten Hopp d4e77d
  		    mch_memmove(ptr, ptr + blen, (size_t)size);
Karsten Hopp d4e77d
  		    if (set_options)
Karsten Hopp d4e77d
+ 		    {
Karsten Hopp d4e77d
  			curbuf->b_p_bomb = TRUE;
Karsten Hopp d4e77d
+ 			curbuf->b_start_bomb = TRUE;
Karsten Hopp d4e77d
+ 		    }
Karsten Hopp d4e77d
  		}
Karsten Hopp d4e77d
  
Karsten Hopp d4e77d
  		if (fio_flags == FIO_UCSBOM)
Karsten Hopp d4e77d
*** ../vim-7.1.065/src/option.c	Tue Jul 24 14:57:16 2007
Karsten Hopp d4e77d
--- src/option.c	Sat Aug 11 16:56:57 2007
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 7118,7123 ****
Karsten Hopp d4e77d
--- 7118,7128 ----
Karsten Hopp d4e77d
      /* when 'endofline' is changed, redraw the window title */
Karsten Hopp d4e77d
      else if ((int *)varp == &curbuf->b_p_eol)
Karsten Hopp d4e77d
  	need_maketitle = TRUE;
Karsten Hopp d4e77d
+ #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
+     /* when 'bomb' is changed, redraw the window title */
Karsten Hopp d4e77d
+     else if ((int *)varp == &curbuf->b_p_bomb)
Karsten Hopp d4e77d
+ 	need_maketitle = TRUE;
Karsten Hopp d4e77d
+ #endif
Karsten Hopp d4e77d
  #endif
Karsten Hopp d4e77d
  
Karsten Hopp d4e77d
      /* when 'bin' is set also set some other options */
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 10604,10609 ****
Karsten Hopp d4e77d
--- 10609,10616 ----
Karsten Hopp d4e77d
      buf->b_start_ffc = *buf->b_p_ff;
Karsten Hopp d4e77d
      buf->b_start_eol = buf->b_p_eol;
Karsten Hopp d4e77d
  #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
+     buf->b_start_bomb = buf->b_p_bomb;
Karsten Hopp d4e77d
+ 
Karsten Hopp d4e77d
      /* Only use free/alloc when necessary, they take time. */
Karsten Hopp d4e77d
      if (buf->b_start_fenc == NULL
Karsten Hopp d4e77d
  			     || STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0)
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 10617,10623 ****
Karsten Hopp d4e77d
  /*
Karsten Hopp d4e77d
   * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value
Karsten Hopp d4e77d
   * from when editing started (save_file_ff() called).
Karsten Hopp d4e77d
!  * Also when 'endofline' was changed and 'binary' is set.
Karsten Hopp d4e77d
   * Don't consider a new, empty buffer to be changed.
Karsten Hopp d4e77d
   */
Karsten Hopp d4e77d
      int
Karsten Hopp d4e77d
--- 10624,10631 ----
Karsten Hopp d4e77d
  /*
Karsten Hopp d4e77d
   * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value
Karsten Hopp d4e77d
   * from when editing started (save_file_ff() called).
Karsten Hopp d4e77d
!  * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
Karsten Hopp d4e77d
!  * changed and 'binary' is not set.
Karsten Hopp d4e77d
   * Don't consider a new, empty buffer to be changed.
Karsten Hopp d4e77d
   */
Karsten Hopp d4e77d
      int
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 10636,10641 ****
Karsten Hopp d4e77d
--- 10644,10651 ----
Karsten Hopp d4e77d
      if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
Karsten Hopp d4e77d
  	return TRUE;
Karsten Hopp d4e77d
  #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
+     if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb)
Karsten Hopp d4e77d
+ 	return TRUE;
Karsten Hopp d4e77d
      if (buf->b_start_fenc == NULL)
Karsten Hopp d4e77d
  	return (*buf->b_p_fenc != NUL);
Karsten Hopp d4e77d
      return (STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0);
Karsten Hopp d4e77d
*** ../vim-7.1.065/src/structs.h	Thu Jul 26 22:55:11 2007
Karsten Hopp d4e77d
--- src/structs.h	Sat Aug 11 16:56:57 2007
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 1453,1458 ****
Karsten Hopp d4e77d
--- 1453,1459 ----
Karsten Hopp d4e77d
  #ifdef FEAT_MBYTE
Karsten Hopp d4e77d
      char_u	*b_start_fenc;	/* 'fileencoding' when edit started or NULL */
Karsten Hopp d4e77d
      int		b_bad_char;	/* "++bad=" argument when edit started or 0 */
Karsten Hopp d4e77d
+     int		b_start_bomb;	/* 'bomb' when it was read */
Karsten Hopp d4e77d
  #endif
Karsten Hopp d4e77d
  
Karsten Hopp d4e77d
  #ifdef FEAT_EVAL
Karsten Hopp d4e77d
*** ../vim-7.1.065/src/version.c	Sun Aug 12 15:24:05 2007
Karsten Hopp d4e77d
--- src/version.c	Sun Aug 12 15:48:34 2007
Karsten Hopp d4e77d
***************
Karsten Hopp d4e77d
*** 668,669 ****
Karsten Hopp d4e77d
--- 668,671 ----
Karsten Hopp d4e77d
  {   /* Add new patch number below this line */
Karsten Hopp d4e77d
+ /**/
Karsten Hopp d4e77d
+     66,
Karsten Hopp d4e77d
  /**/
Karsten Hopp d4e77d
Karsten Hopp d4e77d
-- 
Karsten Hopp d4e77d
hundred-and-one symptoms of being an internet addict:
Karsten Hopp d4e77d
127. You bring your laptop and cellular phone to church.
Karsten Hopp d4e77d
Karsten Hopp d4e77d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp d4e77d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp d4e77d
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp d4e77d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///