# ruby: Add proper indentation for singleton methods \(\#12535\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/08123a270ae775da62b85238dc62b4c71f123cd3)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 08123a270ae775da62b85238dc62b4c71f123cd3

Requested commit: 08123a270ae775da62b85238dc62b4c71f123cd3

Commit: 08123a270ae775da62b85238dc62b4c71f123cd3

Tree: c19a95e1a515e0195e0046e6ba5410c1b66f8263

Author: Vitaly Slobodin

Committer: GitHub

## Message

````
ruby: Add proper indentation for singleton methods (#12535)

Hi. Currently, Zed uses incorrect indentation for singleton methods:

```ruby
def self.build
| # <= cursor position after hitting Enter
end
```

Handling the `singleton_method` token indentation
changes this behavior to the following:

```ruby
def self.build
  | # <= cursor position after hitting Enter
end
```

## Before


https://github.com/zed-industries/zed/assets/1894248/40fc2b37-692f-469f-9cbe-05cbb1ab4c3c

## After



https://github.com/zed-industries/zed/assets/1894248/d9ba8d27-fd17-4c74-b22c-a4de124739a3



Release Notes:

- N/A
````

## Parents

- [6eb8e8341132ef889ac2f3b51823e8b9ad9af0c3](https://git.cafe/gitcafe/zed/commit/6eb8e8341132ef889ac2f3b51823e8b9ad9af0c3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/08123a270ae775da62b85238dc62b4c71f123cd3?format=markdown)
