lalitmetkar / vim

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

netrw breaks scripts.vim #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have vim installed, have openssh-server installed and running
2. create a ruby script ~/foo with the following shebang line
#!/usr/bin/env ruby

3. in vim, execute:
:e scp://localhost/~/foo
after file is loaded, check:
:set filetype?

What is the expected output? What do you see instead?
expected:
filetype=ruby
actual:
filetype=conf

What version of the product are you using? On what operating system?
7.3.390 on Linux

Please provide any additional information below.
netrw saves vim options in netrw#NetRead, modifies them, then fetches the file, 
detect file types, and restore options.
The modified options include iskeyword, where the slash character is added
this causes scripts.vim (invoked during s:NetrwGetFile in netrw.vim by 
"filetype detect") to fail to detect "env" shebang lines correctly due to the 
changed meaning of \<

Original issue reported on code.google.com by sbje...@gmail.com on 24 Mar 2012 at 12:06

GoogleCodeExporter commented 9 years ago
Hello!

I don't see this with the latest netrw version (v144d).  Please try it --
http://www.drchip.org/astronaut/vim/index.html#NETRW

Regards,
Chip Campbell

Original comment by drc...@campbellfamily.biz on 26 Mar 2012 at 1:57

GoogleCodeExporter commented 9 years ago
hi dr campbell, i am still seeing this. did you created ~/foo not ~/foo.rb? for 
files with suffixes, autocommands work, but for those without, the iskeyword 
options must not contain "/", which is added by netrw before restoring it

Original comment by sbje...@gmail.com on 27 Mar 2012 at 5:57

GoogleCodeExporter commented 9 years ago
Hello -- well, I'd called it "junk" rather than "foo", but there was no suffix.
However: the top line was "#! /usr/bin/ruby".  Hewing more closely to your 
stated problem, and using "#! /usr/bin/env ruby" instead, I do end up with a 
filetype of conf instead of ruby.  Looks like your diagnosis was correct, too.
Please try v144e of netrw 
(http://www.drchip.org/astronaut/vim/index.html#NETRW).

Original comment by drc...@campbellfamily.biz on 28 Mar 2012 at 12:37

GoogleCodeExporter commented 9 years ago
hi dr campbell, i am still seeing the previous version on your homepage. do you 
have a repository (like git) that i can follow and submit patches?

Original comment by sbje...@gmail.com on 28 Mar 2012 at 2:26

GoogleCodeExporter commented 9 years ago
No, I don't have such a repository.  Just email patches to me (edit netrw and 
see my email address near the top).

Original comment by drc...@campbellfamily.biz on 11 Feb 2013 at 8:57

GoogleCodeExporter commented 9 years ago
I believe this problem was fixed awhile back.

Original comment by drc...@campbellfamily.biz on 9 Nov 2013 at 5:35