# editor: Fix multi-cursor not added to lines shorter than current cursor column \(\#31100\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6bbab4b55a0e95aaeb65da0f20890b912caa939e

Requested commit: 6bbab4b55a0e95aaeb65da0f20890b912caa939e

Commit: 6bbab4b55a0e95aaeb65da0f20890b912caa939e

Tree: 19a70daeac09937e21c6575991c99d7aa976100f

Author: smit

Committer: GitHub

## Message

```
editor: Fix multi-cursor not added to lines shorter than current cursor column (#31100)

Closes #5255, #1046, #28322, #15728

This PR makes `AddSelectionBelow` and `AddSelectionAbove` not skip lines
that are shorter than the current cursor column. This follows the same
behavior as VSCode and Sublime.

This change is only applicable in the case of an empty selection; if
there is a non-empty selection, it continues to skip empty and shorter
lines to create a Vim-like column selection, which is the better default
for that case.

- [x] Tests

The empty selection no longer skips shorter lines:


https://github.com/user-attachments/assets/4bde2357-20b6-44f2-a9d9-b595c12d3939

Non-empty selection continues to skip shorter lines.


https://github.com/user-attachments/assets/4cd47c9f-b698-40fc-ad50-f2bf64f5519b

Release Notes:

- Improved `AddSelectionBelow` and `AddSelectionAbove` to no longer skip
shorter lines when the selection is empty, aligning with VSCode and
Sublime behavior.
```

## Parents

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

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