Karsten Hopp 6fcbe9
To: vim_dev@googlegroups.com
Karsten Hopp 6fcbe9
Subject: Patch 7.4.868
Karsten Hopp 6fcbe9
Fcc: outbox
Karsten Hopp 6fcbe9
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 6fcbe9
Mime-Version: 1.0
Karsten Hopp 6fcbe9
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 6fcbe9
Content-Transfer-Encoding: 8bit
Karsten Hopp 6fcbe9
------------
Karsten Hopp 6fcbe9
Karsten Hopp 6fcbe9
Patch 7.4.868
Karsten Hopp 6fcbe9
Problem:    'smarttab' is also effective when 'paste' is enabled. (Alexander
Karsten Hopp 6fcbe9
            Monakov)
Karsten Hopp 6fcbe9
Solution:   Disable 'smarttab' when 'paste' is set. (Christian Brabandt)
Karsten Hopp 6fcbe9
            Do the same for 'expandtab'.
Karsten Hopp 6fcbe9
Files:      src/option.c, src/structs.h
Karsten Hopp 6fcbe9
Karsten Hopp 6fcbe9
Karsten Hopp 6fcbe9
*** ../vim-7.4.867/src/option.c	2015-08-26 23:24:06.854494285 +0200
Karsten Hopp 6fcbe9
--- src/option.c	2015-09-15 17:20:59.307643051 +0200
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 387,396 ****
Karsten Hopp 6fcbe9
  static long	p_wm_nobin;
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  /* Saved values for when 'paste' is set */
Karsten Hopp 6fcbe9
  static long	p_tw_nopaste;
Karsten Hopp 6fcbe9
  static long	p_wm_nopaste;
