Mark S. Williams wrote:
I think I've uncovered an odd bug involving Netrw and the cindent local buffer option for Java files, where cindent is unset under certain conditions.

To track down the bug I removed all my Java file type plugins and created a new Java file type plugin called java.vim which contains only the following:

if exists("b:did_java_vim")
  finish
endif
let b:did_java_vim = 1
setlocal cindent


There are two scenarios that can reproduce the bug:

Scenario #1
-----------
1. Start vim in a dir with Foo.java
2. :E and select Foo.java
3. :setl  cindent is set.
4. :E and select Foo.java again.
5. :setl and cindent is not set.

Scenario #2
-----------
1. Start vim in a dir with Foo.java and Bar.java
2. :E and select Foo.java
3. :setl  cindent is set.
4. :E and select Bar.java
5. :setl  cindent is set.
6. :2b to return to Foo.java
7. :setl and cindent is not set.

It seems the the bug involves Netrw, I can't reproduce it when I open files with :e.

Quite a puzzler. Can anyone else reproduce this one?

Thanks in advance,
-Mark



To check which script last set the option, use ":verbose setl cindent?" (without quotes, but with the question mark). If it does mention netrw, check near the top of the netrw script which version of netrw you're running. You may be able to obtain a newer version from vim-online or from Dr. Chip's site.


Best regards,
Tony.

Reply via email to