From 714db3bb819bb7f9f52270f2352b274bba3a9ff4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 19 Sep 2014 13:46:52 +0200 Subject: updated for version 7.4.445 Problem: Clipboard may be cleared on startup. Solution: Set clip_did_set_selection to -1 during startup. (Christian Brabandt) --- src/main.c | 9 +++++++++ src/ui.c | 4 ++-- src/version.c | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 73f6697ac..fe7549582 100644 --- a/src/main.c +++ b/src/main.c @@ -958,8 +958,17 @@ vim_main2(int argc UNUSED, char **argv UNUSED) if (p_im) need_start_insertmode = TRUE; +#ifdef FEAT_CLIPBOARD + if (clip_unnamed) + /* do not overwrite system clipboard while starting up */ + clip_did_set_selection = -1; +#endif #ifdef FEAT_AUTOCMD apply_autocmds(EVENT_VIMENTER, NULL, NULL, FALSE, curbuf); +# ifdef FEAT_CLIPBOARD + if (clip_did_set_selection < 0) + clip_did_set_selection = TRUE; +# endif TIME_MSG("VimEnter autocommands"); #endif diff --git a/src/ui.c b/src/ui.c index 21d92f0b7..b268cd78d 100644 --- a/src/ui.c +++ b/src/ui.c @@ -571,7 +571,7 @@ start_global_changes() { clip_unnamed_saved = clip_unnamed; - if (clip_did_set_selection) + if (clip_did_set_selection > 0) { clip_unnamed = FALSE; clip_did_set_selection = FALSE; @@ -584,7 +584,7 @@ start_global_changes() void end_global_changes() { - if (!clip_did_set_selection) + if (clip_did_set_selection == FALSE) /* not when -1 */ { clip_did_set_selection = TRUE; clip_unnamed = clip_unnamed_saved; diff --git a/src/version.c b/src/version.c index a66046a21..adff6dbd0 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 445, /**/ 444, /**/ -- cgit v1.2.1