Only part of a full URL is opened
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.
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
@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.vimwith 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.mdwith the above URL. The content intest.md:
http://rrc.cvc.uab.es/?ch=2&com=tasks#WordRecognition
- Open
test.mdwith 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.
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
Thanks for the info. I'll look into this.