I don't have UE installed on Win/Linux or I'd test this myself, but with UE for Mac if I do "void MyObj::fn()" and hit ENTER the cursor ends up indented instead of lined up under the 'v'. Looking at the wordfile for C/C++ I have:
Indentation is caused by the defined indent strings which you can modify to your needs. The standard wordfile for C/C++ contains /Indent Strings = "{" "if" "else" ":" as you already posted. But most users just need:
/Indent Strings = "{"
/Unindent Strings = "}"
"if" "else" are for those users writing if conditions with a single code line like
But according to DaveS, UE behaves differently on Windows, which is consistent with my memory of UE on Windows. Also, I think the rule should apply based on the last character, not the presence of a character in a line at all. Otherwise, I'd think UE for Mac would incorrectly indent this as well:
complexmath wrote:But according to DaveS, UE behaves differently on Windows, which is consistent with my memory of UE on Windows.
Yes, that is right for the user interface and file locations, but surely not for the core functions as auto-indent is one.
complexmath wrote:Also, I think the rule should apply based on the last character, not the presence of a character in a line at all.
There is no other rule than if an indent string is found on a line not inside a comment or string, the next line will be indented. So your code line results in indenting the next line.
Please take into consideration that UltraEdit (for any platform) is a general text editor not written for certain programming languages. I use auto-indent for text files which do not contain a programming language. So there are no special rules for some programming languages included. The IDE solution of IDM - UEStudio - is more specialized for some programming languages and offers additional features for faster writing C/C++ code, but indenting works the same way.
Best is you simply remove ":" from indent strings definition in the wordfile for C/C++.
Best regards from an UC/UE/UES for Windows user from Austria
I just tested windows and it exhibits the same behavior, including wrongly indenting below a "a<b?c:d" expression, so you're right that this is expected behavior rather than a bug in the Mac implementation. I'll change my wordfile. Thanks