Karsten Hopp 6fcbe9
- static long	p_sts_nopaste;
Karsten Hopp 6fcbe9
- static int	p_ai_nopaste;
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  struct vimoption
Karsten Hopp 6fcbe9
  {
Karsten Hopp 6fcbe9
--- 387,397 ----
Karsten Hopp 6fcbe9
  static long	p_wm_nobin;
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  /* Saved values for when 'paste' is set */
Karsten Hopp 6fcbe9
+ static int	p_ai_nopaste;
Karsten Hopp 6fcbe9
+ static int	p_et_nopaste;
Karsten Hopp 6fcbe9
+ static long	p_sts_nopaste;
Karsten Hopp 6fcbe9
  static long	p_tw_nopaste;
Karsten Hopp 6fcbe9
  static long	p_wm_nopaste;
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  struct vimoption
Karsten Hopp 6fcbe9
  {
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 10702,10707 ****
Karsten Hopp 6fcbe9
--- 10703,10709 ----
Karsten Hopp 6fcbe9
  	    buf->b_p_fixeol = p_fixeol;
Karsten Hopp 6fcbe9
  	    buf->b_p_et = p_et;
Karsten Hopp 6fcbe9
  	    buf->b_p_et_nobin = p_et_nobin;
Karsten Hopp 6fcbe9
+ 	    buf->b_p_et_nopaste = p_et_nopaste;
Karsten Hopp 6fcbe9
  	    buf->b_p_ml = p_ml;
Karsten Hopp 6fcbe9
  	    buf->b_p_ml_nobin = p_ml_nobin;
Karsten Hopp 6fcbe9
  	    buf->b_p_inf = p_inf;
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 11640,11645 ****
Karsten Hopp 6fcbe9
--- 11642,11648 ----
Karsten Hopp 6fcbe9
  {
Karsten Hopp 6fcbe9
      static int	old_p_paste = FALSE;
Karsten Hopp 6fcbe9
      static int	save_sm = 0;
Karsten Hopp 6fcbe9
+     static int	save_sta = 0;
Karsten Hopp 6fcbe9
  #ifdef FEAT_CMDL_INFO
Karsten Hopp 6fcbe9
      static int	save_ru = 0;
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 11664,11673 ****
Karsten Hopp 6fcbe9
--- 11667,11678 ----
Karsten Hopp 6fcbe9
  		buf->b_p_wm_nopaste = buf->b_p_wm;
Karsten Hopp 6fcbe9
  		buf->b_p_sts_nopaste = buf->b_p_sts;
Karsten Hopp 6fcbe9
  		buf->b_p_ai_nopaste = buf->b_p_ai;
Karsten Hopp 6fcbe9
+ 		buf->b_p_et_nopaste = buf->b_p_et;
Karsten Hopp 6fcbe9
  	    }
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  	    /* save global options */
Karsten Hopp 6fcbe9
  	    save_sm = p_sm;
Karsten Hopp 6fcbe9
+ 	    save_sta = p_sta;
Karsten Hopp 6fcbe9
  #ifdef FEAT_CMDL_INFO
Karsten Hopp 6fcbe9
  	    save_ru = p_ru;
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 11676,11685 ****
Karsten Hopp 6fcbe9
  	    save_hkmap = p_hkmap;
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
  	    /* save global values for local buffer options */
Karsten Hopp 6fcbe9
  	    p_tw_nopaste = p_tw;
Karsten Hopp 6fcbe9
  	    p_wm_nopaste = p_wm;
Karsten Hopp 6fcbe9
- 	    p_sts_nopaste = p_sts;
Karsten Hopp 6fcbe9
- 	    p_ai_nopaste = p_ai;
Karsten Hopp 6fcbe9
  	}
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  	/*
Karsten Hopp 6fcbe9
--- 11681,11691 ----
Karsten Hopp 6fcbe9
  	    save_hkmap = p_hkmap;
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
  	    /* save global values for local buffer options */
Karsten Hopp 6fcbe9
+ 	    p_ai_nopaste = p_ai;
Karsten Hopp 6fcbe9
+ 	    p_et_nopaste = p_et;
Karsten Hopp 6fcbe9
+ 	    p_sts_nopaste = p_sts;
Karsten Hopp 6fcbe9
  	    p_tw_nopaste = p_tw;
Karsten Hopp 6fcbe9
  	    p_wm_nopaste = p_wm;
Karsten Hopp 6fcbe9
  	}
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  	/*
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 11693,11702 ****
Karsten Hopp 6fcbe9
--- 11699,11710 ----
Karsten Hopp 6fcbe9
  	    buf->b_p_wm = 0;	    /* wrapmargin is 0 */
Karsten Hopp 6fcbe9
  	    buf->b_p_sts = 0;	    /* softtabstop is 0 */
Karsten Hopp 6fcbe9
  	    buf->b_p_ai = 0;	    /* no auto-indent */
Karsten Hopp 6fcbe9
+ 	    buf->b_p_et = 0;	    /* no expandtab */
Karsten Hopp 6fcbe9
  	}
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  	/* set global options */
Karsten Hopp 6fcbe9
  	p_sm = 0;		    /* no showmatch */
Karsten Hopp 6fcbe9
+ 	p_sta = 0;		    /* no smarttab */
Karsten Hopp 6fcbe9
  #ifdef FEAT_CMDL_INFO
Karsten Hopp 6fcbe9
  # ifdef FEAT_WINDOWS
Karsten Hopp 6fcbe9
  	if (p_ru)
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 11727,11736 ****
Karsten Hopp 6fcbe9
--- 11735,11746 ----
Karsten Hopp 6fcbe9
  	    buf->b_p_wm = buf->b_p_wm_nopaste;
Karsten Hopp 6fcbe9
  	    buf->b_p_sts = buf->b_p_sts_nopaste;
Karsten Hopp 6fcbe9
  	    buf->b_p_ai = buf->b_p_ai_nopaste;
Karsten Hopp 6fcbe9
+ 	    buf->b_p_et = buf->b_p_et_nopaste;
Karsten Hopp 6fcbe9
  	}
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
  	/* restore global options */
Karsten Hopp 6fcbe9
  	p_sm = save_sm;
