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

Re: Limiting ftplugins to relevant buffers

Expand Messages
  • Tony Mechelynck
    ... One possible way to do it to test for both already-loaded and user-disabled would be (near the start of the ftplugin) if exists
    Message 1 of 13 , Jan 22 6:04 PM
      On 22/01/13 22:48, Ben Fritz wrote:
      > On Tuesday, January 22, 2013 3:41:27 PM UTC-6, Ben Fritz wrote:
      >>
      >> I think the problem is actually here:
      >>
      >> if !exists('g:DisableCFE3KeywordAbbreviations')
      >> let g:DisableCFE3KeywordAbbreviations=1
      >> call EnableCFE3KeywordAbbreviations()
      >> endif
      >>
      >> That should be a buffer-local variable, not a global variable, otherwise the abbreviations will only load on the first buffer.
      >
      > Or if it's supposed to be a global disable, don't set it to true inside the plugin file; it would still be ok to check its existence.
      >
      One possible way to do it to test for both already-loaded and
      user-disabled would be (near the start of the ftplugin)

      if exists ('g:DisableCFE3KeywordAbbreviations') ||
      exists('b:DisableCFE3KeywordAbbreviations')
      finish
      endif
      let b:DisableCFE3KeywordAbbreviations = 1


      Best regards,
      Tony.
      --
      Children seldom misquote you. In fact, they usually repeat word for
      word what you shouldn't have said.

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • neilhwatson@...
      Thanks for the help everyone. I think I have it sorted out. -- You received this message from the vim_use maillist. Do not top-post! Type your reply below
      Message 2 of 13 , Jan 23 6:23 AM
        Thanks for the help everyone. I think I have it sorted out.

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.