Karsten Hopp 049fe7
To: vim_dev@googlegroups.com
Karsten Hopp 049fe7
Subject: Patch 7.3.597
Karsten Hopp 049fe7
Fcc: outbox
Karsten Hopp 049fe7
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 049fe7
Mime-Version: 1.0
Karsten Hopp 049fe7
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 049fe7
Content-Transfer-Encoding: 8bit
Karsten Hopp 049fe7
------------
Karsten Hopp 049fe7
Karsten Hopp 049fe7
Patch 7.3.597
Karsten Hopp 049fe7
Problem:    'clipboard' "autoselect" only applies to the * register. (Sergey
Karsten Hopp 049fe7
	    Vakulenko)
Karsten Hopp 049fe7
Solution:   Make 'autoselect' work for the + register. (Christian Brabant)
Karsten Hopp 049fe7
	    Add the "autoselectplus" option in 'clipboard' and the "P" flag in
Karsten Hopp 049fe7
	    'guioptions'.
Karsten Hopp 049fe7
Files:	    runtime/doc/options.txt, src/normal.c, src/ops.c, src/screen.c,
Karsten Hopp 049fe7
	    src/ui.c, src/globals.h, src/proto/ui.pro, src/option.h, src/gui.c
Karsten Hopp 049fe7
Karsten Hopp 049fe7
Karsten Hopp 049fe7
*** ../vim-7.3.596/runtime/doc/options.txt	2012-02-20 22:18:23.000000000 +0100
Karsten Hopp 049fe7
--- runtime/doc/options.txt	2012-07-10 15:40:35.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 1437,1442 ****
Karsten Hopp 049fe7
--- 1452,1458 ----
Karsten Hopp 049fe7
  	This option is a list of comma separated names.
Karsten Hopp 049fe7
  	These names are recognized:
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
+ 						*clipboard-unnamed*
Karsten Hopp 049fe7
  	unnamed		When included, Vim will use the clipboard register '*'
Karsten Hopp 049fe7
  			for all yank, delete, change and put operations which
Karsten Hopp 049fe7
  			would normally go to the unnamed register.  When a
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 1446,1460 ****
Karsten Hopp 049fe7
  			explicitly accessed using the "* notation.  Also see
Karsten Hopp 049fe7
  			|gui-clipboard|.
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  	unnamedplus	A variant of "unnamed" flag which uses the clipboard
Karsten Hopp 049fe7
  			register '+' (|quoteplus|) instead of register '*' for
Karsten Hopp 049fe7
  			all operations except yank.  Yank shall copy the text
Karsten Hopp 049fe7
  			into register '+' and also into '*' when "unnamed" is
Karsten Hopp 049fe7
  			included.
Karsten Hopp 049fe7
! 			Only available with the |+x11| feature.
Karsten Hopp 049fe7
  			Availability can be checked with: >
Karsten Hopp 049fe7
  				if has('unnamedplus')
Karsten Hopp 049fe7
  <
Karsten Hopp 049fe7
  	autoselect	Works like the 'a' flag in 'guioptions': If present,
Karsten Hopp 049fe7
  			then whenever Visual mode is started, or the Visual
Karsten Hopp 049fe7
  			area extended, Vim tries to become the owner of the
Karsten Hopp 049fe7
--- 1462,1478 ----
Karsten Hopp 049fe7
  			explicitly accessed using the "* notation.  Also see
Karsten Hopp 049fe7
  			|gui-clipboard|.
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
+ 						*clipboard-unnamedplus*
Karsten Hopp 049fe7
  	unnamedplus	A variant of "unnamed" flag which uses the clipboard
Karsten Hopp 049fe7
  			register '+' (|quoteplus|) instead of register '*' for
Karsten Hopp 049fe7
  			all operations except yank.  Yank shall copy the text
Karsten Hopp 049fe7
  			into register '+' and also into '*' when "unnamed" is
Karsten Hopp 049fe7
  			included.
Karsten Hopp 049fe7
! 			Only available with the |+X11| feature.
Karsten Hopp 049fe7
  			Availability can be checked with: >
Karsten Hopp 049fe7
  				if has('unnamedplus')
Karsten Hopp 049fe7
  <
Karsten Hopp 049fe7
+ 						*clipboard-autoselect*
Karsten Hopp 049fe7
  	autoselect	Works like the 'a' flag in 'guioptions': If present,
Karsten Hopp 049fe7
  			then whenever Visual mode is started, or the Visual
Karsten Hopp 049fe7
  			area extended, Vim tries to become the owner of the
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 1466,1474 ****
Karsten Hopp 049fe7
--- 1484,1499 ----
Karsten Hopp 049fe7
  			"autoselect" flag is used.
