﻿---
title: csharp_preserve_single_line_blocks
description: Allow a block the author wrote on one line to stay on one line. Defaults to `true`
url: https://docs-v3-preview.elastic.dev/reference/wrapping/csharp_preserve_single_line_blocks
---

# csharp_preserve_single_line_blocks
Allow a block the author wrote on one line to stay on one line.

## Values


| Value   | Notes |
|---------|-------|
| `true`  |       |
| `false` |       |

**Default:** `true`

### `csharp_preserve_single_line_blocks = true`

```ini
csharp_preserve_single_line_blocks = true
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        public int X { get; set; }
        public string Name { get; set; } = "";
        public void Empty() { }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        public int X { get; set; }
        public string Name { get; set; } = "";
        public void Empty() { }
    }
    ```
  </tab-item>
</tab-set>


### `csharp_preserve_single_line_blocks = false`

```ini
csharp_preserve_single_line_blocks = false
```

<tab-set>
  <tab-item title="Before">
    ```csharp
    namespace N;

    public class Widget
    {
        public int X { get; set; }
        public string Name { get; set; } = "";
        public void Empty() { }
    }
    ```
  </tab-item>

  <tab-item title="After">
    ```csharp
    namespace N;

    public class Widget
    {
        public int X
        {
            get; set;
        }
        public string Name
        {
            get; set;
        } = "";
        public void Empty()
        {
        }
    }
    ```
  </tab-item>
</tab-set>