# Add new \`argument\` vim text object \(\#7791\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2e616f8388de30ce015fadff1eb99baf325c9c2a

Requested commit: 2e616f8388de30ce015fadff1eb99baf325c9c2a

Commit: 2e616f8388de30ce015fadff1eb99baf325c9c2a

Tree: 3f39efd13ce36d5457ae4a44b71b9b6694ff4c68

Author: vultix

Committer: GitHub

## Message

```
Add new `argument` vim text object (#7791)

This PR adds a new `argument` vim text object, inspired by
[targets.vim](https://github.com/wellle/targets.vim).

As it's the first vim text object to use the syntax tree, it needed to
operate on the `Buffer` level, not the `MultiBuffer` level, then map the
buffer coordinates to `DisplayPoint` as necessary.

This required two main changes:
1. `innermost_enclosing_bracket_ranges` and `enclosing_bracket_ranges`
were moved into `Buffer`. The `MultiBuffer` implementations were updated
to map to/from these.
2. `MultiBuffer::excerpt_containing` was made public, returning a new
`MultiBufferExcerpt` type that contains a reference to the excerpt and
methods for mapping to/from `Buffer` and `MultiBuffer` offsets and
ranges.

Release Notes:
- Added new `argument` vim text object, inspired by
[targets.vim](https://github.com/wellle/targets.vim).
```

## Parents

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

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