Community
    • 登入

    Collapse level 1 no longer collapses just functions

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    4 貼文 2 Posters 3.0k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Jeremy RichemontJ
      Jeremy Richemont
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • Claudia FrankC
        Claudia Frank @Jeremy Richemont
        最後由 編輯

        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 條回覆 最後回覆 回覆 引用 0
        • Jeremy RichemontJ
          Jeremy Richemont
          最後由 編輯

          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 條回覆 最後回覆 回覆 引用 0
          • Claudia FrankC
            Claudia Frank
            最後由 編輯

            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 條回覆 最後回覆 回覆 引用 0
            • 第一個貼文
              最後的貼文
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors