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

Re: [bindu@wavell.net: Technical Questions]

Expand Messages
  • Bram Moolenaar
    ... I thought that using the BufEnter event would work well. Perhaps also combined with BufReadPost, then you add the buffer name only when a file is loaded
    Message 1 of 4 , Oct 8, 2002
      Bindu Wavell wrote:

      > The todo_flag would work if there were a good way to evaluate the flag at a
      > later time. Doing it manually is not an option (since I can do that already
      > and folks would really like an automated option.)

      I thought that using the BufEnter event would work well. Perhaps also
      combined with BufReadPost, then you add the buffer name only when a file
      is loaded in a buffer. It wouldn't work for creating a new file though.

      > The way my code works now it will display the explorer buffer in the buffer
      > list, and then if the buffer list is updated in the future (after
      > &nomodifiable is set for example) the explorer will be removed from the
      > buffer list. The trick would be to come up with a way to automatically fire
      > a function at some point in the future (like a second or two).
      >
      > Here is a thought. I could write a function (in the form of a plugin/macro)
      > and get all explorer developers to use it right after creating their
      > explorer buffers. The function would do the regular stuff about setting
      > &buftype=nofile and &modifiable=false etc. It would also set a buffer
      > variable isExplorer="name of explorer"... It would then cause a user autocmd
      > to be fired. Folks that want to detect explorers could listen for the
      > autocmd.
      >
      > I think this would work with the existing functionality, but it's still not
      > totally correct (in that it would be ideal to have someway to create a
      > buffer that is flagged as an explorer before any autocmds fire). Would you
      > be willing to include a patch to explorer.vim that uses this? Would you be
      > willing to include said function in future relases of VIM?

      I think it's better for plugins not to depend on changes in other
      plugins. If there is no other way OK, but I still think you should be
      able to make it work properly without changing other plugins or changes
      to Vim.

      --
      "Hit any key to continue" does _not_ mean you can hit the on/off button!

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
      \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
      \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.