Karsten Hopp 049fe7
  			Also applies to the modeless selection.
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
+ 						*clipboard-autoselectplus*
Karsten Hopp 049fe7
+ 	autoselectplus  Like "autoselect" but using the + register instead of
Karsten Hopp 049fe7
+ 			the * register.  Compare to the 'P' flag in
Karsten Hopp 049fe7
+ 			'guioptions'.
Karsten Hopp 049fe7
+ 
Karsten Hopp 049fe7
+ 						*clipboard-autoselectml*
Karsten Hopp 049fe7
  	autoselectml	Like "autoselect", but for the modeless selection
Karsten Hopp 049fe7
  			only.  Compare to the 'A' flag in 'guioptions'.
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
+ 						*clipboard-html*
Karsten Hopp 049fe7
  	html		When the clipboard contains HTML, use this when
Karsten Hopp 049fe7
  			pasting.  When putting text on the clipboard, mark it
Karsten Hopp 049fe7
  			as HTML.  This works to copy rendered HTML from
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 1479,1484 ****
Karsten Hopp 049fe7
--- 1504,1510 ----
Karsten Hopp 049fe7
  			Only supported for GTK version 2 and later.
Karsten Hopp 049fe7
  			Only available with the |+multi_byte| feature.
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
+ 						*clipboard-exclude*
Karsten Hopp 049fe7
  	exclude:{pattern}
Karsten Hopp 049fe7
  			Defines a pattern that is matched against the name of
Karsten Hopp 049fe7
  			the terminal 'term'.  If there is a match, no
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 3547,3552 ****
Karsten Hopp 049fe7
--- 3600,3608 ----
Karsten Hopp 049fe7
  		windowing system's global selection unless explicitly told to
Karsten Hopp 049fe7
  		by a yank or delete operation for the "* register.
Karsten Hopp 049fe7
  		The same applies to the modeless selection.
Karsten Hopp 049fe7
+ 								*'go-P'*
Karsten Hopp 049fe7
+ 	  'P'	Like autoselect but using the "+ register instead of the "*
Karsten Hopp 049fe7
+ 	  	register.
Karsten Hopp 049fe7
  								*'go-A'*
Karsten Hopp 049fe7
  	  'A'	Autoselect for the modeless selection.  Like 'a', but only
Karsten Hopp 049fe7
  		applies to the modeless selection.
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/normal.c	2012-06-29 13:56:01.000000000 +0200
Karsten Hopp 049fe7
--- src/normal.c	2012-07-10 15:44:24.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 1451,1457 ****
Karsten Hopp 049fe7
       * This could call do_pending_operator() recursively, but that's OK
Karsten Hopp 049fe7
       * because gui_yank will be TRUE for the nested call.
Karsten Hopp 049fe7
       */
