Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions plugin/vim-markdown-preview.vim
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function! Vim_Markdown_Preview()
elseif g:vim_markdown_preview_perl == 1
call system('Markdown.pl "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
elseif g:vim_markdown_preview_pandoc == 1
call system('pandoc --smart --standalone "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
call system('pandoc --standalone "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
else
call system('markdown "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
endif
Expand All @@ -75,7 +75,12 @@ function! Vim_Markdown_Preview()
endif

if g:vmp_osname == 'unix'
let chrome_wid = system("xdotool search --name 'vim-markdown-preview.html - " . g:vim_markdown_preview_browser . "'")
if g:vim_markdown_preview_browser == "Firefox Quantum"
let chrome_wid = system("xdotool search --name '" . expand('%:t:r') . " - Mozilla Firefox'")
else
let chrome_wid = system("xdotool search --name 'vim-markdown-preview.html - " . g:vim_markdown_preview_browser . "'")
endif

if !chrome_wid
if g:vim_markdown_preview_use_xdg_open == 1
call system('xdg-open /tmp/vim-markdown-preview.html 1>/dev/null 2>/dev/null &')
Expand Down Expand Up @@ -120,7 +125,7 @@ function! Vim_Markdown_Preview_Local()
elseif g:vim_markdown_preview_perl == 1
call system('Markdown.pl "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
elseif g:vim_markdown_preview_pandoc == 1
call system('pandoc --smart --standalone "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
call system('pandoc --standalone "' . b:curr_file . '" > /tmp/vim-markdown-preview.html')
else
call system('markdown "' . b:curr_file . '" > vim-markdown-preview.html')
endif
Expand Down