Аргументы функции Uncrustify Guarantee выровнены с открывающей скобкой - PullRequest
0 голосов
/ 10 мая 2018

В моей текущей конфигурации uncrustify, если вызывается функция, большую часть времени аргументы выровнены по открывающей скобке, что я и хочу.

Однако, если первый аргумент длинен, так что ширина строки (code_width) превышена, происходит следующее:

  1. Новая строка добавляется после открывающей скобки
  2. Аргументы выровнены, но с отступом по отношению к открывающей скобке.

Итак, это:

        printf("This is some very large example string, which is so large, it exceeds the max line width",
               some_arg1,
               some_arg2,
               some_arg3);

Получается так:

        printf(
            "This is some very large example string, which is so large, it exceeds the max line width",
            some_arg1,
            some_arg2,
            some_arg3);

Можно ли как-нибудь убедиться, что все аргументы вызова функции выровнены, как вмой первый фрагмент?

Некоторые параметры в моем файле cfg, которые, я думаю, могут быть связаны:

# True:  indent continued function call parameters one indent level
# False: align parameters under the open paren.
indent_func_call_param          = false    # false/true

# Add or remove newline after '(' in a function declaration.
nl_func_decl_start              = remove   # ignore/add/remove/force

# Add or remove newline after '(' in a function definition.
nl_func_def_start               = remove   # ignore/add/remove/force

# Whether to add newline after '(' in a function declaration if '(' and ')' are in different lines.
nl_func_decl_start_multi_line   = false    # false/true

# Whether to add newline after '(' in a function definition if '(' and ')' are in different lines.
nl_func_def_start_multi_line    = false    # false/true

# Whether to add newline after '(' in a function call if '(' and ')' are in different lines.
nl_func_call_start_multi_line   = false    # false/true

# True:  indent continued function call parameters one indent level
# False: align parameters under the open paren.
indent_func_call_param          = false    # false/true

# If an open paren is followed by a newline, indent the next line so that it lines up after the open paren (not recommended).
indent_paren_nl                 = false    # false/true
...