Karsten Hopp 049fe7
!     if (clip_star.available
Karsten Hopp 049fe7
  	    && oap->op_type != OP_NOP
Karsten Hopp 049fe7
  	    && !gui_yank
Karsten Hopp 049fe7
  # ifdef FEAT_VISUAL
Karsten Hopp 049fe7
--- 1451,1457 ----
Karsten Hopp 049fe7
       * This could call do_pending_operator() recursively, but that's OK
Karsten Hopp 049fe7
       * because gui_yank will be TRUE for the nested call.
Karsten Hopp 049fe7
       */
Karsten Hopp 049fe7
!     if ((clip_star.available || clip_plus.available)
Karsten Hopp 049fe7
  	    && oap->op_type != OP_NOP
Karsten Hopp 049fe7
  	    && !gui_yank
Karsten Hopp 049fe7
  # ifdef FEAT_VISUAL
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/ops.c	2012-06-29 13:34:15.000000000 +0200
Karsten Hopp 049fe7
--- src/ops.c	2012-07-10 16:20:29.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 962,969 ****
Karsten Hopp 049fe7
       * selection too. */
Karsten Hopp 049fe7
      if (name == '*' && clip_star.available)
Karsten Hopp 049fe7
      {
Karsten Hopp 049fe7
! 	if (clip_isautosel())
Karsten Hopp 049fe7
! 	    clip_update_selection();
Karsten Hopp 049fe7
  	may_get_selection(name);
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
--- 962,975 ----
Karsten Hopp 049fe7
       * selection too. */
Karsten Hopp 049fe7
      if (name == '*' && clip_star.available)
Karsten Hopp 049fe7
      {
Karsten Hopp 049fe7
! 	if (clip_isautosel_star())
Karsten Hopp 049fe7
! 	    clip_update_selection(&clip_star);
Karsten Hopp 049fe7
! 	may_get_selection(name);
Karsten Hopp 049fe7
!     }
Karsten Hopp 049fe7
!     if (name == '+' && clip_plus.available)
Karsten Hopp 049fe7
!     {
Karsten Hopp 049fe7
! 	if (clip_isautosel_plus())
Karsten Hopp 049fe7
! 	    clip_update_selection(&clip_plus);
Karsten Hopp 049fe7
  	may_get_selection(name);
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 3190,3196 ****
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  	clip_own_selection(&clip_plus);
Karsten Hopp 049fe7
  	clip_gen_set_selection(&clip_plus);
Karsten Hopp 049fe7
! 	if (!clip_isautosel() && !did_star && curr == &(y_regs[PLUS_REGISTER]))
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
  	    copy_yank_reg(&(y_regs[STAR_REGISTER]));
Karsten Hopp 049fe7
  	    clip_own_selection(&clip_star);
Karsten Hopp 049fe7
--- 3196,3203 ----
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  	clip_own_selection(&clip_plus);
Karsten Hopp 049fe7
  	clip_gen_set_selection(&clip_plus);
Karsten Hopp 049fe7
! 	if (!clip_isautosel_star() && !did_star
Karsten Hopp 049fe7
! 					  && curr == &(y_regs[PLUS_REGISTER]))
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
  	    copy_yank_reg(&(y_regs[STAR_REGISTER]));
Karsten Hopp 049fe7
  	    clip_own_selection(&clip_star);
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/screen.c	2012-06-13 18:06:32.000000000 +0200
Karsten Hopp 049fe7
--- src/screen.c	2012-07-10 16:39:01.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 519,526 ****
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
  # ifdef FEAT_CLIPBOARD
Karsten Hopp 049fe7
  		/* When Visual area changed, may have to update selection. */
Karsten Hopp 049fe7
! 		if (clip_star.available && clip_isautosel())
Karsten Hopp 049fe7
! 		    clip_update_selection();
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
  #ifdef FEAT_GUI
Karsten Hopp 049fe7
  		/* Remove the cursor before starting to do anything, because
Karsten Hopp 049fe7
--- 519,528 ----
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
  # ifdef FEAT_CLIPBOARD
Karsten Hopp 049fe7
  		/* When Visual area changed, may have to update selection. */
Karsten Hopp 049fe7
! 		if (clip_star.available && clip_isautosel_star())
Karsten Hopp 049fe7
! 		    clip_update_selection(&clip_star);
Karsten Hopp 049fe7
! 		if (clip_plus.available && clip_isautosel_plus())
Karsten Hopp 049fe7
! 		    clip_update_selection(&clip_plus);
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
  #ifdef FEAT_GUI
Karsten Hopp 049fe7
  		/* Remove the cursor before starting to do anything, because
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 814,821 ****
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  #ifdef FEAT_CLIPBOARD
Karsten Hopp 049fe7
      /* When Visual area changed, may have to update selection. */
Karsten Hopp 049fe7
!     if (clip_star.available && clip_isautosel())
Karsten Hopp 049fe7
! 	clip_update_selection();
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      win_update(wp);
Karsten Hopp 049fe7
--- 816,825 ----
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  #ifdef FEAT_CLIPBOARD
Karsten Hopp 049fe7
      /* When Visual area changed, may have to update selection. */
Karsten Hopp 049fe7
!     if (clip_star.available && clip_isautosel_star())
Karsten Hopp 049fe7
! 	clip_update_selection(&clip_star);
Karsten Hopp 049fe7
!     if (clip_plus.available && clip_isautosel_plus())
Karsten Hopp 049fe7
! 	clip_update_selection(&clip_plus);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      win_update(wp);
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 3000,3006 ****
Karsten Hopp 049fe7
  	    area_highlighting = TRUE;
Karsten Hopp 049fe7
  	    attr = hl_attr(HLF_V);
Karsten Hopp 049fe7
  #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
Karsten Hopp 049fe7
! 	    if (clip_star.available && !clip_star.owned && clip_isautosel())
Karsten Hopp 049fe7
  		attr = hl_attr(HLF_VNC);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
--- 3004,3013 ----
Karsten Hopp 049fe7
  	    area_highlighting = TRUE;
Karsten Hopp 049fe7
  	    attr = hl_attr(HLF_V);
Karsten Hopp 049fe7
  #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
Karsten Hopp 049fe7
! 	    if ((clip_star.available && !clip_star.owned
Karsten Hopp 049fe7
! 						     && clip_isautosel_star())
Karsten Hopp 049fe7
! 		    || (clip_plus.available && !clip_plus.owned
Karsten Hopp 049fe7
! 						    && clip_isautosel_plus()))
Karsten Hopp 049fe7
  		attr = hl_attr(HLF_VNC);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 9060,9066 ****
Karsten Hopp 049fe7
  	    || (wp != NULL && wp->w_width != Columns)
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
         )
Karsten Hopp 049fe7
! 	clip_clear_selection();
Karsten Hopp 049fe7
      else
Karsten Hopp 049fe7
  	clip_scroll_selection(-line_count);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
--- 9067,9073 ----
Karsten Hopp 049fe7
  	    || (wp != NULL && wp->w_width != Columns)
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
         )
Karsten Hopp 049fe7
! 	clip_clear_selection(&clip_star);
Karsten Hopp 049fe7
      else
Karsten Hopp 049fe7
  	clip_scroll_selection(-line_count);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 9281,9287 ****
Karsten Hopp 049fe7
  	    || (wp != NULL && wp->w_width != Columns)
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
         )
Karsten Hopp 049fe7
! 	clip_clear_selection();
Karsten Hopp 049fe7
      else
Karsten Hopp 049fe7
  	clip_scroll_selection(line_count);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
--- 9288,9294 ----
Karsten Hopp 049fe7
  	    || (wp != NULL && wp->w_width != Columns)
Karsten Hopp 049fe7
  # endif
Karsten Hopp 049fe7
         )
