alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Indent without sorting of attributes

Jones-S opened this issue · comments

Hey there
I'm not sure whether this is the right place to address this issue, but I did not find any comment function on github.
Thanks for this plugin first of all! Helps me a lot.
there is just one thing: I don't want the plugin to rearrange my attributes of my xml nodes.
Could you tell me where I can disable that feature?
Thx a lot

Jonas

commented

+1 ,for json too ,it will even help if you add an option to how the re-arrange the attr/prop ,something like CssComb.

I'd also greatly appreciate the ability to indent my XML without the attributes being re-arranged.

+1 - sorting the attributes adds a lot of difficulty when trying to diff the previous (unformatted) and the formatted version of an XML file.
However, I'm not very optimistic if this can be fixed, it may be inherent to minidom, which this plugin uses.

+1 - Need this feature.

On Wed, Jun 24, 2015 at 7:27 PM, giovannibgr notifications@github.com
wrote:

+1 - sorting the attributes adds a lot of difficulty when trying to diff
the previous (unformatted) and the formatted version of an XML file.
However, I'm not very optimistic if this can be fixed, it may be inherent
to minidom, which this plugin uses.


Reply to this email directly or view it on GitHub
#59 (comment)
.

For those looking to indent JSON without sorting, you can edit your local copy of the package. Change the last line from:
return json.dumps(parsed, sort_keys=True, indent=4, separators=(',', ': '), ensure_ascii=False)
to
return json.dumps(parsed, sort_keys=False, indent=4, separators=(',', ': '), ensure_ascii=False)

+1

Also a config parameter for number of spaces for each indent would be nice.

+100500, please don't change the order of attributes

I am using on Mac, where can I find local copy of package? It seems package is unzipped and no way to open it.

+1 - sorting the attributes adds a lot of difficulty when trying to diff the previous (unformatted) and the formatted version of an XML file.
However, I'm not very optimistic if this can be fixed, it may be inherent to minidom, which this plugin uses.

You're right, another tool should be used according to this stackoverflow answer.

Or can you please at least write it to the readme file? 🙏