From 1890ad1a1dfa976220028b9876b1af3fbcf9ba34 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Wed, 13 Feb 2008 17:54:20 +0100 Subject: [PATCH] Fix Find Pasteboard bugs As a temporary precaution, the Find Pasteboard is not used during a fork since this caused the entire machine to lock up. Also, only patterns from a search (/ and ?) are added to the pboard; not patterns from a substitution (:s). --- src/MacVim/gui_macvim.m | 3 +++ src/search.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MacVim/gui_macvim.m b/src/MacVim/gui_macvim.m index 2e878268..7e1afa16 100644 --- a/src/MacVim/gui_macvim.m +++ b/src/MacVim/gui_macvim.m @@ -1527,6 +1527,9 @@ gui_macvim_add_to_find_pboard(char_u *pat) { if (!pat) return; + // HACK: Do not call Cocoa during a fork or bad things (TM) will happen. + if (gui.dofork) return; + #ifdef FEAT_MBYTE pat = CONVERT_TO_UTF8(pat); #endif diff --git a/src/search.c b/src/search.c index 73de100b..50d88ed7 100644 --- a/src/search.c +++ b/src/search.c @@ -280,7 +280,8 @@ save_re_pat(idx, pat, magic) if (spats[idx].pat != pat) { #if FEAT_GUI_MACVIM - gui_macvim_add_to_find_pboard(pat); + if (RE_SEARCH == idx) + gui_macvim_add_to_find_pboard(pat); #endif vim_free(spats[idx].pat); spats[idx].pat = vim_strsave(pat); @@ -426,7 +427,8 @@ set_last_search_pat(s, idx, magic, setlast) int setlast; { #if FEAT_GUI_MACVIM - gui_macvim_add_to_find_pboard(s); + if (RE_SEARCH == idx) + gui_macvim_add_to_find_pboard(s); #endif vim_free(spats[idx].pat); -- 2.11.4.GIT