Karsten Hopp 049fe7
! 	clip_clear_selection(&clip_star);
Karsten Hopp 049fe7
      else
Karsten Hopp 049fe7
  	clip_scroll_selection(line_count);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/ui.c	2012-02-12 01:35:06.000000000 +0100
Karsten Hopp 049fe7
--- src/ui.c	2012-07-10 16:43:17.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 381,386 ****
Karsten Hopp 049fe7
--- 381,388 ----
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  #if defined(FEAT_CLIPBOARD) || defined(PROTO)
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
+ static void clip_copy_selection __ARGS((VimClipboard *clip));
Karsten Hopp 049fe7
+ 
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
   * Selection stuff using Visual mode, for cutting and pasting text to other
Karsten Hopp 049fe7
   * windows.
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 423,431 ****
Karsten Hopp 049fe7
   * this is called whenever VIsual mode is ended.
Karsten Hopp 049fe7
   */
Karsten Hopp 049fe7
      void
Karsten Hopp 049fe7
! clip_update_selection()
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
!     pos_T    start, end;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      /* If visual mode is only due to a redo command ("."), then ignore it */
Karsten Hopp 049fe7
      if (!redo_VIsual_busy && VIsual_active && (State & NORMAL))
Karsten Hopp 049fe7
--- 425,434 ----
Karsten Hopp 049fe7
   * this is called whenever VIsual mode is ended.
Karsten Hopp 049fe7
   */
Karsten Hopp 049fe7
      void
Karsten Hopp 049fe7
! clip_update_selection(clip)
Karsten Hopp 049fe7
!     VimClipboard    *clip;
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
!     pos_T	    start, end;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      /* If visual mode is only due to a redo command ("."), then ignore it */
Karsten Hopp 049fe7
      if (!redo_VIsual_busy && VIsual_active && (State & NORMAL))
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 444,460 ****
Karsten Hopp 049fe7
  	    start = curwin->w_cursor;
Karsten Hopp 049fe7
  	    end = VIsual;
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
! 	if (!equalpos(clip_star.start, start)
Karsten Hopp 049fe7
! 		|| !equalpos(clip_star.end, end)
Karsten Hopp 049fe7
! 		|| clip_star.vmode != VIsual_mode)
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
! 	    clip_clear_selection();
Karsten Hopp 049fe7
! 	    clip_star.start = start;
Karsten Hopp 049fe7
! 	    clip_star.end = end;
Karsten Hopp 049fe7
! 	    clip_star.vmode = VIsual_mode;
Karsten Hopp 049fe7
! 	    clip_free_selection(&clip_star);
Karsten Hopp 049fe7
! 	    clip_own_selection(&clip_star);
Karsten Hopp 049fe7
! 	    clip_gen_set_selection(&clip_star);
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
--- 447,463 ----
Karsten Hopp 049fe7
  	    start = curwin->w_cursor;
Karsten Hopp 049fe7
  	    end = VIsual;
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
! 	if (!equalpos(clip->start, start)
Karsten Hopp 049fe7
! 		|| !equalpos(clip->end, end)
Karsten Hopp 049fe7
! 		|| clip->vmode != VIsual_mode)
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
! 	    clip_clear_selection(clip);
Karsten Hopp 049fe7
! 	    clip->start = start;
Karsten Hopp 049fe7
! 	    clip->end = end;
Karsten Hopp 049fe7
! 	    clip->vmode = VIsual_mode;
Karsten Hopp 049fe7
! 	    clip_free_selection(clip);
Karsten Hopp 049fe7
! 	    clip_own_selection(clip);
Karsten Hopp 049fe7
! 	    clip_gen_set_selection(clip);
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 475,481 ****
Karsten Hopp 049fe7
  	int was_owned = cbd->owned;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  	cbd->owned = (clip_gen_own_selection(cbd) == OK);
