sunnyranjan12 / vim

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

Netrw v145: '/' character in 'is keyword' leaks into new buffers #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Edit a file in Vim over FTP using Netrw.
2. Subsequently created buffers have the '/' character as part of the 'is 
keyword' string, This messes with syntax highlighting and indentation of 
various files (e.g. HTML, XML etc.). 

What is the expected output? What do you see instead?

The global value of 'is keyword' should *not* be updated.

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

Netrw v145

Please provide any additional information below.

I attach a patch which fixes the issue for me. It would appear that some file 
detection code added in v145 modifies the global value of 'iso' instead of the 
local value. The patch also corrects a missing ')' in the netrw#NetRead 
function and removes an extraneous 'endif'.

Original issue reported on code.google.com by Michael....@gmail.com on 11 Apr 2012 at 5:54

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, that 'iso' above should read: 'isk'

Original comment by Michael....@gmail.com on 11 Apr 2012 at 5:56

GoogleCodeExporter commented 9 years ago
I tried the given steps with v146d and did not observe the issue.

iskeyword is supposed to be local-to-buffer, but apparently new buffers 
subsequently edited in the stead of the buffer appear inherit that buffer's 
iskeyword setting (unless modified otherwise, presumably).  I'll change that.

I will also include the missing parenthesis.

The extra "endif" had been elided already.

I need to test some other changes (supporting Windows) before releasing v146e, 
but probably won't be able to get to doing this until this weekend (Apr 14,15).

Original comment by drc...@campbellfamily.biz on 11 Apr 2012 at 6:59

GoogleCodeExporter commented 9 years ago
Hi, thanks for the response.

In terms of reproducing the problem, I think you may have to browse a directory 
using Netrw first. I can reproduce consistently, using FTP at least.

In terms of 'is keyword' being buffer-local - it is, but it is initialised from 
the global value. Vim's help says:

"When editing a new buffer, its local option values must be initialized.  Since
the local options of the current buffer might be specifically for that buffer,
these are not used.  Instead, for each buffer-local option there also is a
global value, which is used for new buffers.  With ":set" both the local and
global value is changed.  With "setlocal" only the local value is changed,
thus this value is not used when editing a new buffer."

Original comment by Michael....@gmail.com on 11 Apr 2012 at 8:11

GoogleCodeExporter commented 9 years ago
This issue appears to have been fixed awhile back, so I'm closing it as fixed.  
FYI: see http://www.drchip.org/astronaut/vim/index.html#NETRW if you wish to 
have the latest (albeit experimental) version of netrw.

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