Community
    • Login

    Collapse level 1 no longer collapses just functions

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 2.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Jeremy RichemontJ
      Jeremy Richemont
      last edited by

      Hi. This is a very useful feature that allowed me to see just function names and expand just those I was working on. However; I have discovered that it does not like commented out functions. It seems to get confused, leaves the commented out function unfolded and starts folding if statements for the remainder of the file.

      Example (apologies for lack of indentation; it gets stripped):

      static f1() {
      blah;
      }

      //static int f2() {
      // blah;
      //}

      static int f3() {
      if (test) {
      blah;
      }
      }

      if you collapse level 1 on that you get:

      static int f1() { // folded correctly
      }

      //static int f2() { // ignored
      // blah;
      //}

      static int f3() { // not folded but the ‘if’ inside is.
      if (test) {
      }
      }

      I have probably just not noticed this behaviour before but it doesn’t seem right to me…

      Any ideas?

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @Jeremy Richemont
        last edited by

        Hello @Jeremy-Richemont,

        afaik this is a feature which comes from the lexer (scintilla)
        because when I use your code and choose python lexer it works correctly.
        If C/C++ lexer is used it behaves like you reported.
        Those lexers are part from the underlying scintilla component.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Jeremy RichemontJ
          Jeremy Richemont
          last edited by

          Hi Claudia. So this is something I’ll just have to live with unless someone fancies fixing the underlying component notepad++ is based on, right? Ah well. I will just have to make all my functions useful and not comment any out, then!

          Cheers;
          Jeremy

          1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank
            last edited by

            Hi Jeremy,

            So this is something I’ll just have to live with unless someone fancies fixing the underlying component notepad++ is based on, right?

            I’m afraid, yes.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors