073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.445
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.445
073263
Problem:    Clipboard may be cleared on startup.
073263
Solution:   Set clip_did_set_selection to -1 during startup. (Christian
073263
	    Brabandt)
073263
Files:	    src/main.c, src/ui.c
073263
073263
073263
*** ../vim-7.4.444/src/main.c	2014-09-09 17:47:34.584544079 +0200
073263
--- src/main.c	2014-09-19 13:38:29.802398710 +0200
073263
***************
073263
*** 958,965 ****
073263
--- 958,974 ----
073263
      if (p_im)
073263
  	need_start_insertmode = TRUE;
073263
  
073263
+ #ifdef FEAT_CLIPBOARD
073263
+     if (clip_unnamed)
073263
+        /* do not overwrite system clipboard while starting up */
073263
+        clip_did_set_selection = -1;
073263
+ #endif
073263
  #ifdef FEAT_AUTOCMD
073263
      apply_autocmds(EVENT_VIMENTER, NULL, NULL, FALSE, curbuf);
073263
+ # ifdef FEAT_CLIPBOARD
073263
+     if (clip_did_set_selection < 0)
073263
+        clip_did_set_selection = TRUE;
073263
+ # endif
073263
      TIME_MSG("VimEnter autocommands");
073263
  #endif
073263
  
073263
*** ../vim-7.4.444/src/ui.c	2014-08-06 18:17:03.475147780 +0200
073263
--- src/ui.c	2014-09-19 13:39:48.442398882 +0200
073263
***************
073263
*** 571,577 ****
073263
  {
073263
      clip_unnamed_saved = clip_unnamed;
073263
  
073263
!     if (clip_did_set_selection)
073263
      {
073263
  	clip_unnamed = FALSE;
073263
  	clip_did_set_selection = FALSE;
073263
--- 571,577 ----
073263
  {
073263
      clip_unnamed_saved = clip_unnamed;
073263
  
073263
!     if (clip_did_set_selection > 0)
073263
      {
073263
  	clip_unnamed = FALSE;
073263
  	clip_did_set_selection = FALSE;
073263
***************
073263
*** 584,590 ****
073263
      void
073263
  end_global_changes()
073263
  {
073263
!     if (!clip_did_set_selection)
073263
      {
073263
  	clip_did_set_selection = TRUE;
073263
  	clip_unnamed = clip_unnamed_saved;
073263
--- 584,590 ----
073263
      void
073263
  end_global_changes()
073263
  {
073263
!     if (clip_did_set_selection == FALSE)  /* not when -1 */
073263
      {
073263
  	clip_did_set_selection = TRUE;
073263
  	clip_unnamed = clip_unnamed_saved;
073263
*** ../vim-7.4.444/src/version.c	2014-09-15 14:25:51.309650006 +0200
073263
--- src/version.c	2014-09-19 13:35:30.618398318 +0200
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     445,
073263
  /**/
073263
073263
-- 
073263
hundred-and-one symptoms of being an internet addict:
073263
159. You get excited whenever discussing your hard drive.
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///