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

[patch] Unclosable fold

Expand Messages
  • Lech Lorens
    It is possible to create an unclosable fold. By executing the following commands in a new instance of vim: set fdc=5 fdm=marker fmr={{{,}}} fml=1 normal isome
    Message 1 of 2 , Nov 2, 2009
    • 0 Attachment
      It is possible to create an unclosable fold.

      By executing the following commands in a new instance of vim:
      set fdc=5 fdm=marker fmr={{{,}}} fml=1
      normal isome text
      normal yy10gp
      normal osmall fold {{{
      normal ggOlarge fold {{{
      5
      normal oanother large fold {{{1

      You create 2 top-level folds and one small subfold of the second
      top-level one. Note that the order in which the folds are created is
      essential to reproduce the problem. The second of the top-level folds
      cannot be closed with any command.

      The reason of this wrong behaviour is the use of an uninitialised
      variable - in foldSplit() the field fd_small of the newly created fold
      is not initialised to any value, while in fact it should be initialised
      to MAYBE.

      The attached patch fixes the problem.

      --
      Cheers,
      Lech

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... Great, thanks. I m really happy to see so many patches these days! I should have time tomorrow to verify and include them. -- LAUNCELOT: Isn t there a St.
      Message 2 of 2 , Nov 2, 2009
      • 0 Attachment
        Lech Lorens wrote:

        > It is possible to create an unclosable fold.
        >
        > By executing the following commands in a new instance of vim:
        > set fdc=5 fdm=marker fmr={{{,}}} fml=1
        > normal isome text
        > normal yy10gp
        > normal osmall fold {{{
        > normal ggOlarge fold {{{
        > 5
        > normal oanother large fold {{{1
        >
        > You create 2 top-level folds and one small subfold of the second
        > top-level one. Note that the order in which the folds are created is
        > essential to reproduce the problem. The second of the top-level folds
        > cannot be closed with any command.
        >
        > The reason of this wrong behaviour is the use of an uninitialised
        > variable - in foldSplit() the field fd_small of the newly created fold
        > is not initialised to any value, while in fact it should be initialised
        > to MAYBE.
        >
        > The attached patch fixes the problem.

        Great, thanks.

        I'm really happy to see so many patches these days!
        I should have time tomorrow to verify and include them.

        --
        LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
        ARTHUR: No, that's Saint Ives.
        "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.