• Login
Community
  • Login

I want to fold in text files.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
foldingtxt files
7 Posts 2 Posters 1.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.
  • L
    Luis Piña III
    last edited by Luis Piña III Mar 1, 2024, 2:48 PM Mar 1, 2024, 2:48 PM

    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.

    P 1 Reply Last reply Mar 1, 2024, 3:16 PM Reply Quote 0
    • P
      PeterJones @Luis Piña III
      last edited by PeterJones Mar 1, 2024, 3:18 PM Mar 1, 2024, 3:16 PM

      @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.

      L 1 Reply Last reply Mar 1, 2024, 4:51 PM Reply Quote 4
      • L
        Luis Piña III @PeterJones
        last edited by Mar 1, 2024, 4:51 PM

        This post is deleted!
        L 1 Reply Last reply Mar 4, 2024, 10:45 AM Reply Quote 0
        • L
          Luis Piña III @Luis Piña III
          last edited by Mar 4, 2024, 10:45 AM

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

          P 1 Reply Last reply Mar 4, 2024, 1:54 PM Reply Quote 0
          • P
            PeterJones @Luis Piña III
            last edited by Mar 4, 2024, 1:54 PM

            @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
            • L
              Luis Piña III
              last edited by Luis Piña III Mar 5, 2024, 4:10 PM Mar 5, 2024, 4:08 PM

              How do I set an extension for TXT?

              P 1 Reply Last reply Mar 5, 2024, 4:16 PM Reply Quote 0
              • P
                PeterJones @Luis Piña III
                last edited by PeterJones Mar 5, 2024, 4:17 PM Mar 5, 2024, 4:16 PM

                @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
                • T Terry R referenced this topic on Mar 25, 2024, 7:09 PM
                5 out of 7
                • First post
                  5/7
                  Last post
                The Community of users of the Notepad++ text editor.
                Powered by NodeBB | Contributors