Karsten Hopp 049fe7
! 	if (!was_owned && cbd == &clip_star)
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
  	    /* May have to show a different kind of highlighting for the
Karsten Hopp 049fe7
  	     * selected area.  There is no specific redraw command for this,
Karsten Hopp 049fe7
--- 478,484 ----
Karsten Hopp 049fe7
  	int was_owned = cbd->owned;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  	cbd->owned = (clip_gen_own_selection(cbd) == OK);
Karsten Hopp 049fe7
! 	if (!was_owned && (cbd == &clip_star || cbd == &clip_plus))
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
  	    /* May have to show a different kind of highlighting for the
Karsten Hopp 049fe7
  	     * selected area.  There is no specific redraw command for this,
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 483,489 ****
Karsten Hopp 049fe7
  	    if (cbd->owned
Karsten Hopp 049fe7
  		    && (get_real_state() == VISUAL
Karsten Hopp 049fe7
  					    || get_real_state() == SELECTMODE)
Karsten Hopp 049fe7
! 		    && clip_isautosel()
Karsten Hopp 049fe7
  		    && hl_attr(HLF_V) != hl_attr(HLF_VNC))
Karsten Hopp 049fe7
  		redraw_curbuf_later(INVERTED_ALL);
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
--- 486,493 ----
Karsten Hopp 049fe7
  	    if (cbd->owned
Karsten Hopp 049fe7
  		    && (get_real_state() == VISUAL
Karsten Hopp 049fe7
  					    || get_real_state() == SELECTMODE)
Karsten Hopp 049fe7
! 		    && (cbd == &clip_star ? clip_isautosel_star()
Karsten Hopp 049fe7
! 						      : clip_isautosel_plus())
Karsten Hopp 049fe7
  		    && hl_attr(HLF_V) != hl_attr(HLF_VNC))
Karsten Hopp 049fe7
  		redraw_curbuf_later(INVERTED_ALL);
Karsten Hopp 049fe7
  	}
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 502,513 ****
Karsten Hopp 049fe7
  #ifdef FEAT_X11
Karsten Hopp 049fe7
      int	    was_owned = cbd->owned;
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
!     int     visual_selection = (cbd == &clip_star);
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      clip_free_selection(cbd);
Karsten Hopp 049fe7
      cbd->owned = FALSE;
Karsten Hopp 049fe7
      if (visual_selection)
Karsten Hopp 049fe7
! 	clip_clear_selection();
Karsten Hopp 049fe7
      clip_gen_lose_selection(cbd);
Karsten Hopp 049fe7
  #ifdef FEAT_X11
Karsten Hopp 049fe7
      if (visual_selection)
Karsten Hopp 049fe7
--- 506,520 ----
Karsten Hopp 049fe7
  #ifdef FEAT_X11
Karsten Hopp 049fe7
      int	    was_owned = cbd->owned;
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
!     int     visual_selection = FALSE;
Karsten Hopp 049fe7
! 
Karsten Hopp 049fe7
!     if (cbd == &clip_star || cbd == &clip_plus)
Karsten Hopp 049fe7
! 	visual_selection = TRUE;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      clip_free_selection(cbd);
Karsten Hopp 049fe7
      cbd->owned = FALSE;
Karsten Hopp 049fe7
      if (visual_selection)
Karsten Hopp 049fe7
! 	clip_clear_selection(cbd);
Karsten Hopp 049fe7
      clip_gen_lose_selection(cbd);
Karsten Hopp 049fe7
  #ifdef FEAT_X11
Karsten Hopp 049fe7
      if (visual_selection)
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 518,524 ****
Karsten Hopp 049fe7
  	if (was_owned
Karsten Hopp 049fe7
  		&& (get_real_state() == VISUAL
Karsten Hopp 049fe7
  					    || get_real_state() == SELECTMODE)
Karsten Hopp 049fe7
! 		&& clip_isautosel()
Karsten Hopp 049fe7
  		&& hl_attr(HLF_V) != hl_attr(HLF_VNC))
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
  	    update_curbuf(INVERTED_ALL);
Karsten Hopp 049fe7
--- 525,532 ----
Karsten Hopp 049fe7
  	if (was_owned
Karsten Hopp 049fe7
  		&& (get_real_state() == VISUAL
Karsten Hopp 049fe7
  					    || get_real_state() == SELECTMODE)
Karsten Hopp 049fe7
! 		&& (cbd == &clip_star ?
Karsten Hopp 049fe7
! 				clip_isautosel_star() : clip_isautosel_plus())
Karsten Hopp 049fe7
  		&& hl_attr(HLF_V) != hl_attr(HLF_VNC))
Karsten Hopp 049fe7
  	{
Karsten Hopp 049fe7
  	    update_curbuf(INVERTED_ALL);
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 534,551 ****
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
!     void
Karsten Hopp 049fe7
! clip_copy_selection()
Karsten Hopp 049fe7
! {
Karsten Hopp 049fe7
!     if (VIsual_active && (State & NORMAL) && clip_star.available)
Karsten Hopp 049fe7
!     {
Karsten Hopp 049fe7
! 	if (clip_isautosel())
Karsten Hopp 049fe7
! 	    clip_update_selection();
Karsten Hopp 049fe7
! 	clip_free_selection(&clip_star);
Karsten Hopp 049fe7
! 	clip_own_selection(&clip_star);
Karsten Hopp 049fe7
! 	if (clip_star.owned)
Karsten Hopp 049fe7
! 	    clip_get_selection(&clip_star);
Karsten Hopp 049fe7
! 	clip_gen_set_selection(&clip_star);
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
--- 542,559 ----
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
!     static void
Karsten Hopp 049fe7
! clip_copy_selection(clip)
Karsten Hopp 049fe7
!     VimClipboard	*clip;
Karsten Hopp 049fe7
! {
Karsten Hopp 049fe7
!     if (VIsual_active && (State & NORMAL) && clip->available)
Karsten Hopp 049fe7
!     {
Karsten Hopp 049fe7
! 	clip_update_selection(clip);
Karsten Hopp 049fe7
! 	clip_free_selection(clip);
Karsten Hopp 049fe7
! 	clip_own_selection(clip);
Karsten Hopp 049fe7
! 	if (clip->owned)
Karsten Hopp 049fe7
! 	    clip_get_selection(clip);
Karsten Hopp 049fe7
! 	clip_gen_set_selection(clip);
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 555,575 ****
Karsten Hopp 049fe7
      void
Karsten Hopp 049fe7
  clip_auto_select()
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
!     if (clip_isautosel())
Karsten Hopp 049fe7
! 	clip_copy_selection();
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
!  * Return TRUE if automatic selection of Visual area is desired.
Karsten Hopp 049fe7
   */
