diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-05-06 10:41:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 10:41:51 +0200 |
commit | 8bbeab9989d5f905ce2e4512e9967ee99d859f70 (patch) | |
tree | d0f929e63e7cdb18671783f76c8c2127e817e0a3 /src | |
parent | e3edcd06e3486a8bb50a7d9a231c3a473ac1a4d9 (diff) | |
parent | 544ef994df72c3cbe0dca6b856ce2dcbc5169767 (diff) | |
download | rneovim-8bbeab9989d5f905ce2e4512e9967ee99d859f70.tar.gz rneovim-8bbeab9989d5f905ce2e4512e9967ee99d859f70.tar.bz2 rneovim-8bbeab9989d5f905ce2e4512e9967ee99d859f70.zip |
Merge pull request #18442 from dundargoc/uncrustify
refactor: upgrade uncrustify configuration to version 0.75
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/vimscript.c | 2 | ||||
-rw-r--r-- | src/nvim/eval.h | 2 | ||||
-rw-r--r-- | src/nvim/lib/kbtree.h | 160 | ||||
-rw-r--r-- | src/nvim/shada.c | 2 | ||||
-rw-r--r-- | src/uncrustify.cfg | 224 |
5 files changed, 256 insertions, 134 deletions
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c index 3346b5a237..d3675a3c40 100644 --- a/src/nvim/api/vimscript.c +++ b/src/nvim/api/vimscript.c @@ -859,7 +859,7 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err) ADD(range, INTEGER_OBJ(ea.line1)); } ADD(range, INTEGER_OBJ(ea.line2)); - PUT(result, "range", ARRAY_OBJ(range));; + PUT(result, "range", ARRAY_OBJ(range)); } else { PUT(result, "range", ARRAY_OBJ(ARRAY_DICT_INIT)); } diff --git a/src/nvim/eval.h b/src/nvim/eval.h index c81b31aba9..101f6d9176 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -185,8 +185,8 @@ typedef enum { kMPArray, kMPMap, kMPExt, -#define LAST_MSGPACK_TYPE kMPExt } MessagePackType; +#define LAST_MSGPACK_TYPE kMPExt /// Array mapping values from MessagePackType to corresponding list pointers extern const list_T *eval_msgpack_type_lists[LAST_MSGPACK_TYPE + 1]; diff --git a/src/nvim/lib/kbtree.h b/src/nvim/lib/kbtree.h index aca96c9a7a..2edec527ff 100644 --- a/src/nvim/lib/kbtree.h +++ b/src/nvim/lib/kbtree.h @@ -103,11 +103,11 @@ int mid = (begin + end) >> 1; \ if (__cmp(__KB_KEY(key_t, x)[mid], *k) < 0) begin = mid + 1; \ else end = mid; \ - } \ - if (begin == x->n) { *rr = 1; return x->n - 1; } \ - if ((*rr = __cmp(*k, __KB_KEY(key_t, x)[begin])) < 0) --begin; \ - return begin; \ - } + } \ + if (begin == x->n) { *rr = 1; return x->n - 1; } \ + if ((*rr = __cmp(*k, __KB_KEY(key_t, x)[begin])) < 0) --begin; \ + return begin; \ + } #define __KB_GET(name, key_t, kbnode_t) \ static key_t *kb_getp_##name(kbtree_##name##_t *b, key_t * __restrict k) \ @@ -195,34 +195,34 @@ if (__KB_PTR(b, x)[i]->n == 2 * T - 1) { \ __kb_split_##name(b, x, i, __KB_PTR(b, x)[i]); \ if (__cmp(*k, __KB_KEY(key_t, x)[i]) > 0) ++i; \ - } \ - ret = __kb_putp_aux_##name(b, __KB_PTR(b, x)[i], k); \ } \ - return ret; \ + ret = __kb_putp_aux_##name(b, __KB_PTR(b, x)[i], k); \ } \ - static inline key_t *kb_putp_##name(kbtree_##name##_t *b, key_t * __restrict k) \ - { \ - if (!b->root) { \ - b->root = (kbnode_t *)xcalloc(1, ILEN); \ - ++b->n_nodes; \ - } \ - kbnode_t *r, *s; \ - ++b->n_keys; \ - r = b->root; \ - if (r->n == 2 * T - 1) { \ - ++b->n_nodes; \ - s = (kbnode_t *)xcalloc(1, ILEN); \ - b->root = s; s->is_internal = 1; s->n = 0; \ - __KB_PTR(b, s)[0] = r; \ - __kb_split_##name(b, s, 0, r); \ - r = s; \ - } \ - return __kb_putp_aux_##name(b, r, k); \ + return ret; \ + } \ + static inline key_t *kb_putp_##name(kbtree_##name##_t *b, key_t * __restrict k) \ + { \ + if (!b->root) { \ + b->root = (kbnode_t *)xcalloc(1, ILEN); \ + ++b->n_nodes; \ } \ - static inline void kb_put_##name(kbtree_##name##_t *b, key_t k) \ - { \ - kb_putp_##name(b, &k); \ - } + kbnode_t *r, *s; \ + ++b->n_keys; \ + r = b->root; \ + if (r->n == 2 * T - 1) { \ + ++b->n_nodes; \ + s = (kbnode_t *)xcalloc(1, ILEN); \ + b->root = s; s->is_internal = 1; s->n = 0; \ + __KB_PTR(b, s)[0] = r; \ + __kb_split_##name(b, s, 0, r); \ + r = s; \ + } \ + return __kb_putp_aux_##name(b, r, k); \ + } \ + static inline void kb_put_##name(kbtree_##name##_t *b, key_t k) \ + { \ + kb_putp_##name(b, &k); \ + } #define __KB_DEL(name, key_t, kbnode_t, T) \ @@ -380,58 +380,58 @@ } \ --itr->p; \ if (itr->p->x && itr->p->i < itr->p->x->n) return 1; \ + } \ + } \ + static inline int kb_itr_prev_##name(kbtree_##name##_t *b, kbitr_##name##_t *itr) \ + { \ + if (itr->p == NULL) return 0; \ + for (;;) { \ + while (itr->p->x && itr->p->i >= 0) { \ + itr->p[1].x = itr->p->x->is_internal? __KB_PTR(b, itr->p->x)[itr->p->i] : 0; \ + itr->p[1].i = itr->p[1].x ? itr->p[1].x->n : -1; \ + ++itr->p; \ } \ + if (itr->p == itr->stack) { \ + itr->p = NULL; \ + return 0; \ } \ - static inline int kb_itr_prev_##name(kbtree_##name##_t *b, kbitr_##name##_t *itr) \ - { \ - if (itr->p == NULL) return 0; \ - for (;;) { \ - while (itr->p->x && itr->p->i >= 0) { \ - itr->p[1].x = itr->p->x->is_internal? __KB_PTR(b, itr->p->x)[itr->p->i] : 0; \ - itr->p[1].i = itr->p[1].x ? itr->p[1].x->n : -1; \ - ++itr->p; \ - } \ - if (itr->p == itr->stack) { \ - itr->p = NULL; \ - return 0; \ - } \ - --itr->p; \ - --itr->p->i; \ - if (itr->p->x && itr->p->i >= 0) return 1; \ - } \ - } \ - static inline int kb_itr_getp_##name(kbtree_##name##_t *b, key_t * __restrict k, \ - kbitr_##name##_t *itr) \ - { \ - if (b->n_keys == 0) { \ - itr->p = NULL; \ - return 0; \ - } \ - int i, r = 0; \ - itr->p = itr->stack; \ - itr->p->x = b->root; \ - while (itr->p->x) { \ - i = __kb_getp_aux_##name(itr->p->x, k, &r); \ - itr->p->i = i; \ - if (i >= 0 && r == 0) return 1; \ - ++itr->p->i; \ - assert(itr->p->i <= 21); \ - itr->p[1].x = itr->p->x->is_internal? __KB_PTR(b, itr->p->x)[i + 1] : 0; \ - ++itr->p; \ - } \ - itr->p->i = 0; \ - return 0; \ - } \ - static inline int kb_itr_get_##name(kbtree_##name##_t *b, key_t k, kbitr_##name##_t *itr) \ - { \ - return kb_itr_getp_##name(b, &k, itr); \ - } \ - static inline void kb_del_itr_##name(kbtree_##name##_t *b, kbitr_##name##_t *itr) \ - { \ - key_t k = kb_itr_key(itr); \ - kb_delp_##name(b, &k); \ - kb_itr_getp_##name(b, &k, itr); \ - } + --itr->p; \ + --itr->p->i; \ + if (itr->p->x && itr->p->i >= 0) return 1; \ + } \ + } \ + static inline int kb_itr_getp_##name(kbtree_##name##_t *b, key_t * __restrict k, \ + kbitr_##name##_t *itr) \ + { \ + if (b->n_keys == 0) { \ + itr->p = NULL; \ + return 0; \ + } \ + int i, r = 0; \ + itr->p = itr->stack; \ + itr->p->x = b->root; \ + while (itr->p->x) { \ + i = __kb_getp_aux_##name(itr->p->x, k, &r); \ + itr->p->i = i; \ + if (i >= 0 && r == 0) return 1; \ + ++itr->p->i; \ + assert(itr->p->i <= 21); \ + itr->p[1].x = itr->p->x->is_internal? __KB_PTR(b, itr->p->x)[i + 1] : 0; \ + ++itr->p; \ + } \ + itr->p->i = 0; \ + return 0; \ + } \ + static inline int kb_itr_get_##name(kbtree_##name##_t *b, key_t k, kbitr_##name##_t *itr) \ + { \ + return kb_itr_getp_##name(b, &k, itr); \ + } \ + static inline void kb_del_itr_##name(kbtree_##name##_t *b, kbitr_##name##_t *itr) \ + { \ + key_t k = kb_itr_key(itr); \ + kb_delp_##name(b, &k); \ + kb_itr_getp_##name(b, &k, itr); \ + } #define KBTREE_INIT(name, key_t, __cmp, T) \ KBTREE_INIT_IMPL(name, key_t, kbnode_##name##_t, __cmp, T, \ diff --git a/src/nvim/shada.c b/src/nvim/shada.c index e89efe1cbc..05df0e590b 100644 --- a/src/nvim/shada.c +++ b/src/nvim/shada.c @@ -151,8 +151,8 @@ typedef enum { kSDItemBufferList = 9, ///< Buffer list. kSDItemLocalMark = 10, ///< Buffer-local mark. kSDItemChange = 11, ///< Item from buffer change list. -#define SHADA_LAST_ENTRY ((uint64_t)kSDItemChange) } ShadaEntryType; +#define SHADA_LAST_ENTRY ((uint64_t)kSDItemChange) /// Possible results when reading ShaDa file typedef enum { diff --git a/src/uncrustify.cfg b/src/uncrustify.cfg index 401e48d6e0..5f1165024a 100644 --- a/src/uncrustify.cfg +++ b/src/uncrustify.cfg @@ -1,4 +1,4 @@ -# Uncrustify-0.74.0_f +# Uncrustify-0.75.0_f # # General options @@ -127,6 +127,11 @@ sp_before_assign = ignore # ignore/add/remove/force/not_defined # Overrides sp_assign. sp_after_assign = ignore # ignore/add/remove/force/not_defined +# Add or remove space in 'enum {'. +# +# Default: add +sp_enum_brace = add # ignore/add/remove/force/not_defined + # Add or remove space in 'NS_ENUM ('. sp_enum_paren = ignore # ignore/add/remove/force/not_defined @@ -218,6 +223,10 @@ sp_after_ptr_star_trailing = ignore # ignore/add/remove/force/not_defined # in a function pointer definition. sp_ptr_star_func_var = ignore # ignore/add/remove/force/not_defined +# Add or remove space between the pointer star '*' and the name of the type +# in a function pointer type definition. +sp_ptr_star_func_type = ignore # ignore/add/remove/force/not_defined + # Add or remove space after a pointer star '*', if followed by an open # parenthesis, as in 'void* (*)()'. sp_ptr_star_paren = ignore # ignore/add/remove/force/not_defined @@ -252,6 +261,10 @@ sp_after_byref_func = ignore # ignore/add/remove/force/not_defined # prototype or function definition. sp_before_byref_func = ignore # ignore/add/remove/force/not_defined +# Add or remove space after a reference sign '&', if followed by an open +# parenthesis, as in 'char& (*)()'. +sp_byref_paren = ignore # ignore/add/remove/force/not_defined + # Add or remove space between type and word. In cases where total removal of # whitespace would be a syntax error, a value of 'remove' is treated the same # as 'force'. @@ -452,14 +465,17 @@ sp_between_mdatype_commas = ignore # ignore/add/remove/force/not_defined # Default: force sp_paren_comma = force # ignore/add/remove/force/not_defined +# Add or remove space between a type and ':'. +sp_type_colon = ignore # ignore/add/remove/force/not_defined + # Add or remove space after the variadic '...' when preceded by a # non-punctuator. -# The value REMOVE will be overriden with FORCE +# The value REMOVE will be overridden with FORCE sp_after_ellipsis = ignore # ignore/add/remove/force/not_defined # Add or remove space before the variadic '...' when preceded by a # non-punctuator. -# The value REMOVE will be overriden with FORCE +# The value REMOVE will be overridden with FORCE sp_before_ellipsis = ignore # ignore/add/remove/force/not_defined # Add or remove space between a type and '...'. @@ -468,9 +484,6 @@ sp_type_ellipsis = ignore # ignore/add/remove/force/not_defined # Add or remove space between a '*' and '...'. sp_ptr_type_ellipsis = ignore # ignore/add/remove/force/not_defined -# (D) Add or remove space between a type and '?'. -sp_type_question = ignore # ignore/add/remove/force/not_defined - # Add or remove space between ')' and '...'. sp_paren_ellipsis = ignore # ignore/add/remove/force/not_defined @@ -790,6 +803,10 @@ sp_d_array_colon = ignore # ignore/add/remove/force/not_defined # Default: remove sp_not = remove # ignore/add/remove/force/not_defined +# Add or remove space between two '!' (not) unary operators. +# If set to ignore, sp_not will be used. +sp_not_not = ignore # ignore/add/remove/force/not_defined + # Add or remove space after the '~' (invert) unary operator. # # Default: remove @@ -1044,15 +1061,21 @@ force_tab_after_define = false # true/false # Default: 8 indent_columns = 2 # unsigned number +# Whether to ignore indent for the first continuation line. Subsequent +# continuation lines will still be indented to match the first. +indent_ignore_first_continue = false # true/false + # The continuation indent. If non-zero, this overrides the indent of '(', '[' # and '=' continuation indents. Negative values are OK; negative value is # absolute and not increased for each '(' or '[' level. # # For FreeBSD, this is set to 4. +# Requires indent_ignore_first_continue=false. indent_continue = 0 # number # The continuation indent, only for class header line(s). If non-zero, this # overrides the indent of 'class' continuation indents. +# Requires indent_ignore_first_continue=false. indent_continue_class_head = 0 # unsigned number # Whether to indent empty lines (i.e. lines which contain only spaces before @@ -1128,16 +1151,23 @@ indent_namespace_level = 0 # unsigned number # indented. Requires indent_namespace=true. 0 means no limit. indent_namespace_limit = 0 # unsigned number +# Whether to indent only in inner namespaces (nested in other namespaces). +# Requires indent_namespace=true. +indent_namespace_inner_only = false # true/false + # Whether the 'extern "C"' body is indented. indent_extern = false # true/false # Whether the 'class' body is indented. indent_class = false # true/false +# Whether to ignore indent for the leading base class colon. +indent_ignore_before_class_colon = false # true/false + # Additional indent before the leading base class colon. # Negative values decrease indent down to the first column. -# Requires a newline break before colon (see pos_class_colon -# and nl_class_colon) +# Requires indent_ignore_before_class_colon=false and a newline break before +# the colon (see pos_class_colon and nl_class_colon) indent_before_class_colon = 0 # number # Whether to indent the stuff after a leading base class colon. @@ -1147,6 +1177,9 @@ indent_class_colon = false # true/false # colon. Requires indent_class_colon=true. indent_class_on_colon = false # true/false +# Whether to ignore indent for a leading class initializer colon. +indent_ignore_before_constr_colon = false # true/false + # Whether to indent the stuff after a leading class initializer colon. indent_constr_colon = false # true/false @@ -1177,9 +1210,12 @@ indent_var_def_blk = 0 # number # Whether to indent continued variable declarations instead of aligning. indent_var_def_cont = false # true/false -# Whether to indent continued shift expressions ('<<' and '>>') instead of -# aligning. Set align_left_shift=false when enabling this. -indent_shift = false # true/false +# How to indent continued shift expressions ('<<' and '>>'). +# Set align_left_shift=false when using this. +# 0: Align shift operators instead of indenting them (default) +# 1: Indent by one level +# -1: Preserve original indentation +indent_shift = 0 # number # Whether to force indentation of function definitions to start in column 1. indent_func_def_force_col1 = false # true/false @@ -1266,6 +1302,9 @@ indent_switch_case = 0 # unsigned number # Usually the same as indent_columns or indent_switch_case. indent_switch_body = 0 # unsigned number +# Whether to ignore indent for '{' following 'case'. +indent_ignore_case_brace = false # true/false + # Spaces to indent '{' from 'case'. By default, the brace will appear under # the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK. # It might be wise to choose the same value for the option indent_switch_case. @@ -1334,10 +1373,11 @@ indent_paren_nl = false # true/false # How to indent a close parenthesis after a newline. # -# 0: Indent to body level (default) -# 1: Align under the open parenthesis -# 2: Indent to the brace level -indent_paren_close = 0 # unsigned number +# 0: Indent to body level (default) +# 1: Align under the open parenthesis +# 2: Indent to the brace level +# -1: Preserve original indentation +indent_paren_close = 0 # number # Whether to indent the open parenthesis of a function definition, # if the parenthesis is on its own line. @@ -1351,24 +1391,41 @@ indent_paren_after_func_decl = false # true/false # if the parenthesis is on its own line. indent_paren_after_func_call = true # true/false -# Whether to indent a comma when inside a brace. -# If true, aligns under the open brace. -indent_comma_brace = false # true/false +# How to indent a comma when inside braces. +# 0: Indent by one level (default) +# 1: Align under the open brace +# -1: Preserve original indentation +indent_comma_brace = 0 # number -# Whether to indent a comma when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_comma_paren = false # true/false +# How to indent a comma when inside parentheses. +# 0: Indent by one level (default) +# 1: Align under the open parenthesis +# -1: Preserve original indentation +indent_comma_paren = 0 # number -# Whether to indent a Boolean operator when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_bool_paren = false # true/false +# How to indent a Boolean operator when inside parentheses. +# 0: Indent by one level (default) +# 1: Align under the open parenthesis +# -1: Preserve original indentation +indent_bool_paren = 0 # number + +# Whether to ignore the indentation of a Boolean operator when outside +# parentheses. +indent_ignore_bool = false # true/false + +# Whether to ignore the indentation of an arithmetic operator. +indent_ignore_arith = false # true/false # Whether to indent a semicolon when inside a for parenthesis. # If true, aligns under the open for parenthesis. indent_semicolon_for_paren = false # true/false +# Whether to ignore the indentation of a semicolon outside of a 'for' +# statement. +indent_ignore_semicolon = false # true/false + # Whether to align the first expression to following ones -# if indent_bool_paren=true. +# if indent_bool_paren=1. indent_first_bool_expr = false # true/false # Whether to align the first expression to following ones @@ -1382,6 +1439,9 @@ indent_square_nl = false # true/false # (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies. indent_preserve_sql = false # true/false +# Whether to ignore the indentation of an assignment operator. +indent_ignore_assign = false # true/false + # Whether to align continued statements at the '='. If false or if the '=' is # followed by a newline, the next line is indent one tab. # @@ -1982,7 +2042,8 @@ nl_after_semicolon = false # true/false nl_paren_dbrace_open = ignore # ignore/add/remove/force/not_defined # Whether to add a newline after the type in an unnamed temporary -# direct-list-initialization. +# direct-list-initialization, better: +# before a direct-list-initialization. nl_type_brace_init_lst = ignore # ignore/add/remove/force/not_defined # Whether to add a newline after the open brace in an unnamed temporary @@ -2240,15 +2301,15 @@ nl_typedef_blk_end = 0 # unsigned number # 0: No change (default). nl_typedef_blk_in = 0 # unsigned number -# The number of newlines before a block of variable definitions not at the top -# of a function body. If nl_after_access_spec is non-zero, that option takes -# precedence. +# The number of empty newlines before a block of variable definitions +# not at the top of a function body. If nl_after_access_spec is non-zero, +# that option takes precedence. # # 0: No change (default). nl_var_def_blk_start = 0 # unsigned number -# The number of newlines after a block of variable definitions not at the top -# of a function body. +# The number of empty newlines after a block of variable definitions +# not at the top of a function body. # # 0: No change (default). nl_var_def_blk_end = 0 # unsigned number @@ -2564,6 +2625,11 @@ align_var_def_inline = false # true/false # 0: Don't align (default). align_assign_span = 0 # unsigned number +# The span for aligning on '{' in braced init list. +# +# 0: Don't align (default). +align_braced_init_list_span = 0 # unsigned number + # The span for aligning on '=' in function prototype modifier. # # 0: Don't align (default). @@ -2575,6 +2641,17 @@ align_assign_func_proto_span = 0 # unsigned number # 0: No limit (default). align_assign_thresh = 0 # number +# Whether to align on the left most assignment when multiple +# definitions are found on the same line. +# Depends on 'align_assign_span' and 'align_assign_thresh' settings. +align_assign_on_multi_var_defs = false # true/false + +# The threshold for aligning on '{' in braced init list. +# Use a negative number for absolute thresholds. +# +# 0: No limit (default). +align_braced_init_list_thresh = 0 # number + # How to apply align_assign_span to function declaration "assignments", i.e. # 'virtual void foo() = 0' or '~foo() = {default|delete}'. # @@ -2780,7 +2857,7 @@ align_oc_decl_colon = false # true/false # (OC) Whether to not align parameters in an Objectve-C message call if first # colon is not on next line of the message call (the same way Xcode does -# aligment) +# alignment) align_oc_msg_colon_xcode_like = false # true/false # @@ -2980,12 +3057,17 @@ mod_full_brace_function = ignore # ignore/add/remove/force/not_defined mod_full_brace_if = add # ignore/add/remove/force/not_defined # Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either -# have, or do not have, braces. If true, braces will be added if any block -# needs braces, and will only be removed if they can be removed from all -# blocks. -# -# Overrides mod_full_brace_if. -mod_full_brace_if_chain = false # true/false +# have, or do not have, braces. Overrides mod_full_brace_if. +# +# 0: Don't override mod_full_brace_if +# 1: Add braces to all blocks if any block needs braces and remove braces if +# they can be removed from all blocks +# 2: Add braces to all blocks if any block already has braces, regardless of +# whether it needs them +# 3: Add braces to all blocks if any block needs braces and remove braces if +# they can be removed from all blocks, except if all blocks have braces +# despite none needing them +mod_full_brace_if_chain = 0 # unsigned number # Whether to add braces to all blocks of an 'if'/'else if'/'else' chain. # If true, mod_full_brace_if_chain will only remove braces from an 'if' that @@ -3027,6 +3109,14 @@ mod_pawn_semicolon = false # true/false # statement, as in 'if (a && b > c)' => 'if (a && (b > c))'. mod_full_paren_if_bool = false # true/false +# Whether to fully parenthesize Boolean expressions after '=' +# statement, as in 'x = a && b > c;' => 'x = (a && (b > c));'. +mod_full_paren_assign_bool = false # true/false + +# Whether to fully parenthesize Boolean expressions after '=' +# statement, as in 'return a && b > c;' => 'return (a && (b > c));'. +mod_full_paren_return_bool = false # true/false + # Whether to remove superfluous semicolons. mod_remove_extra_semicolon = true # true/false @@ -3094,6 +3184,10 @@ mod_sort_incl_import_grouping_enabled = true # true/false # the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'. mod_move_case_break = false # true/false +# Whether to move a 'return' that appears after a fully braced 'case' before +# the close brace, as in 'case X: { ... } return;' => 'case X: { ... return; }'. +mod_move_case_return = false # true/false + # Add or remove braces around a fully braced case statement. Will only remove # braces if there are no variable declarations in the block. mod_case_brace = remove # ignore/add/remove/force/not_defined @@ -3144,6 +3238,10 @@ pp_indent = remove # ignore/add/remove/force/not_defined # indented from column 1. pp_indent_at_level = false # true/false +# Whether to indent #if/#else/#endif at the parenthesis level if the brace +# level is 0. If false, these are indented from column 1. +pp_indent_at_level0 = false # true/false + # Specifies the number of columns to indent preprocessors per level # at brace level 0 (file-level). If pp_indent_at_level=false, also specifies # the number of columns to indent preprocessors per level @@ -3209,12 +3307,37 @@ pp_indent_func_def = true # true/false # Default: true pp_indent_extern = true # true/false -# Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly -# inside of. +# How to indent braces directly inside #if, #else, and #endif. +# Requires pp_if_indent_code=true and only applies to the indent of the +# preprocesser that the braces are directly inside of. +# 0: No extra indent +# 1: Indent by one level +# -1: Preserve original indentation # -# Default: true -pp_indent_brace = true # true/false +# Default: 1 +pp_indent_brace = 1 # number + +# Whether to print warning messages for unbalanced #if and #else blocks. +# This will print a message in the following cases: +# - if an #ifdef block ends on a different indent level than +# where it started from. Example: +# +# #ifdef TEST +# int i; +# { +# int j; +# #endif +# +# - an #elif/#else block ends on a different indent level than +# the corresponding #ifdef block. Example: +# +# #ifdef TEST +# int i; +# #else +# } +# int j; +# #endif +pp_warn_unbalanced_if = false # true/false # # Sort includes options @@ -3253,17 +3376,16 @@ use_indent_func_call_param = true # true/false # # true: indent_continue will be used only once # false: indent_continue will be used every time (default) +# +# Requires indent_ignore_first_continue=false. use_indent_continue_only_once = false # true/false -# The value might be used twice: -# - at the assignment -# - at the opening brace -# -# To prevent the double use of the indentation value, use this option with the -# value 'true'. +# The indentation can be: +# - after the assignment, at the '[' character +# - at the begin of the lambda body # -# true: indentation will be used only once -# false: indentation will be used every time (default) +# true: indentation will be after the assignment +# false: indentation will be at the begin of the lambda body (default) indent_cpp_lambda_only_once = false # true/false # Whether sp_after_angle takes precedence over sp_inside_fparen. This was the |