Skip to content

a bugfix for #1139 - #1149

Merged
gmaurel merged 13 commits into
uncrustify:masterfrom
guy-maurel:BeforeClosingParen
May 13, 2017
Merged

gmaurel merged 13 commits into
uncrustify:masterfrom
guy-maurel:BeforeClosingParen

Conversation

@guy-maurel

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/newlines.cpp
// Issue #1139
newline_iarf_pair(prev, tmp, cpd.settings[UO_nl_before_closing_paren].a);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I see the nl_before_closing_paren option is only working on CT_IF chunks? Unless you plan to extend this I'd rename that option to nl_before_if_closing_paren.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no because I use it also with else if

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but nl_before_closing_paren would imply that all closing parenthesis, including for example for(;;), would be affected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes... next day

(tmp->type != CT_SIZEOF) &&
!(tmp->flags & (PCF_IN_STRUCT | PCF_IN_CLASS))) ||
(tmp->type == CT_NEWLINE)
)

@CDanU CDanU May 12, 2017 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not testing if force works correctly. Please make one if branch with

... (tmp->type == CT_NEWLINE))

and the other with

... (tmp->type == CT_NEWLINE)

)

Comment thread tests/config/bug_1139-f.cfg Outdated
output_tab_size = 3
indent_columns = 3
indent_with_tabs = 0
sp_before_sparen = force

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of those are not needed to test nl_before_if_closing_paren

@gmaurel
gmaurel merged commit 8fd0e8a into uncrustify:master May 13, 2017
@guy-maurel
guy-maurel deleted the BeforeClosingParen branch December 13, 2017 17:21
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

Successfully merging this pull request may close these issues.

3 participants