jeromejj / vim

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

vimscript split() doesn't match dots #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. executing ':echo split("one.two", "\V.")'

What is the expected output? What do you see instead?
I would expect the command to return ['one','two'], however, it returns 
['one.two']

What version of the product are you using? On what operating system?
:version                                                                        

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct  2 2013 15:36:45)              

Included patches: 1-50                                                          

Compiled by <volkerdi@slackware.com>
On Slackware64 14.1

Original issue reported on code.google.com by juliangr...@gmail.com on 12 Jan 2014 at 5:52

GoogleCodeExporter commented 9 years ago
This is not a Vim issue. You're using a backslash inside double quotes, so 
you'd need to escape the backslash. Or, change the double quotes to single. All 
these work fine for me:

:echo split("one.two", '\V.')
:echo split("one.two", '\.')
:echo split("one.two", "\\V.")

Original comment by fritzoph...@gmail.com on 12 Jan 2014 at 6:11

GoogleCodeExporter commented 9 years ago
oh god, I'm so sorry, I could swear I tried all the variants possible. 
Escaping, single quotes, double quotes, magic, no magic.... . Yeah, it works 
great, I just made a derp. Thank you very much!

Original comment by juliangr...@gmail.com on 12 Jan 2014 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by brammool...@gmail.com on 12 Jan 2014 at 12:07