alek-sys / sublimetext_indentxml

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

Sublime V3 does not work #114

Open parmy opened 5 years ago

parmy commented 5 years ago

Hi

I've open a xml file in Sublime and selected Indent XML (after selecting the contents of the file) and nothing happens.

Any suggestions please.

alek-sys commented 5 years ago

Can you see the comman in Selection -> Format sub-menu? Do you get any error messages in console (Ctrl + ~)?

justinrummel commented 5 years ago

I'm getting the same issue, here is the console message.

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1088, in run_
    return self.run(edit)
  File "/Users/jrummel/Library/Application Support/Sublime Text 3/Installed Packages/Indent XML.sublime-package/indentxml.py", line 47, in run
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 837, in replace
    sublime_api.view_replace(self.view_id, edit.edit_token, r, text)
TypeError: String required

I'm selecting the section that I want formatted, and then using Selection => Format option as mentioned above.

teknopaul commented 4 years ago

FYI IndentX package does work in ST3 with similar features

alek-sys commented 4 years ago

Thanks for reporting everyone.

I'm struggling to reproduce the issue, could you provide more details - OS, Sublime Text version, and maybe a text snippet or the full file that you are trying to format (if you can share it of course).

killthrush commented 4 years ago

I'm using mac 10.15.1 (Catalina) with ST 3.2.2. I was able to reproduce with this string: <xml><xml2></xml></xml>, which as it turns out is invalid XML. <xml><xml2></xml2></xml> works fine