Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shubhamshuklaer opened this issue Apr 15, 2016 · 6 comments
Open

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

shubhamshuklaer opened this issue Apr 15, 2016 · 6 comments

Comments

@shubhamshuklaer
Copy link

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.

@JamshedVesuna
Copy link
Owner

The main reason this plugin uses xdotool is for that exact reason 😄. 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)?

@shubhamshuklaer
Copy link
Author

shubhamshuklaer commented Apr 15, 2016

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
Copy link
Author

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
Copy link
Author

shubhamshuklaer commented Apr 15, 2016

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.

@hholst80
Copy link

hholst80 commented Nov 11, 2016

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

@bryden
Copy link

bryden commented Aug 1, 2017

+1 same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants