# Make 'wrap selections in tag' work with line selection mode \(\#41030\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 1d0bb5a7a63b23788df07321bf201cf874ef64a6

Requested commit: 1d0bb5a7a63b23788df07321bf201cf874ef64a6

Commit: 1d0bb5a7a63b23788df07321bf201cf874ef64a6

Tree: 039fc1be89a0301deafe251ee541071cfdde5dcb

Author: Lukas

Committer: GitHub

## Message

```
Make 'wrap selections in tag' work with line selection mode (#41030)

The `wrap selections in tag` action currently did not take line_mode
into account, which means when selecting lines with `shift-v`, the
start/end tags would be inserted into the middle of the selection (where
the cursor sits)


https://github.com/user-attachments/assets/a1cbf3da-d52a-42e2-aecf-1a7b6d1dbb32

This PR fixes this behaviour by checking if the selection uses line_mode
and then adjusting start and end points accordingly.

NOTE: I looked into amending the test cases for this, but I am unsure
how to express line mode with range markers. I would appreciate some
guidance on this and then I am happy to add test cases.

After:


https://github.com/user-attachments/assets/a212c41f-b0db-4f50-866f-fced7bc677ca

Release Notes:

- Fixed `Editor: wrap selection in tags` when in vim visual line mode

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
```

## Parents

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

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