<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/93538>93538</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            The behavior of clang-format differs when the -lines parameter is added compared to when it is not
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-format
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          yang-f
      </td>
    </tr>
</table>

<pre>
    The behavior of clang-format differs when the -lines parameter is added compared to when it is not. It appears that adding the -lines parameter results in IndentWidth being set to 8.

Here are the observations:

Running the following command with the -lines parameter:

```shell
clang-format demo.c -style='{BasedOnStyle: google, IndentWidth: 4, UseTab: false }' -lines=293:295 | grep -n2 'info->tupleVisibilitySummary.xmax'
```
produces:

```shell
292-
293- info->tupleVisibilitySummary.xmin = FrozenTransactionId;
294: info->tupleVisibilitySummary.xmax =
295- InvalidTransactionId;
296- info->tupleVisibilitySummary.cid = FirstCommandId;
```
Running the following command without the -lines parameter:
```shell
clang-format aosegfiles_ext.c -style='{BasedOnStyle: google, IndentWidth: 4, UseTab: true}' | grep -n2 'info->tupleVisibilitySummary.xmax'
```
produces:

```shell
266-
267-     info->tupleVisibilitySummary.xmin = FrozenTransactionId;
268:     info->tupleVisibilitySummary.xmax = InvalidTransactionId;
269-     info->tupleVisibilitySummary.cid = FirstCommandId;
270-     info->tupleVisibilitySummary.infomask |= HEAP_XMIN_COMMITTED;
```

Additionally, the clang-format version information is:
```shell
LLVM (http://llvm.org/):
  LLVM version 3.4.2
  Optimized build.
  Built Nov  1 2018 (15:06:24).
  Default target: x86_64-redhat-linux-gnu
  Host CPU: x86-64
```

demo.c: line293~line297
```clang
                        info->tupleVisibilitySummary.xmin = FrozenTransactionId;
                        info->tupleVisibilitySummary.xmax = InvalidTransactionId;
                        info->tupleVisibilitySummary.cid = FirstCommandId;
                        info->tupleVisibilitySummary.infomask |= HEAP_XMIN_COMMITTED;
                        info->tupleVisibilitySummary.infomask |= HEAP_XMAX_INVALID;
```





</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEls1u4zYQx5-GvgwkyJSsj4MOTrxBDORj0c2mewsocSSxpUiDpJx4D332gpaVJml27aJBCwiSSM78OUP-hiCzVrQKsSSLM7JYzdjgOm3KHVNt0MwqzXflXYdQYce2QhvQDdRyP6hNzxxw0TRoLDx2qMB1CIEUCi1smGE9OjQgLDDOkUOt-w0zyMHp0Vw4P6i0C2HtgG02yIwF1zHnPYRq3xc0aAfpLAgFa8VRuV8Fdx1U6D0sOq-fhyRakWg5vi_RIDCDez1dWTRb5oRWlsTLl3a_DEpN0zZaSv3oW7Xue6Y4PArXvRvRGxWSRuNjO5Ry7Hu9ZtjrsIbAup1EEq8IzUh2dsYs8lv1ZexcQqt1K5HQ85dZ-oHE9321eMcq32yYtAgk8zKH0Ei8okVM4iUtFkCyc2gNbiBQFAjNhGp0QOJPbthIvBdWVEIKt_sy9D0zu_CpZ08-oNepjM2N0Xyo8e2yvZcwLWgw_cUBHJ1UKCDxCi6M_o7qzjBlWe23aM1JfDYJJT7fE-L3UpPPIoC12jIp-I9U06Ph1YKP0Qlj3fmIwwuJN6t0nCI9uCMgHUOIaYttIyTaB3xyHweTMwMeUPqfuEnTiZs0C0hUfAw6ab6f-wS1kZ4jzKTFKaEdwYZm0Skqfrhn9ne_IV7t8tPy88O36_XNw_nt9fX67u7T6kckju8l58InwKTc-d325L2CaYvGCq32gfiO_b_9KYxXV_fXQGjeObfxhvSC0Aspt32oTbtvFc_-AHvraZY4TEI6jdxunOjFd-RQDULycOo_G4R0cKO3AHOg0Tz3k80XJF5GqT_XEkKLZ-MVNmyQDhwzLTqP8VOePqRJYJB3zPkqG56CVg2Tw6W2Ds4_fz2YBmnyk-UbT2tv6quVFvEf4_ct6vslnRyL8fkIdk8XOwXdU9WOHXknyvwjeP-d5vLbw_rmfnm1PlIOf3_PeBnzIi7YDMt5Nk_zIl9k6awr8zyljCcRZXwe1wveJHEcYdPwmKc8yXEmShrRJFrQfE7n6TwNk4yn9aLiWdRUFcuQJBH2TMhwqo2ZsHbAsogXcT6TrEJp91cvSl-WJKHUX8ZM6d2CamgtSSIprLN_CTnhJP4Hl7PZYGTp69w-F3orXDdUYa37Q9UfPsHG6N-wdoRe7NO0hF6MmW5L-mcAAAD__6lcQZE">