Community
    • 登入

    How to make a comments area and minimize it?

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

      In earlier versions I wrote something like this:

      //{
      $a = true;
      //}

      And then I was able to minimize whole code between //{ and //} just like it was a { } block.
      How to get this feature now? It’s VERY nice feature.

      Claudia FrankC 1 條回覆 最後回覆 回覆 引用 0
      • Claudia FrankC
        Claudia Frank @Artem Romanko
        最後由 編輯

        Hello@Artem–Romanko,

        I assume you are talking about folding and this depends on the language you selected.
        By the given example and a selected language c++, it would be possible to fold the comment.

        Cheers
        Claudia

        1 條回覆 最後回覆 回覆 引用 0
        • Artem  RomankoA
          Artem Romanko
          最後由 編輯

          How to bring folding to php? What I need to change?

          1 條回覆 最後回覆 回覆 引用 0
          • Claudia FrankC
            Claudia Frank
            最後由 編輯

            This is part of the lexer, so it seems that php lexer doesn’t have this functionality or
            it was disabled by the lexer. Did you ever use this functionality with php?
            If so, in which npp version?

            Cheers
            Claudia

            1 條回覆 最後回覆 回覆 引用 0
            • Artem  RomankoA
              Artem Romanko
              最後由 編輯

              I don’t remember. But maybe is there any way to make it work.
              Just noticed that “case - break” cannot be folded too. Sad.

              1 條回覆 最後回覆 回覆 引用 0
              • Claudia FrankC
                Claudia Frank
                最後由 編輯

                As php lexer is based on html lexer I tried

                //{<>
                    $a = true;
                //}</>
                

                which seems to work.
                Don’t know if this is ok for you?

                Cheers
                Claudia

                1 條回覆 最後回覆 回覆 引用 0
                • Artem  RomankoA
                  Artem Romanko
                  最後由 編輯

                  v 6.9
                  No this doesn’t work

                  1 條回覆 最後回覆 回覆 引用 0
                  • Claudia FrankC
                    Claudia Frank
                    最後由 Claudia Frank 編輯

                    What excatly do you mean by

                    No this doesn’t work

                    No = this is working but not a solution for me or
                    No = this doesn’t work in npp

                    If latter is the case, it is working

                    Image Alt

                    Cheers
                    Claudia

                    1 條回覆 最後回覆 回覆 引用 0
                    • Artem  RomankoA
                      Artem Romanko
                      最後由 Artem Romanko 編輯

                      Sorry, but you’re doing this in the wrong way.
                      In PHP file construction that you wrote leads to displaying this in the browser:
                      //{<>
                      $a = true;
                      //</>
                      This is NOT the comments.

                      Take a look what I have, please:
                      http://snag.gy/VKK2S.jpg

                      1 條回覆 最後回覆 回覆 引用 0
                      • Claudia FrankC
                        Claudia Frank
                        最後由 編輯

                        Yes, you are right. But it looks the standard php multiline comment works

                        <?php
                        /*
                            $a = true;
                        */
                        ?>
                        

                        Cheers
                        Claudia

                        1 條回覆 最後回覆 回覆 引用 0
                        • Artem  RomankoA
                          Artem Romanko
                          最後由 Artem Romanko 編輯

                          This not what I want. I want to define something like regions and then fold it.

                          And unfortunately Notepad++ doesn’t have an oportunity to combine pre-defined language with user-defined language.
                          (user-defined language can help me, but I need to move all php syntax with loosing some features)

                          1 條回覆 最後回覆 回覆 引用 0
                          • Claudia FrankC
                            Claudia Frank
                            最後由 編輯

                            I’m not a php expert but couldn’t you use curly brackets?

                            1 條回覆 最後回覆 回覆 引用 0
                            • Artem  RomankoA
                              Artem Romanko
                              最後由 編輯

                              Do you mean:
                              {
                              $a = true;
                              }

                              ? I think it slows down the code.

                              1 條回覆 最後回覆 回覆 引用 0
                              • Claudia FrankC
                                Claudia Frank
                                最後由 Claudia Frank 編輯

                                Yes, that’s what I meant and as said, I’m no expert.
                                Why do you think it makes code execution slower?
                                And if it does, is it really notably slower?
                                You could also use something like { //region comment start } // region comment end
                                and when it goes to production delete those lines.

                                One other option, which just right now comes into to my mind,
                                might be to use hide lines (ALT+H) (view menu).
                                I don’t like it because you need to take care that you don’t do nested hidings - maybe you like it?

                                Cheers
                                Claudia

                                1 條回覆 最後回覆 回覆 引用 0
                                • 第一個貼文
                                  最後的貼文
                                The Community of users of the Notepad++ text editor.
                                Powered by NodeBB | Contributors