Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Indenting after UE4 macros -- any retroactive fix?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Kelby Posted - Jan 05 2020 : 11:36:10 PM
Thanks to the Whole Tomato team for the recent fix that allows me to type a UE4 UPROPERTY or UFUNCTION without auto-indenting the next line!

But now I still have tens of thousands of lines of code that were auto-indented before the latest update that included this fix. Is there a convenient and safe way to remove all of those old indents? I can leave it as is, I suppose, but it's a bit sloppy to have so much code indented and all the new code going forward not indented.
2   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 06 2020 : 12:51:52 PM
From this forum thread:

https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=16718

I worked out the following find and replace regular expression, which copies the indent from the following line, and applies it to the Unreal macro, so it should have the correct indent. It works correctly in the code I have tested, so should help:

Find
^([ \t]+)((UCLASS|UINTERFACE|USTRUCT|UFUNCTION|UPROPERTY)\(.*)\n([ \t])+(\w)
Replace
$1$2\n$1$5

which works with the Visual Studio Find and Replace regex syntax, which is different to other regex syntax's, just because
simco50 Posted - Jan 06 2020 : 04:53:34 AM
Awesome update indeed. I've been getting around it by using a regex find and replace which worked very well for me so far.
Here it is in case you want to give it a try
replace:
((?:UPROPERTY|UFUNCTION)\(.*\).*\n\t)\t
with
$1

This will replace the matches with the contents of the first capture group which is the match without the last indent.
I'm not a regex wizard so I'm sure there could be a much better/smarter solution :)

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000