vim-markdown-preview icon indicating copy to clipboard operation
vim-markdown-preview copied to clipboard

New tab opened if a different tab is active in the browser

Open shubhamshuklaer opened this issue 9 years ago • 6 comments
trafficstars

Can you please add this info somewhere that if a tab other than vim-markdown-preview.html is active(maybe the wrong word) in the browser, then xdotool won't be able to find the browser window and the plugin will open a new tab. It might confuse some people(including me) wondering why are multiple tabs opening sometimes.

shubhamshuklaer avatar Apr 15 '16 17:04 shubhamshuklaer

The main reason this plugin uses xdotool is for that exact reason :smile:. If you have the html rendered version of your markdown file in your browser, xdotool will refresh that tab and make it active, regardless of that tab's previous status (active or in the background).

Thus, your post sounds like a bug. Can you post the details of your environment (OS, browser, vim version, plugin options, etc)?

JamshedVesuna avatar Apr 15 '16 17:04 JamshedVesuna

xdotool search --name will search with the window name. At least in google chrome the window name is "Active Tab title - Google Chrome". So if some other tab is active, it will be unable to find the browser window.

shubhamshuklaer avatar Apr 15 '16 18:04 shubhamshuklaer

For example If I have 2 tabs opened in google chrome, facebook and gmail. If gmail tab is the one focused/active and then xdotool search --name facebook does not return anything. When facebook tab is focused/active the search is a success.

shubhamshuklaer avatar Apr 15 '16 18:04 shubhamshuklaer

By the way if its some bug.. then my environment is Os: Arch linux Window manager: xmonad xdotool version 3.20150503.1 Browser version: Google chrome Version 50.0.2661.75 (64-bit) Neovim version: NVIM 0.1.3 Plugin version: Latest git version as of 15th April 2016 Plugin options: let vim_markdown_preview_toggle=0 let vim_markdown_preview_use_xdg_open=1 Steps to reproduce: After the html is rendered once, change the active tab and then render again, it will open a new tab.

P.S Thanks for the awesome plugin.

shubhamshuklaer avatar Apr 15 '16 18:04 shubhamshuklaer

Any progress on this one? I have the same issue with Google Chrome latest stable, Vim 8 and Elementary OS 0.4.

hholst80 avatar Nov 11 '16 21:11 hholst80

+1 same issue

bryden avatar Aug 01 '17 19:08 bryden