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

32318Re: bug in explicit :setf behavior?

Expand Messages
  • Dorai Sitaram
    May 1, 2003
    • 0 Attachment
      Bram wrote:
      >
      > Vince Negri wrote:
      >
      > > To remove this problem, each ftplugin script
      > > would have to provide an "uninstall" function
      > > which could be first called by the :setf command
      > > if it detected there was an already loaded
      > > filetype.
      >
      > That might not be a bad idea. How to implement this? We should at
      > least make sure that old filetype plugins still work. Thus new filetype
      > plugins must provide their "uninstall" function somehow. Perhaps simply
      > by providing an "s:uninstall()" function?

      Ability to do :setlocal all< would be a lifesaver.
      Once that's in, changing the definition of

      :setf {filetype}

      to be something like

      :if !did_filetype()
      : if exists("b:did_ftplugin")
      : unlet b:did_ftplugin
      : endif
      : if exists("b:did_indent")
      : unlet b:did_indent
      : endif
      : setlocal all<
      : setlocal filetype={filetype}
      :endif

      should all be all that's needed. The old plugin
      files wouldn't need to be changed. (If they introduced
      let variables and function definitions, those would
      stay across filetype changes for the same buffer, but
      perhaps that's harmless?)
    • Show all 17 messages in this topic