Skip to content

Commit

Permalink
Add option sp_after_oc_property
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Gardner authored and Ben Gardner committed Dec 5, 2012
1 parent dfff12d commit 126a8b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/options.cpp
Expand Up @@ -482,6 +482,8 @@ void register_options(void)
unc_add_option("sp_after_oc_msg_receiver", UO_sp_after_oc_msg_receiver, AT_IARF,
"Add or remove space between the receiver and selector in a message.\n"
"'[receiver selector ...]'");
unc_add_option("sp_after_oc_property", UO_sp_after_oc_property, AT_IARF,
"Add or remove space after @property.");

unc_add_option("sp_cond_colon", UO_sp_cond_colon, AT_IARF,
"Add or remove space around the ':' in 'b ? t : f'");
Expand Down
1 change: 1 addition & 0 deletions src/options.h
Expand Up @@ -342,6 +342,7 @@ enum uncrustify_options
UO_sp_before_oc_block_caret,
UO_sp_after_oc_block_caret,
UO_sp_after_oc_msg_receiver,
UO_sp_after_oc_property,
UO_sp_cond_colon,
UO_sp_cond_question,
UO_sp_case_label,
Expand Down
6 changes: 6 additions & 0 deletions src/space.cpp
Expand Up @@ -1445,6 +1445,12 @@ static argval_t do_space(chunk_t *first, chunk_t *second, int& min_sp, bool comp
return(cpd.settings[UO_sp_annotation_paren].a);
}

if (first->type == CT_OC_PROPERTY)
{
log_rule("sp_after_oc_property");
return(cpd.settings[UO_sp_after_oc_property].a);
}

for (idx = 0; idx < (int)ARRAY_SIZE(no_space_table); idx++)
{
if (((no_space_table[idx].first == CT_UNKNOWN) ||
Expand Down

0 comments on commit 126a8b4

Please sign in to comment.