Feature request: Notepad++ plugin?
I searched, but apperently I failed: #599 and #601 are releated git bisect with the other platform says f1424af25b32b9413815ac77fa667d100c2d70b2 is the first faulty one and the message refers to issue 35 (on the othe platform)
--align-reference / --align-pointer wrong since 3.6.2
Unexpected change of raw string literal
Released in v 3.6.14. I have also adjusted the VS2022 static project option to enable C++17.
Lines starting with #define and end with ',' are pre-padded with space
Released in v 3.6.14.
Curly braces prevent indentation (in lambda)
The first issue is related to this initializer list: OsVersion{6, 1}
following issue might be related: actual: if (std::count(pkStream.begin(), pkStream.end(), ' ') == 2 && std::all_of(pkStream.begin(), pkStream.end(), [](const char c) { return isDigit(c) || c == ' '; })) return L"SSH-1 public key"; expected: if (std::count(pkStream.begin(), pkStream.end(), ' ') == 2 && std::all_of(pkStream.begin(), pkStream.end(), [](const char c) { return isDigit(c) || c == ' '; })) return L"SSH-1 public key";
Curly braces prevent indentation (in lambda)
Issue is fixed in the latest version from 2026-02-13! Ticket can be closed.
It works! :) the raw string literals are preserved, and no regressions when applying Astyle to my whole codebase. I'll be using this version onwards. Thank you! PS: The VS 2022 x64/Static configuration fails to build. IMHO it could be removed entirely if unmaintained, since the effect is apparently like "Release" but with "Multi-threaded (/MT)"
I have comitted another fix.
It is related to the last line of the raw string having no indent. It seems to be an older bug or regression.
The two examples above are "complete" meaning, pasting each of them into a new cpp file and formatting keeps them unchanged (with the Astyle config from above), rather than fixing the broken switch and lambda layouts. This was tested with your latest version from Jan 30th, freshly compiled from gitlab. For some reason the presence of the raw string literals is responsible for the layout corruption. When deleting them, both the lambda and switch lay out correctly.
The two examples above are "complete" meaning, pasting each of them into a new cpp file and formatting keeps them unchanged (with the Astyle config from above), rather than fixing the broken switch and lambda layouts. This was tested with your latests version from Jan 30th, freshly compiled from gitlab. For some reason the presence of the raw string literals is responsible for the layout corruption. When deleting them, both the lambda and switch lay out correctly.
Hi, is it possible the bad formatting is triggered by other code before? I cannot replicate your isolated examples (not related to the last change).
The raw string literals seem to be preserved now, unfortunately there are regressions: For example the layout of the switch statement in the following test sample is broken (using same astyle config as above): std::string test() { return std::string(R"( <tr> <td>)") + R"(</td> <td><span style="font-weight: 600;">)" + R"(</span></td> )"; } void generateLogFileName(const ProcessSummary& summary) { const std::wstring failStatus = [&] { switch (summary.result) { case TaskResult::success: break; case...
I pushed a fix to git
updated version to 3.6.14
I pushed a fix in the git repo.
I have pushed a fix to the git repo
Unexpected indent in immediately called lambda
Lines starting with #define and end with ',' are pre-padded with space
duplicate issue
Negative numbers are aligned and others not
Lines starting with #define and end with ',' are pre-padded with space
Negative numbers are aligned and others not
Lines starting with #define and end with ',' are pre-padded with space
Lines starting with #define and end with ',' are pre-padded with space
updated version to 3.6.12
I get this too in ver. 3.6.12. An align-pointer=name has no effect on e.g. this: protected: virtual void DoDataExchange (CDataExchange* pDX); DECLARE_MESSAGE_MAP() I want virtual void DoDataExchange (CDataExchange *pDX); but astyle does not make it so.
Hi, Please ignore this issue as I was not able to reproduce it. Sorry for the inconvenience. Thanks!
When Astyle fails to open a specified file, the file is emptied
Thx, I pushed an update into the git repo
Hello Simon, Thank you for your reply an for looking at this, Unfortunately I tested on the version 3.6.10 and it seems that the lamdas are no longer indented Original indenting int func() { auto addLambda = [](int a, int b) { return a + b; }; } Then I run astyle-3.6.10-x64> .\astyle.exe --style=allman --indent=spaces=3 --indent-lambda MyFile.c Which gives me int func() { auto addLambda = [](int a, int b) { return a + b; }; } While in version 3.6.7 I have int func() { auto addLambda = [](int a, int...
Hello, I tested on the version 3.6.10 and it seems that the lamdas are no longer indented Original indenting int func() { auto addLambda = [](int a, int b) { return a + b; }; } Then I run astyle-3.6.10-x64> .\astyle.exe --style=allman --indent=spaces=3 --indent-lambda MyFile.c Which gives me int func() { auto addLambda = [](int a, int b) { return a + b; }; } While in version 3.6.7 I have int func() { auto addLambda = [](int a, int b) { return a + b; }; }
Hello, I tested on the version 3.6.10 and it seems that the lamdas are no longer indented Original indenting int func() { auto addLambda = [](int a, int b) { return a + b; }; } Then I run astyle-3.6.10-x64> .\astyle.exe --style=allman --indent=spaces=3 --indent-lambda MyFile.c Which gives me int func() { auto addLambda = [](int a, int b) { return a + b; }; } While in version 3.6.7 I have int func() { auto addLambda = [](int a, int b) { return a + b; }; }
Unexpected indent in immediately called lambda
Hi, please try again with 3.6.10
Please try with 3.6.10.
I have pushed a fix to the repo
Hi Marco, adding a single space after // also increases readability for humans. Therefore, many style guides prescribe this type of visual padding between the “frame” of the comment and its content.
Hello @saalen, yes, there are some rows of code: #include <string.h> #include <stdlib.h> #include <stdio.h> /////////////////////////////////////////////////////////// // INCLUDE COMUNI /////////////////////////////////////////////////////////// #include "configBase.h" #include "errorCode.h"//serve x AP_ERR #include "message.h" #include "myLib.h"//serve per AM #include "apEnum.h" #include "vegaassert.h" /////////////////////////////////////////////////////////// // INCLUDE SPECIFICI ///////////////////////////////////////////////////////////...
References in lambda parameter lists are not formatted according to --align-reference=type
Hi, is there any code before this function to trigger this?
indentation preprocessor inside functions
--align-pointer=type and --align-reference=type behave incorrectly
The problem with * ptr = 10; is still present in 3.6.9
The problem with * ptr = 10; still present in 3.6.9
Could you please add your examples as text like this: ```cpp verbatim copy of your code section goes here ``` The images are very small and are placed in the wrong place when clicked. In addition, they cannot be copied to easily verify the problem and possible fixes. And finally: Which Artistic Style version do you use?
Could you please add your examples as text like this: ```cpp verbatim copy of your code section goes here ``` The images are very small and are placed in the wrong place when clicked. In addition, they cannot be copied to easily verify the problem and possible fixes. Which version are you using?
With example 3
With example 2
With example 1
Issue with indenting if without brackets and if-else (with or without brackets) when in a lambda block.
AStyle 3.6.7: class modifiers indentation
AStyle 3.6.7: wrong indentation of multi-line assignment
astyle 3.6.8 (git 2025-03-14): incorrect using indentation
astyle 3.6.8 (git 2025-03-14): incorrect function-scope class indentation
astyle 3.6.8 (git 2025-03-17): unexpected linebreak for inherited class
Unwanted indentation after >>>
Unexpected change of raw string literal
I have pushed a fix for the first problem (pointer reference). It works correctly now, thanks! The second you can inmprove with --squeeze-ws. But only int will be recognized as a type, this is a limitation of the current parser. Hopfully this function can be restored again at some time. I've been relying on it a lot in Astyle 3.1 to normalize third-party codebases, especially all the function signatures.
I have pushed a fix for the first problem (pointer reference). The second you can inmprove with --squeeze-ws. But only int will be recognized as a type, this is a limitation of the current parser.
There seems to be a more general issue: Astyle keeps the following code unchanged: void test(int* test) { wxWindow * const win = nullptr; int* const win = nullptr; std::vector<std::pair<int, int>> * const win = nullptr; } expected: void test(int* test) { wxWindow* const win = nullptr; int* const win = nullptr; std::vector<std::pair<int, int>>* const win = nullptr; }
Perfect, the issue has been fixed!
Unwanted indentation after >>>
I pushed a fix for this one (Java operators confusion)
Preserve one-liners in switch
I just realized there is "--keep-one-line-statements", and it works for switches, too!! Ticket can be closed! :)
Sorry, this should have been filed under "Feature Requests", not "Bugs".
My Astyle config used: --style=allman --suffix=none --keep-one-line-blocks --align-pointer=type --min-conditional-indent=0 --max-continuation-indent=80 --indent-switches --indent-col1-comments --indent-preproc-block --indent-preproc-define --pad-header --pad-comma --formatted --lineend=linux --indent-preproc-block --convert-tabs --preserve-ws
Preserve one-liners in switch
Unexpected change of raw string literal
There is also the opposite case: AStyle produces: auto test() { return { .ai_flags = AI_ADDRCONFIG | AI_PASSIVE }; } while the expected result is: auto test() { return { .ai_flags = AI_ADDRCONFIG | AI_PASSIVE }; }
Unwanted indentation after >>>
Unwanted space between *&
Wrong indendation when returning struct