dynium / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

Windows: If file name on command line starts with space, preceding backslash is lost #371

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a file named " testfile.txt" (leading space).
2. Start Vim and pass the file name on the command line, including at least one
   parent directory (i.e. gvim.exe "test\ testfile.txt")

What is the expected output? What do you see instead?
I would expect Vim to open the file. Instead, it swallows the backslash before 
the space and opens "test testfile.txt" as a new file.

What version of the product are you using? On what operating system?
7.4.711 (Cream vanilla), Windows 8.1

Please provide any additional information below.
The same effect occurs when using the shell context menu. The bug is in Vim, 
see below:

C:\test>py -3 -c "import sys; print(str(sys.argv))" "test\ testfile.txt"
['-c', 'test\\ testfile.txt']

Python does not lose the backslash.

Original issue reported on code.google.com by ch...@chrullrich.net on 11 Jun 2015 at 8:35

GoogleCodeExporter commented 9 years ago
Same behavior with 7.4.729 (tuxproject.de).

Original comment by ch...@chrullrich.net on 11 Jun 2015 at 9:11

GoogleCodeExporter commented 9 years ago
works with gvim "test/\ testfile.txt"

Original comment by chrisbr...@googlemail.com on 11 Jun 2015 at 9:55

GoogleCodeExporter commented 9 years ago
Looks like a decent workaround...but it shouldn't be needed, since Vim 
supposedly has Windows support and Windows mostly uses \ for native path 
separator.

Original comment by fritzoph...@gmail.com on 11 Jun 2015 at 2:38

GoogleCodeExporter commented 9 years ago
It's not a workaround, decent or not. I don't think it was meant as one, either.

The main impact of this bug is that it breaks opening files from the shell 
context menu, because you can't influence the path that Explorer passes to Vim 
in that case.

With tab completion in a command prompt window, it is nearly as bad, but at 
least there I could fix up the path to make Vim understand it before I run it.

Original comment by ch...@chrullrich.net on 11 Jun 2015 at 2:45