• Login
Community
  • Login

Disable Code Folding?

Scheduled Pinned Locked Moved General Discussion
16 Posts 6 Posters 3.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.
  • A
    Adrian Parker
    last edited by Jun 23, 2021, 9:52 PM

    I read that Code Folding has a big impact on performance (https://community.notepad-plus-plus.org/topic/16808/why-is-notepad-so-slow-on-large-files-now/6)

    I’m working with a 40MB XML file. It takes minutes to open or save the file, and jumping to a line (CTRL-L), jumping to the end of file (CTRL-END), etc takes minutes.

    Is there any way to disable Code Folding? Not just hide the folding column but disable the feature entirely?

    The same file is quick to open, save and work with in Visual Studio, but VS is missing functionality that I have in Notepad++.

    I’m using Notepad++ 8.1 (x64 build)

    A 1 Reply Last reply Jun 23, 2021, 10:10 PM Reply Quote 0
    • A
      Adrian Parker @Adrian Parker
      last edited by Jun 23, 2021, 10:10 PM

      Or perhaps there is something else I can do so Notepad++ will work reasonably with large files?

      P 1 Reply Last reply Jun 23, 2021, 10:37 PM Reply Quote 0
      • P
        PeterJones @Adrian Parker
        last edited by PeterJones Jun 23, 2021, 10:38 PM Jun 23, 2021, 10:37 PM

        @Adrian-Parker ,

        To disable code folding, you can disable the whole lexer – so go to Language menu and select None (Normal Text) – but that gets rid of syntax highlighting as well as code folding.

        this discussion from a few days ago links to a plugin called “Big Files plugin”
        (https://github.com/superolmo/BigFiles), which also may be of help to you.

        A 2 Replies Last reply Jun 23, 2021, 10:57 PM Reply Quote 0
        • A
          Adrian Parker @PeterJones
          last edited by Jun 23, 2021, 10:57 PM

          @PeterJones

          Sadly that plugin doesn’t work very well. It’s buggy (ALT down-arrow takes you multiple hits to get to the last line), and the line numbers presented are only valid for the current buffer and not for the entire file.

          For example my XML file has 5,518,743 lines. CTRL-G 5516147 takes me to the end of the current buffer (line 4,252).

          When I go to the end of the file (ALT down arrow, twice), it shows the final line number as 1,078.

          I may just use Visual Studio, I guess. It’s fairly fast with large files, and maintains the proper line number display.

          1 Reply Last reply Reply Quote 0
          • A
            Adrian Parker @PeterJones
            last edited by Jun 23, 2021, 11:05 PM

            @PeterJones

            Setting the Langauge to None must be done after opening the file though, and opening the file is part of the problem (it seems to take 10 minutes or more on a local file that is only 120 MB). I don’t have a super expensive drive, but it is an SSD.

            P 1 Reply Last reply Jun 23, 2021, 11:08 PM Reply Quote 0
            • P
              PeterJones @Adrian Parker
              last edited by PeterJones Jun 23, 2021, 11:08 PM Jun 23, 2021, 11:08 PM

              @Adrian-Parker

              Change the extension to .txt then open the file. When you’re done and saved, rename back to .xml

              But as you’ve read in the older threads, Notepad++ wasn’t optimized for being a large-file editor; it was optimized for being a generic text editor with lots of features that make it useful for programming and using plugins to extend capabilities.

              A 1 Reply Last reply Jun 23, 2021, 11:16 PM Reply Quote 0
              • A
                Adrian Parker @PeterJones
                last edited by Jun 23, 2021, 11:16 PM

                @PeterJones

                I had thought about changing the file extension previously, and tested it. A *.txt file containing XML is still opened by Notepad++ with code folding enabled (and is extremely slow to open)

                P 1 Reply Last reply Jun 24, 2021, 12:32 AM Reply Quote 0
                • P
                  PeterJones @Adrian Parker
                  last edited by Jun 24, 2021, 12:32 AM

                  @Adrian-Parker said in Disable Code Folding?:

                  A *.txt file containing XML is still opened by Notepad++ with code folding enabled

                  Sorry, I forgot that certain lexers have additional heuristics beyond file extension. I am out of ideas, sorry.

                  A T 2 Replies Last reply Jun 24, 2021, 1:05 AM Reply Quote 0
                  • A
                    Adrian Parker @PeterJones
                    last edited by Jun 24, 2021, 1:05 AM

                    @PeterJones

                    It’s ok. Thank you for the help.

                    1 Reply Last reply Reply Quote 0
                    • T
                      Terry R @PeterJones
                      last edited by Terry R Jun 24, 2021, 1:41 AM Jun 24, 2021, 1:40 AM

                      @PeterJones said in Disable Code Folding?:

                      @Adrian-Parker said in Disable Code Folding?:

                      A *.txt file containing XML is still opened by Notepad++ with code folding enabled

                      Sorry, I forgot that certain lexers have additional heuristics beyond file extension. I am out of ideas, sorry.

                      @Adrian-Parker, I just created a tab in Notepad++ with XML content, no colour highlighting. Then I saved as a TXT file. Still no colour highlighting. As soon as I saved a copy as a XML file the lexer started and code folding and colour highlighting was enabled.

                      However on the XML file I could set Language as “normal text” which as you know turns off those features. I reset back to language XML and I have “remember current sessions for next launch” ticked. So after I closed Notepad++ and re-opened the TXT file, it still was not coloured, the XML file was coloured. I then changed the XML file to language normal text. Closed Notepad++ and re-opened, it now is not coloured.

                      So presumably the save session option together with tagging that XML file as “normal text” might allow it to stick and therefore not slow down the opening process.

                      This was only a quick test and the idea may not lend itself to your needs (if you need to close and not remember files across launches).

                      my 2c worth
                      Terry

                      A 1 Reply Last reply Jun 24, 2021, 12:41 PM Reply Quote 0
                      • T
                        Terry R
                        last edited by Jun 24, 2021, 2:22 AM

                        @Terry-R said in Disable Code Folding?:

                        So presumably the save session option together with tagging that XML file as “normal text” might allow it to stick and therefore not slow down the opening process.

                        Some other thoughts.

                        Look at the session.xml file located (normally) under %appdata%\Notepad++ folder. It includes the following lang="None (Normal Text)", of course it could be any including XML for each file saved in a session that’s used for the next opening of Notepad++. Possibly you could open your XML file once (by itself) in a Notepad++ session, change language to normal text. Have the “save session for next launch” ticked. Close Notepad++ and then backup that session.xml file. Whenever you want to open this file (all by itself initially) swap the session.xml files. I haven’t tested this and I’d say it’s not what I would call normal practise.

                        Another alternative is to run a portable Notepad++ environment and customise it so that it cannot run the XML lexer (is that possible?). I had a quick look and cannot identify a file called that. I see the lang.xml file refers to the extensions but changing that alone probably won’t prevent the XML lexer from working. I also looked at Preferences, Language and see an option to disable languages such as XML. The online manual here doesn’t elaborate enough to tell us what effect that has. Maybe another experienced forum member might know that answer.

                        OR a combination of the above, using a portable Notepad++ environment with the session saved for next launch setting ticked and ONLY this XML file as the file to open with it set to language normal text. That way you don’t change lots of settings for “normal” editing.

                        Cheers
                        Terry

                        A 1 Reply Last reply Jun 24, 2021, 12:47 PM Reply Quote 0
                        • A
                          Adrian Parker @Terry R
                          last edited by Jun 24, 2021, 12:41 PM

                          @Terry-R

                          But I’m opening an existing 120 MB XML file. I’m not creating a new one.

                          1 Reply Last reply Reply Quote 0
                          • A
                            Adrian Parker @Terry R
                            last edited by Jun 24, 2021, 12:47 PM

                            @Terry-R said in Disable Code Folding?:

                            Look at the session.xml file located (normally) under %appdata%\Notepad++ folder. It includes the following lang="None (Normal Text)", of course it could be any including XML for each file saved in a session that’s used for the next opening of Notepad++.

                            So perhaps I can change that to be *.xml only. I’ll look into that.

                            Possibly you could open your XML file once (by itself) in a Notepad++ session

                            But that takes 10+ minutes.

                            In Visual Studio the same file opens in about 5 seconds. It seems that Visual Studio automatically turns off XML features when opening large XML files (a warning in the Output window confirms this).

                            It would be nice if Notepad++ would automatically disable language features if the file is over X many bytes.

                            , change language to normal text. Have the “save session for next launch” ticked. Close Notepad++ and then backup that session.xml file. Whenever you want to open this file (all by itself initially) swap the session.xml files. I haven’t tested this and I’d say it’s not what I would call normal practise.

                            I open several different files, I’m not often opening the same file repeatedly.

                            1 Reply Last reply Reply Quote 0
                            • Pratap ReddyP
                              Pratap Reddy
                              last edited by Jun 22, 2022, 7:21 AM

                              Go to Settings ==> Preferences ==> Margins/Border/Edge

                              There you can see, “Folder Margin Style”==> Select “None”

                              Hope this helps

                              1 Reply Last reply Reply Quote 1
                              • MarcM
                                Marc
                                last edited by Dec 27, 2023, 3:25 PM

                                Presently, in Dec. 2023, this works:

                                Settings —> Preferences —> Editing (on the left side)

                                Then find the box that says “Folder Margin Style”, and select “None”.

                                Alan KilbornA 1 Reply Last reply Dec 27, 2023, 4:15 PM Reply Quote 0
                                • Alan KilbornA
                                  Alan Kilborn @Marc
                                  last edited by Alan Kilborn Dec 27, 2023, 4:18 PM Dec 27, 2023, 4:15 PM

                                  @Marc said in Disable Code Folding?:

                                  Presently, in Dec. 2023, this works:

                                  Settings —> Preferences —> Editing (on the left side)

                                  Then find the box that says “Folder Margin Style”, and select “None”.

                                  Multiple problems with these statements:

                                  • “In Dec. 2023” doesn’t convey much information. Saying “In Notepad++ 8.6” would be much better, as that version is current in Dec 2023. (but, see the next point…)

                                  • “Folder Margin Style” does NOT appear in “Settings —> Preferences —> Editing” as you state. It appears exactly where the previous poster said, in “Settings —> Preferences —> Margins/Border/Edge”

                                  So, basically your whole posting is wrong and indeed unnecessary. Sorry if that sounds harsh.

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