Loading ...
Sorry, an error occurred while loading the content.

RE: 'b:' variables still exist after buffer change

Expand Messages
  • Dave Silvia
    Bingo! I did a grep on unlet b:did_indent on my vim63 directory and found that indent.vim does an unlet before sourcing indent/ .vim. Mystery
    Message 1 of 10 , Jun 29, 2004
    • 0 Attachment
      Bingo! I did a grep on 'unlet b:did_indent' on my vim63 directory and found
      that indent.vim does an unlet before sourcing indent/<whatever>.vim.

      Mystery solved! Now I know I have to initialize my variables if I don't
      want them to compound.

      thx,
      Dave S.

      P.S. But _why_ does indent.vim do this? It seems contrary to the intent of
      b:did_intent.

      -----Original Message-----
      From: Benji Fisher [mailto:benji@...]
      Sent: Tuesday, June 29, 2004 7:11 PM
      To: vim@...
      Subject: Re: 'b:' variables still exist after buffer change


      Perhaps some autocommand or :source'd script is doing

      :unlet b:did_indent

      behind your back. Can you give a minimal example to reproduce the
      problem?

      HTH --Benji Fisher
    • Antoine J. Mechelynck
      ... I must have read too fast. Tony.
      Message 2 of 10 , Jun 30, 2004
      • 0 Attachment
        Dave Silvia <dsilvia@...> wrote:
        > Well, according to the help, exists() returns '0' if the variable is
        > undefined. In other words it does not 'exist', or so I understand.
        >
        > thx,
        > Dave S.

        I must have read too fast.

        Tony.
      • Benji Fisher
        I have not looked at how indent.vim works and why. I think the point of b:did_indent is so that you can use :runtime! (note the bang) and tell the default
        Message 3 of 10 , Jun 30, 2004
        • 0 Attachment
          I have not looked at how indent.vim works and why. I think the
          point of b:did_indent is so that you can use :runtime! (note the bang)
          and tell the default script to :finish . There also should be some
          mechanism for :source'ing a new indent script (and not have it
          immediately :finish ).

          It would be A Good Thing if someone wrote some docs for
          :help write-indent-plugin . As it stands, we have :help
          indent-expression and :help 30.3 , which refer to each other and do not
          say much more than "look at the examples."

          HTH --Benji Fisher

          On Tue, Jun 29, 2004 at 09:55:32PM -0500, Dave Silvia wrote:
          > Bingo! I did a grep on 'unlet b:did_indent' on my vim63 directory and found
          > that indent.vim does an unlet before sourcing indent/<whatever>.vim.
          >
          > Mystery solved! Now I know I have to initialize my variables if I don't
          > want them to compound.
          >
          > thx,
          > Dave S.
          >
          > P.S. But _why_ does indent.vim do this? It seems contrary to the intent of
          > b:did_intent.
          >
          > -----Original Message-----
          > From: Benji Fisher [mailto:benji@...]
          > Sent: Tuesday, June 29, 2004 7:11 PM
          > To: vim@...
          > Subject: Re: 'b:' variables still exist after buffer change
          >
          >
          > Perhaps some autocommand or :source'd script is doing
          >
          > :unlet b:did_indent
          >
          > behind your back. Can you give a minimal example to reproduce the
          > problem?
          >
          > HTH --Benji Fisher
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.