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

Re: Does b:undo_ftplugin actually work?

Expand Messages
  • Christian Brabandt
    Hi Bram! ... Unfortunately, that doesn t work. --git a/src/buffer.c b/src/buffer.c ... +++ b/src/buffer.c @@ -1703,6 +1703,7 @@ /* buf- b_nwindows = 0; why was
    Message 1 of 23 , Nov 16, 2012
    • 0 Attachment
      Hi Bram!

      On Do, 15 Nov 2012, Bram Moolenaar wrote:

      > I finally had time to look into this patch. It breaks the tests in a
      > nasty way. Thus this is not the right solution. Instead of freeing the
      > options they should be initialized to the global values.
      > Perhaps setting buf->b_p_initialized to FALSE works?

      Unfortunately, that doesn't work.

      --git a/src/buffer.c b/src/buffer.c
      --- a/src/buffer.c
      +++ b/src/buffer.c
      @@ -1703,6 +1703,7 @@
      /* buf->b_nwindows = 0; why was this here? */
      free_buffer_stuff(buf, FALSE); /* delete local variables et al. */
      buf->b_p_initialized = FALSE;
      + buf_copy_options(buf, BCO_ENTER);
      #ifdef FEAT_KEYMAP
      /* need to reload lmaps and set b:keymap_name */
      curbuf->b_kmap_state |= KEYMAP_INIT;

      This also seems to work.


      regards,
      Christian
      --
      Besser schweigen und als Narr scheinen, als sprechen und jeden Zweifel
      beseitigen.
      -- Abraham Lincoln

      --
      You received this message from the "vim_dev" 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
    • Bram Moolenaar
      ... I ll try it out. Why BCO_ENTER and not BCO_ALWAYS, as it s used in the else part? -- If you put 7 of the most talented OSS developers in a room for a
      Message 2 of 23 , Nov 17, 2012
      • 0 Attachment
        Christian Brabandt wrote:

        > On Do, 15 Nov 2012, Bram Moolenaar wrote:
        >
        > > I finally had time to look into this patch. It breaks the tests in a
        > > nasty way. Thus this is not the right solution. Instead of freeing the
        > > options they should be initialized to the global values.
        > > Perhaps setting buf->b_p_initialized to FALSE works?
        >
        > Unfortunately, that doesn't work.
        >
        > --git a/src/buffer.c b/src/buffer.c
        > --- a/src/buffer.c
        > +++ b/src/buffer.c
        > @@ -1703,6 +1703,7 @@
        > /* buf->b_nwindows = 0; why was this here? */
        > free_buffer_stuff(buf, FALSE); /* delete local variables et al. */
        > buf->b_p_initialized = FALSE;
        > + buf_copy_options(buf, BCO_ENTER);
        > #ifdef FEAT_KEYMAP
        > /* need to reload lmaps and set b:keymap_name */
        > curbuf->b_kmap_state |= KEYMAP_INIT;
        >
        > This also seems to work.

        I'll try it out. Why BCO_ENTER and not BCO_ALWAYS, as it's used in the
        "else" part?

        --
        If you put 7 of the most talented OSS developers in a room for a week
        and asked them to fix a bug in a spreadsheet program, in 1 week
        you'd have 2 new mail readers and a text-based web browser.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" 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.