Karsten Hopp 6fcbe9
+ 	p_sta = save_sta;
Karsten Hopp 6fcbe9
  #ifdef FEAT_CMDL_INFO
Karsten Hopp 6fcbe9
  # ifdef FEAT_WINDOWS
Karsten Hopp 6fcbe9
  	if (p_ru != save_ru)
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 11743,11752 ****
Karsten Hopp 6fcbe9
  	p_hkmap = save_hkmap;
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
  	/* set global values for local buffer options */
Karsten Hopp 6fcbe9
  	p_tw = p_tw_nopaste;
Karsten Hopp 6fcbe9
  	p_wm = p_wm_nopaste;
Karsten Hopp 6fcbe9
- 	p_sts = p_sts_nopaste;
Karsten Hopp 6fcbe9
- 	p_ai = p_ai_nopaste;
Karsten Hopp 6fcbe9
      }
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
      old_p_paste = p_paste;
Karsten Hopp 6fcbe9
--- 11753,11763 ----
Karsten Hopp 6fcbe9
  	p_hkmap = save_hkmap;
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
  	/* set global values for local buffer options */
Karsten Hopp 6fcbe9
+ 	p_ai = p_ai_nopaste;
Karsten Hopp 6fcbe9
+ 	p_et = p_et_nopaste;
Karsten Hopp 6fcbe9
+ 	p_sts = p_sts_nopaste;
Karsten Hopp 6fcbe9
  	p_tw = p_tw_nopaste;
Karsten Hopp 6fcbe9
  	p_wm = p_wm_nopaste;
Karsten Hopp 6fcbe9
      }
Karsten Hopp 6fcbe9
  
Karsten Hopp 6fcbe9
      old_p_paste = p_paste;
Karsten Hopp 6fcbe9
*** ../vim-7.4.867/src/structs.h	2015-07-21 15:48:13.589517950 +0200
Karsten Hopp 6fcbe9
--- src/structs.h	2015-09-15 17:16:58.742127236 +0200
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 1589,1594 ****
Karsten Hopp 6fcbe9
--- 1589,1595 ----
Karsten Hopp 6fcbe9
      int		b_p_fixeol;	/* 'fixendofline' */
Karsten Hopp 6fcbe9
      int		b_p_et;		/* 'expandtab' */
Karsten Hopp 6fcbe9
      int		b_p_et_nobin;	/* b_p_et saved for binary mode */
Karsten Hopp 6fcbe9
+     int	        b_p_et_nopaste; /* b_p_et saved for paste mode */
Karsten Hopp 6fcbe9
  #ifdef FEAT_MBYTE
Karsten Hopp 6fcbe9
      char_u	*b_p_fenc;	/* 'fileencoding' */
Karsten Hopp 6fcbe9
  #endif
Karsten Hopp 6fcbe9
*** ../vim-7.4.867/src/version.c	2015-09-15 15:57:22.815879940 +0200
Karsten Hopp 6fcbe9
--- src/version.c	2015-09-15 17:01:01.468036320 +0200
Karsten Hopp 6fcbe9
***************
Karsten Hopp 6fcbe9
*** 743,744 ****
Karsten Hopp 6fcbe9
--- 743,746 ----
Karsten Hopp 6fcbe9
  {   /* Add new patch number below this line */
Karsten Hopp 6fcbe9
+ /**/
Karsten Hopp 6fcbe9
+     868,
Karsten Hopp 6fcbe9
  /**/
Karsten Hopp 6fcbe9
Karsten Hopp 6fcbe9
-- 
Karsten Hopp 6fcbe9
Are leaders born or made?  And if they're made, can we return them under
Karsten Hopp 6fcbe9
warranty?
Karsten Hopp 6fcbe9
				(Scott Adams - The Dilbert principle)
Karsten Hopp 6fcbe9
Karsten Hopp 6fcbe9
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 6fcbe9
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 6fcbe9
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 6fcbe9
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///