Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: treat cmt/pp as nothing/newline #4192

Open
0Xellos opened this issue Jan 8, 2024 · 0 comments
Open

Feature request: treat cmt/pp as nothing/newline #4192

0Xellos opened this issue Jan 8, 2024 · 0 comments

Comments

@0Xellos
Copy link

0Xellos commented Jan 8, 2024

I'm at version 0.77.1-1.

Let's assume that relevant nl_before_* options are 0 since I'm not sure how that interacts. With the options nl_after_func[_class]_proto[_group] set to 0 for group and at least 2 for non-group, subsequent lines with comments or preprocessor directives always break the group, so newlines get added after them. Example attached with relevant slice of my config file, correct behaviour would be to keep the code unchanged.

While it could be useful sometimes, I'd rather be able to comment out or if-out prototypes without having newlines added automatically, so that I could choose logical groups of prototypes by adding newlines manually.

The behaviour of cmt/pp in this case could be chosen by the user - either treat them as nothing, so that newlines after a group-ending cmt/pp would be added, or treat them as existing newlines and only add more if needed. The former is more relevant and should be simpler since it only deals with the "inside group" situation.

A similar situation happens with nl_after_func_body[_class]. In particular, I'd like to add newlines before #ifdef followed immediately by a function definition, and after #endif preceded by a function definition, whether it's a class method or separate function; currently it's putting the newlines between pp and function and not outside pp. This is not a priority and could be a separate option, though the concept is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant