From ecf29f3fdabced25fed2b5fc3540158497762849 Mon Sep 17 00:00:00 2001 From: Jamshed Vesuna Date: Thu, 30 Oct 2014 19:50:08 -0700 Subject: [PATCH] Fixed background bug via longer delay and background process. Closes #2 --- plugin/vim-markdown-preview.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/vim-markdown-preview.vim b/plugin/vim-markdown-preview.vim index 2cf0099..1fe8213 100644 --- a/plugin/vim-markdown-preview.vim +++ b/plugin/vim-markdown-preview.vim @@ -7,9 +7,9 @@ function! Vim_Markdown_Preview() let curr_file = expand('%:t') call system('markdown ' . curr_file . ' > /tmp/vim-markdown-preview.html') let chrome_wid = system("xdotool search --name 'vim-markdown-preview.html - Google Chrome'") - sleep 300m if !chrome_wid - call system('see -g /tmp/vim-markdown-preview.html') + sleep 300m + call system('see /tmp/vim-markdown-preview.html & > /dev/null &') else let curr_wid = system('xdotool getwindowfocus') call system('xdotool windowmap ' . chrome_wid) @@ -17,7 +17,7 @@ function! Vim_Markdown_Preview() call system("xdotool key 'ctrl+r'") call system('xdotool windowactivate ' . curr_wid) endif - sleep 31m + sleep 700m call system('rm /tmp/vim-markdown-preview.html') endfunction -- 2.45.2