Karsten Hopp 049fe7
      int
Karsten Hopp 049fe7
! clip_isautosel()
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
      return (
Karsten Hopp 049fe7
  #ifdef FEAT_GUI
Karsten Hopp 049fe7
  	    gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) :
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
! 	    clip_autoselect);
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
--- 563,600 ----
Karsten Hopp 049fe7
      void
Karsten Hopp 049fe7
  clip_auto_select()
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
!     if (clip_isautosel_star())
Karsten Hopp 049fe7
! 	clip_copy_selection(&clip_star);
Karsten Hopp 049fe7
!     if (clip_isautosel_plus())
Karsten Hopp 049fe7
! 	clip_copy_selection(&clip_plus);
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
!  * Return TRUE if automatic selection of Visual area is desired for the *
Karsten Hopp 049fe7
!  * register.
Karsten Hopp 049fe7
   */
Karsten Hopp 049fe7
      int
Karsten Hopp 049fe7
! clip_isautosel_star()
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
      return (
Karsten Hopp 049fe7
  #ifdef FEAT_GUI
Karsten Hopp 049fe7
  	    gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) :
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
! 	    clip_autoselect_star);
Karsten Hopp 049fe7
! }
Karsten Hopp 049fe7
! 
Karsten Hopp 049fe7
! /*
Karsten Hopp 049fe7
!  * Return TRUE if automatic selection of Visual area is desired for the +
Karsten Hopp 049fe7
!  * register.
Karsten Hopp 049fe7
!  */
Karsten Hopp 049fe7
!     int
Karsten Hopp 049fe7
! clip_isautosel_plus()
Karsten Hopp 049fe7
! {
Karsten Hopp 049fe7
!     return (
Karsten Hopp 049fe7
! #ifdef FEAT_GUI
Karsten Hopp 049fe7
! 	    gui.in_use ? (vim_strchr(p_go, GO_ASELPLUS) != NULL) :
Karsten Hopp 049fe7
! #endif
Karsten Hopp 049fe7
! 	    clip_autoselect_plus);
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 657,663 ****
Karsten Hopp 049fe7
      VimClipboard	*cb = &clip_star;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      if (cb->state == SELECT_DONE)
Karsten Hopp 049fe7
! 	clip_clear_selection();
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      row = check_row(row);
Karsten Hopp 049fe7
      col = check_col(col);
Karsten Hopp 049fe7
--- 682,688 ----
Karsten Hopp 049fe7
      VimClipboard	*cb = &clip_star;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      if (cb->state == SELECT_DONE)
Karsten Hopp 049fe7
! 	clip_clear_selection(cb);
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      row = check_row(row);
Karsten Hopp 049fe7
      col = check_col(col);
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 749,755 ****
Karsten Hopp 049fe7
  	printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
Karsten Hopp 049fe7
  		cb->start.col, cb->end.lnum, cb->end.col);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
! 	if (clip_isautosel()
Karsten Hopp 049fe7
  		|| (
Karsten Hopp 049fe7
  #ifdef FEAT_GUI
Karsten Hopp 049fe7
  		    gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) :
Karsten Hopp 049fe7
--- 774,780 ----
Karsten Hopp 049fe7
  	printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
Karsten Hopp 049fe7
  		cb->start.col, cb->end.lnum, cb->end.col);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
