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

32317RE: bug in explicit :setf behavior?

Expand Messages
  • Bram Moolenaar
    May 1, 2003
    • 0 Attachment
      Vince Negri wrote:

      > > Essentially, one can do any number of explicit
      > > :setf somefiletype's after the initial filetype setting, but only
      > > the first existing
      > > ftplugin/somefiletype.vim
      > > indent/somefiletype.vim
      > > take effect.
      > If you look at how the ftplugins work, you will
      > see why there is this limitation. The plugins
      > are written to assert their settings over a
      > blank canvas, and won't necessarily remove
      > the settings of a previous ftplugin. Thus, if
      > the second ftplugin was allowed to run, you
      > would get a mixture of settings.

      True, but not providing the possibility to load another filetype plugin
      isn't nice either. Currently you would have to do ":bwipe" and edit the
      file again (making sure the right filetype is used this time).

      > 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?

      hundred-and-one symptoms of being an internet addict:
      129. You cancel your newspaper subscription.

      /// 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 ///
      \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
    • Show all 17 messages in this topic