vim: Prevent around word operations from selecting indentation (#24635)

Closes https://github.com/zed-industries/zed/issues/15323

Changes:
Added check for first word on line

Tested `v/c/d/y aw`. Matches standard neovim.

|initial|old|new|
|---|---|---|

|![image](https://github.com/user-attachments/assets/725b74e6-3aa0-40dc-9fd2-4d2b593e9926)|![image](https://github.com/user-attachments/assets/eeebd267-b4c6-4ea6-bb9a-fb913614754c)|![image](https://github.com/user-attachments/assets/fb695e54-b4c2-44a6-a588-909c1fd415e0)



Release Notes:

- vim: Prevent around word operations from selecting indentation
This commit is contained in:
5brian
2025-02-11 11:35:59 -07:00
committed by GitHub
parent 7378ab9ba5
commit 0a146793ea
2 changed files with 74 additions and 2 deletions
@@ -0,0 +1,23 @@
{"Put":{"state":" ˇconst f = (x: unknown) => {"}}
{"Key":"v"}
{"Key":"a"}
{"Key":"w"}
{"Get":{"state":" «const ˇ»f = (x: unknown) => {","mode":"Visual"}}
{"Put":{"state":" ˇconst f = (x: unknown) => {"}}
{"Key":"y"}
{"Key":"a"}
{"Key":"w"}
{"Get":{"state":" ˇconst f = (x: unknown) => {","mode":"Normal"}}
{"ReadRegister":{"name":"\"","value":"const "}}
{"Put":{"state":" ˇconst f = (x: unknown) => {"}}
{"Key":"d"}
{"Key":"a"}
{"Key":"w"}
{"Get":{"state":" ˇf = (x: unknown) => {","mode":"Normal"}}
{"ReadRegister":{"name":"\"","value":"const "}}
{"Put":{"state":" ˇconst f = (x: unknown) => {"}}
{"Key":"c"}
{"Key":"a"}
{"Key":"w"}
{"Get":{"state":" ˇf = (x: unknown) => {","mode":"Insert"}}
{"ReadRegister":{"name":"\"","value":"const "}}