# editor: Place added cursors by tab-expanded column \(\#61153\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b5e03c7b0302894ac7a57d233be8d03dc9c81223

Requested commit: b5e03c7b0302894ac7a57d233be8d03dc9c81223

Commit: b5e03c7b0302894ac7a57d233be8d03dc9c81223

Tree: 8a0bfd6a8c2d604bbbe95966990d0ef97202e61c

Author: Apoorva Verma

Committer: GitHub

## Message

````
editor: Place added cursors by tab-expanded column (#61153)

with `hard_tabs: true` and `tab_size: 4`, shift-alt-down off a
tab-aligned column drops the cursor in the wrong spot:

```
      current.rgb.r         ˇ= p[0] >> 8;      <- cursor here
      residuals[run].rˇgb.r  = p[0] & 0xff;    <- lands here, not on the =
```

both `=` render at column 48 but sit at buffer columns 22 and 27, since
a different number of tabs pads each row. shift-alt-down is
`skip_soft_wrap: true`, which placed the cursor by utf16 column where a
tab counts as one.

so count the column with tabs expanded instead. still a column and not a
pixel position, so the buffer-column behaviour
`test_add_selection_skip_soft_wrap_option` pins doesn't change (without
tabs the expanded column *is* the buffer column). tried pixels first and
it breaks that test, since x is measured inside a wrapped segment.

heads up that the existing tests here all pass `Default::default()`,
which is `skip_soft_wrap: false` (the `default_true` only applies to
deserializing), so nothing covered the branch the keybinding actually
uses.

Closes #60752.

Release Notes:

- Fixed added cursors landing in the wrong column when using tabs to
align code
````

## Parents

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

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