From 09d0ac03471db4b8b69c9d8b2dab83548e9b9c3c Mon Sep 17 00:00:00 2001
From: Junegunn Choi <junegunn.c@gmail.com>
Date: Fri, 24 Apr 2015 12:45:39 +0900
Subject: [PATCH] [vim] Update default launcher for GVim (#212)

Code submitted by @lydell
---
 plugin/fzf.vim | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index 8301cb93..85f576d9 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -22,7 +22,6 @@
 " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 let s:default_height = '40%'
-let s:launcher = 'xterm -e bash -ic %s'
 let s:fzf_go = expand('<sfile>:h:h').'/bin/fzf'
 let s:install = expand('<sfile>:h:h').'/install'
 let s:installed = 0
@@ -202,6 +201,15 @@ function! s:popd(dict)
   endif
 endfunction
 
+function! s:xterm_launcher()
+  return printf('xterm -T [fzf]'
+    \ .' -bg "\%s" -fg "\%s"'
+    \ .' -geometry %dx%d+%d+%d -e bash -ic %%s',
+    \ synIDattr(hlID("Normal"), "bg"), synIDattr(hlID("Normal"), "fg"),
+    \ &columns, &lines/2, getwinposx(), getwinposy())
+endfunction
+let s:launcher = function('s:xterm_launcher')
+
 function! s:execute(dict, command, temps)
   call s:pushd(a:dict)
   silent! !clear 2> /dev/null
-- 
GitLab