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

Only part of a full URL is opened #120

Open
jdhao opened this issue Jul 23, 2019 · 4 comments
Open

Only part of a full URL is opened #120

jdhao opened this issue Jul 23, 2019 · 4 comments

Comments

@jdhao
Copy link

jdhao commented Jul 23, 2019

Hi, this is a great plugin which works both on Windows and Mac. I have found that for some URL, only part of the URL is opened in the browser. For example, for URL http://rrc.cvc.uab.es/?ch=2&com=tasks#WordRecognition, when I use this plugin to open it in the browser, only http://rrc.cvc.uab.es/?ch=2 is opened.

@tyru
Copy link
Owner

tyru commented Mar 10, 2020

I couldn't reproduce this on macOS.
If this problem still persists, please tell me

  • Vim version
  • OS (and it's version)
  • Minimal steps to reproduce

@jdhao
Copy link
Author

jdhao commented Mar 10, 2020

@tyru This problem still persists. Version info:

  • Neovim: 0.5.0 (any version above 0.4.0 should reproduce)
  • OS: Windows 10 1803

Minimal step to reproduce:

  • Create file init.vim with the following minimal setting:
set runtimepath=C:\Users\Administrator\AppData\Local\nvim-data\plugged\open-browser.vim,$VIMRUNTIME
nmap ob <Plug>(openbrowser-smart-search)
  • Create a file test.md with the above URL. The content in test.md:
http://rrc.cvc.uab.es/?ch=2&com=tasks#WordRecognition
  • Open test.md with the following command:
nvim -u init.vim test.md
  • Move the cursor to the URL and press ob.

Result: only http://rrc.cvc.uab.es/?ch=2 is opened in the browser.

BTW: my default browser is Chrome. I am not sure if this is relevant.

@jdhao
Copy link
Author

jdhao commented Mar 10, 2020

It seems that it is a problem with Windows system, not related to this plugin. If we run the following following command directly from the command line:

chrome.exe http://rrc.cvc.uab.es/?ch=2&com=tasks#WordRecognition

The same issue occurs. According to here, & has special meanings on Windows. We have to quote the whole URL or use ^ to escape special characters. Both the following two commands works:

chrome.exe "http://rrc.cvc.uab.es/?ch=2&com=tasks#WordRecognition"
chrome.exe http://rrc.cvc.uab.es/?ch=2^&com=tasks#WordRecognition

@tyru
Copy link
Owner

tyru commented Mar 10, 2020

Thanks for the info.
I'll look into this.

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

2 participants