Community
    • Login

    I want to fold in text files.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    foldingtxt files
    7 Posts 2 Posters 2.0k 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.
    • Luis Piña IIIL
      Luis Piña III
      last edited by Luis Piña III

      I created a User Defined Language called TXT and then selected it from the Language menu. There must be more steps because I’ve chosen folding options from the View menu.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Luis Piña III
        last edited by PeterJones

        @Luis-Piña-III ,.

        It’s foldable for me:

        3c09a622-8ab7-4c20-9659-83d51d3a863b-image.png

        ccf077c9-9b4c-4c3d-a4e8-9a49a23de43d-image.png

        In your UDL definition for this “TXT” language, did you actually define the Folding In Code Open/Close keywords? Because that’s what’s required to tell Notepad++ where to start and end the folds when you use the View menu’s folding commands.

        Can you show us a screenshot of the UDL for TXT? Please include the line numbers and fold margin on the left, the status bar at the bottom, and enough text in the screenshot that we can see that you actually have text which matches the Open/Close keywords defined for your UDL.

        Luis Piña IIIL 1 Reply Last reply Reply Quote 4
        • Luis Piña IIIL
          Luis Piña III @PeterJones
          last edited by

          This post is deleted!
          Luis Piña IIIL 1 Reply Last reply Reply Quote 0
          • Luis Piña IIIL
            Luis Piña III @Luis Piña III
            last edited by

            @Luis-Piña-III Do I need to select the UDL for every tab that I open?

            PeterJonesP 1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @Luis Piña III
              last edited by

              @Luis-Piña-III said in I want to fold in text files.:

              Do I need to select the UDL for every tab that I open?

              If you have an extension set for your UDL, then if you open a file with that extension, it will automatically apply your UDL for that tab (even if you do something weird like assign your UDL the extension txt – the UDL extension list overrides the builtin filetype extension list).

              But if you just use File > New (or the toolbar or keyboard shortcut equivalent), then you will have to use Language > MyUDLName (or do a File > Save As and give it an extension which matches your UDL definition).

              The same is true of every built-in filetype as well (when you create a new file, you have to manually assign the language or do SaveAs; when you open an existing file, it knows).

              1 Reply Last reply Reply Quote 2
              • Luis Piña IIIL
                Luis Piña III
                last edited by Luis Piña III

                How do I set an extension for TXT?

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @Luis Piña III
                  last edited by PeterJones

                  @Luis-Piña-III said in I want to fold in text files.:

                  How do I set an extension for TXT?

                  Once you’ve saved your UDL, when you look at the Language > User Defined Language > Define your language… dialog box and have that language selected, you get a Ext: box, where you can type txt to define that *.txt will be interpreted as your UDL. (You can see this box in my screenshot in my first reply, above.)

                  https://npp-user-manual.org/docs/user-defined-language-system/#udl-dialog-box-or-window

                  1 Reply Last reply Reply Quote 1
                  • Terry RT Terry R referenced this topic on
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors