Main Menu

Format Code, XML

Started by bill, October 27, 2009, 08:23:40 PM

Previous topic - Next topic

bill

Hi. Just trying out HippoEdit. It looks nice, but having some issues. Surely there's something obvious that i'm overlooking, but how do you reformat code or XML? I see Format Selection and Format All, but it doesn't seem to work. For example, i enter the following and save as test.cpp, select all, then "Format Selection"

#include "stdafx.h"
int                 _tmain(int argc, _TCHAR* argv[]){return 0;}

But nothing happens. Likewise, i enter the following and save as test.xml, select, format selection, and nothing happens.

<docs><doc>
<title>fjkj</title>
</doc><doc><title>fjksdj</title>
     </doc></docs>

What's am i doing wrong? Thanks!

alex

Hi Bill,

welcome on forum.

Format Selection/Format All only correct leading indent and keyword case.
Correct indent for line is determined based on outlining data and FormatWords defined in syntax schema.

Both does not match to your examples...

For first one (C++) you want to have indent correct in middle of line (not designed) and split it to 3 lines by {} (not designed). Maybe.
This is too complex for generic text editor, but you can use external tools for doing this. Maybe next versions  I would introduce regular expression rules, defined in schema which would be used for formatting (I have this in plans), but do not know when. Not in 1.50 definitely.

And for second example formatting does not work, because outlining for xml like syntaxes not yet done :/
But once more you can use some external tools (add it with all parameters via tool menu: with toolbar, context menu and shortcuts) to format your document.
You can use free XML tidy for example.
As far as outlining support for XML would be added, formatting of the indent will work.

Best regards,
Alex
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]