Disable Code Folding?
-
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.
-
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)
-
@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.
-
It’s ok. Thank you for the help.
-
@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 -
@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 -
But I’m opening an existing 120 MB XML file. I’m not creating a new one.
-
@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.
-
Go to Settings ==> Preferences ==> Margins/Border/Edge
There you can see, “Folder Margin Style”==> Select “None”
Hope this helps
-
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”.
-
@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.
-