# vim: Fix insert above auto-indentation \(\#52594\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c6e0868cb8f2431938843c75dc37c44280267d53

Requested commit: c6e0868cb8f2431938843c75dc37c44280267d53

Commit: c6e0868cb8f2431938843c75dc37c44280267d53

Tree: c597a19e4df8917a0596cbf46625c905e3985ebf

Author: William Whittaker

Committer: GitHub

## Message

```
vim: Fix insert above auto-indentation (#52594)

Fixes InsertLineAbove (Shift + O) auto-indent handling by deciding
whether to trim the first character or the last character based on
direction. Previously, inserting a line above would auto format the line
the cursor was originally on and not the new line (instead of the
correct behavior which is to do the opposite).

No tests because I couldn't find any Vim-specific auto-indent tests and
this only affects Vim mode. If I'm missing something there LMK and I'll
take a closer look.

Closes #52588.

Release Notes:

- Vim: Fixed auto-indentation for insert above action.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
```

## Parents

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

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