! 	if (clip_isautosel_star()
Karsten Hopp 049fe7
  		|| (
Karsten Hopp 049fe7
  #ifdef FEAT_GUI
Karsten Hopp 049fe7
  		    gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) :
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 932,947 ****
Karsten Hopp 049fe7
   * Called from outside to clear selected region from the display
Karsten Hopp 049fe7
   */
Karsten Hopp 049fe7
      void
Karsten Hopp 049fe7
! clip_clear_selection()
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
-     VimClipboard    *cb = &clip_star;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
!     if (cb->state == SELECT_CLEARED)
Karsten Hopp 049fe7
  	return;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
!     clip_invert_area((int)cb->start.lnum, cb->start.col, (int)cb->end.lnum,
Karsten Hopp 049fe7
! 						     cb->end.col, CLIP_CLEAR);
Karsten Hopp 049fe7
!     cb->state = SELECT_CLEARED;
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
--- 957,972 ----
Karsten Hopp 049fe7
   * Called from outside to clear selected region from the display
Karsten Hopp 049fe7
   */
Karsten Hopp 049fe7
      void
Karsten Hopp 049fe7
! clip_clear_selection(cbd)
Karsten Hopp 049fe7
!     VimClipboard    *cbd;
Karsten Hopp 049fe7
  {
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
!     if (cbd->state == SELECT_CLEARED)
Karsten Hopp 049fe7
  	return;
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
!     clip_invert_area((int)cbd->start.lnum, cbd->start.col, (int)cbd->end.lnum,
Karsten Hopp 049fe7
! 						     cbd->end.col, CLIP_CLEAR);
Karsten Hopp 049fe7
!     cbd->state = SELECT_CLEARED;
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 954,960 ****
Karsten Hopp 049fe7
      if (clip_star.state == SELECT_DONE
Karsten Hopp 049fe7
  	    && row2 >= clip_star.start.lnum
Karsten Hopp 049fe7
  	    && row1 <= clip_star.end.lnum)
Karsten Hopp 049fe7
! 	clip_clear_selection();
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
--- 979,985 ----
Karsten Hopp 049fe7
      if (clip_star.state == SELECT_DONE
Karsten Hopp 049fe7
  	    && row2 >= clip_star.start.lnum
Karsten Hopp 049fe7
  	    && row1 <= clip_star.end.lnum)
Karsten Hopp 049fe7
! 	clip_clear_selection(&clip_star);
Karsten Hopp 049fe7
  }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
  /*
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/globals.h	2012-06-29 12:35:40.000000000 +0200
Karsten Hopp 049fe7
--- src/globals.h	2012-07-10 16:35:13.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 517,523 ****
Karsten Hopp 049fe7
  # define CLIP_UNNAMED_PLUS 2
Karsten Hopp 049fe7
  EXTERN int	clip_unnamed INIT(= 0); /* above two values or'ed */
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
! EXTERN int	clip_autoselect INIT(= FALSE);
Karsten Hopp 049fe7
  EXTERN int	clip_autoselectml INIT(= FALSE);
Karsten Hopp 049fe7
  EXTERN int	clip_html INIT(= FALSE);
Karsten Hopp 049fe7
  EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
Karsten Hopp 049fe7
--- 517,524 ----
Karsten Hopp 049fe7
  # define CLIP_UNNAMED_PLUS 2
Karsten Hopp 049fe7
  EXTERN int	clip_unnamed INIT(= 0); /* above two values or'ed */
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
! EXTERN int	clip_autoselect_star INIT(= FALSE);
Karsten Hopp 049fe7
! EXTERN int	clip_autoselect_plus INIT(= FALSE);
Karsten Hopp 049fe7
  EXTERN int	clip_autoselectml INIT(= FALSE);
Karsten Hopp 049fe7
  EXTERN int	clip_html INIT(= FALSE);
Karsten Hopp 049fe7
  EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/proto/ui.pro	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 049fe7
--- src/proto/ui.pro	2012-07-10 16:37:35.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 11,27 ****
Karsten Hopp 049fe7
  void ui_new_shellsize __ARGS((void));
Karsten Hopp 049fe7
  void ui_breakcheck __ARGS((void));
Karsten Hopp 049fe7
  void clip_init __ARGS((int can_use));
Karsten Hopp 049fe7
! void clip_update_selection __ARGS((void));
Karsten Hopp 049fe7
  void clip_own_selection __ARGS((VimClipboard *cbd));
Karsten Hopp 049fe7
  void clip_lose_selection __ARGS((VimClipboard *cbd));
Karsten Hopp 049fe7
- void clip_copy_selection __ARGS((void));
Karsten Hopp 049fe7
  void clip_auto_select __ARGS((void));
Karsten Hopp 049fe7
! int clip_isautosel __ARGS((void));
Karsten Hopp 049fe7
  void clip_modeless __ARGS((int button, int is_click, int is_drag));
Karsten Hopp 049fe7
  void clip_start_selection __ARGS((int col, int row, int repeated_click));
Karsten Hopp 049fe7
  void clip_process_selection __ARGS((int button, int col, int row, int_u repeated_click));
Karsten Hopp 049fe7
  void clip_may_redraw_selection __ARGS((int row, int col, int len));
Karsten Hopp 049fe7
! void clip_clear_selection __ARGS((void));
Karsten Hopp 049fe7
  void clip_may_clear_selection __ARGS((int row1, int row2));
Karsten Hopp 049fe7
  void clip_scroll_selection __ARGS((int rows));
Karsten Hopp 049fe7
  void clip_copy_modeless_selection __ARGS((int both));
Karsten Hopp 049fe7
--- 11,27 ----
Karsten Hopp 049fe7
  void ui_new_shellsize __ARGS((void));
Karsten Hopp 049fe7
  void ui_breakcheck __ARGS((void));
Karsten Hopp 049fe7
  void clip_init __ARGS((int can_use));
Karsten Hopp 049fe7
! void clip_update_selection __ARGS((VimClipboard *clip));
Karsten Hopp 049fe7
  void clip_own_selection __ARGS((VimClipboard *cbd));
Karsten Hopp 049fe7
  void clip_lose_selection __ARGS((VimClipboard *cbd));
Karsten Hopp 049fe7
  void clip_auto_select __ARGS((void));
Karsten Hopp 049fe7
! int clip_isautosel_star __ARGS((void));
Karsten Hopp 049fe7
! int clip_isautosel_plus __ARGS((void));
Karsten Hopp 049fe7
  void clip_modeless __ARGS((int button, int is_click, int is_drag));
Karsten Hopp 049fe7
  void clip_start_selection __ARGS((int col, int row, int repeated_click));
Karsten Hopp 049fe7
  void clip_process_selection __ARGS((int button, int col, int row, int_u repeated_click));
Karsten Hopp 049fe7
  void clip_may_redraw_selection __ARGS((int row, int col, int len));
Karsten Hopp 049fe7
! void clip_clear_selection __ARGS((VimClipboard *cbd));
Karsten Hopp 049fe7
  void clip_may_clear_selection __ARGS((int row1, int row2));
Karsten Hopp 049fe7
  void clip_scroll_selection __ARGS((int rows));
Karsten Hopp 049fe7
  void clip_copy_modeless_selection __ARGS((int both));
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/option.h	2012-06-06 16:12:54.000000000 +0200
Karsten Hopp 049fe7
--- src/option.h	2012-07-10 15:54:32.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 229,234 ****
Karsten Hopp 049fe7
--- 229,235 ----
Karsten Hopp 049fe7
  #define GO_MENUS	'm'		/* use menu bar */
Karsten Hopp 049fe7
  #define GO_NOSYSMENU	'M'		/* don't source system menu */
Karsten Hopp 049fe7
  #define GO_POINTER	'p'		/* pointer enter/leave callbacks */
Karsten Hopp 049fe7
+ #define GO_ASELPLUS	'P'		/* autoselectPlus */
Karsten Hopp 049fe7
  #define GO_RIGHT	'r'		/* use right scrollbar */
Karsten Hopp 049fe7
  #define GO_VRIGHT	'R'		/* right scrollbar with vert split */
Karsten Hopp 049fe7
  #define GO_TEAROFF	't'		/* add tear-off menu items */
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/gui.c	2012-05-27 00:37:45.000000000 +0200
Karsten Hopp 049fe7
--- src/gui.c	2012-07-10 16:43:34.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 3154,3160 ****
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      if (clip_star.state != SELECT_CLEARED && !did_clip)
Karsten Hopp 049fe7
! 	clip_clear_selection();
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      /* Don't put events in the input queue now. */
Karsten Hopp 049fe7
--- 3154,3160 ----
Karsten Hopp 049fe7
      }
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      if (clip_star.state != SELECT_CLEARED && !did_clip)
Karsten Hopp 049fe7
! 	clip_clear_selection(&clip_star);
Karsten Hopp 049fe7
  #endif
Karsten Hopp 049fe7
  
Karsten Hopp 049fe7
      /* Don't put events in the input queue now. */
Karsten Hopp 049fe7
*** ../vim-7.3.596/src/version.c	2012-07-10 15:18:18.000000000 +0200
Karsten Hopp 049fe7
--- src/version.c	2012-07-10 16:32:16.000000000 +0200
Karsten Hopp 049fe7
***************
Karsten Hopp 049fe7
*** 716,717 ****
Karsten Hopp 049fe7
--- 716,719 ----
Karsten Hopp 049fe7
  {   /* Add new patch number below this line */
Karsten Hopp 049fe7
+ /**/
Karsten Hopp 049fe7
+     597,
Karsten Hopp 049fe7
  /**/
Karsten Hopp 049fe7
Karsten Hopp 049fe7
-- 
Karsten Hopp 049fe7
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 049fe7
106. When told to "go to your room" you inform your parents that you
Karsten Hopp 049fe7
     can't...because you were kicked out and banned.
Karsten Hopp 049fe7
Karsten Hopp 049fe7
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 049fe7
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 049fe7
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 049fe7
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///