alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files
MIT License
534 stars 135 forks source link

Indent without sorting of attributes #59

Open Jones-S opened 10 years ago

Jones-S commented 10 years ago

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

ctf0 commented 10 years ago

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

iGemini commented 9 years ago

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

igrigorov commented 9 years ago

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

raghu777 commented 9 years ago

+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 https://github.com/alek-sys/sublimetext_indentxml/issues/59#issuecomment-114876469 .

vclayton commented 8 years ago

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)

orchetect commented 6 years ago

+1

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

slishnevsky commented 6 years ago

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

hualig commented 5 years ago

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

fsinisi90 commented 5 years ago

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

panda7789 commented 4 years ago

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