I often use Notepad++ to open xml files. Most don't have a .xml file extension so when I open them I select XML from the language menu. This highlights the file properly which is nice, however the indentation is not corrected to ease the viewing of the file. It would be great if each nested element tag was indented when XML is selected.
Thanks for a great text viewer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This can easily be done through the XML Tools plugin. I would personally not want to see this implemented as an automatic behavior; there are many cases where it would ruin the code. Take XHTML, for example - in a <pre> element, the whitespace is preserved; if N++ auto-indented any XHTML file you opened, the text layout of any <pre> element would instantly be ruined.
That's just one example. In general, if you know that whitespace in your XML document doesn't matter, then go to Plugins -> XML Tools -> Pretty print (XML only - with line breaks). That will indent the code for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You know, auto-indentation is actually a really good idea, though I don't know how feaseable it would be. From what I can tell there are a lot of limitations placed on N++ by Scintilla.
I would recommend going through the Feature Request section of the Tracker, just because it's nicer when people do that ^^;
In anycase the indentation is usually based on the file, and I've never experienced N++ stripping indentations but I'd like to see what Donho thinks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I often use Notepad++ to open xml files. Most don't have a .xml file extension so when I open them I select XML from the language menu. This highlights the file properly which is nice, however the indentation is not corrected to ease the viewing of the file. It would be great if each nested element tag was indented when XML is selected.
Thanks for a great text viewer.
This can easily be done through the XML Tools plugin. I would personally not want to see this implemented as an automatic behavior; there are many cases where it would ruin the code. Take XHTML, for example - in a <pre> element, the whitespace is preserved; if N++ auto-indented any XHTML file you opened, the text layout of any <pre> element would instantly be ruined.
That's just one example. In general, if you know that whitespace in your XML document doesn't matter, then go to Plugins -> XML Tools -> Pretty print (XML only - with line breaks). That will indent the code for you.
You know, auto-indentation is actually a really good idea, though I don't know how feaseable it would be. From what I can tell there are a lot of limitations placed on N++ by Scintilla.
I would recommend going through the Feature Request section of the Tracker, just because it's nicer when people do that ^^;
In anycase the indentation is usually based on the file, and I've never experienced N++ stripping indentations but I'd like to see what Donho thinks.