zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
48.88k stars 2.94k forks source link

`editor::SelectToBeginningOfLine` behaves differently than `editor::MoveToBeginningOfLine` #16340

Open daytonn opened 2 months ago

daytonn commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

The behavior of editor::MoveToBeginningOfLine puts the cursor at the begining of non-whitespace characters in the line. This is handy because most of the time you do not wish to include indents in this operation. The editor::SelectToBeginningOfLine does not mirror this behavior. Instead it actually selects to the begining of line. This is inconvenient because it requires more keystrokes to de-select the indentation. I'm not sure if this is by design but it seems like they should behave similarly.

Environment

Zed: v0.148.1 (Zed) OS: Linux X11 zorin 17 Memory: 125.7 GiB Architecture: x86_64 GPU: NVIDIA GeForce RTX 4080 || NVIDIA || 535.183.01

If applicable, add mockups / screenshots to help explain present your vision of the feature

Peek 2024-08-15 22-59

If applicable, attach your Zed.log file to this issue.

Zed.log


neunato commented 2 months ago

You can control that behaviour with stop_at_soft_wraps:

"ctrl-shift-a": ["editor::SelectToBeginningOfLine", { "stop_at_soft_wraps": true }]
daytonn commented 2 months ago

@neunato Thanks for posting that config. That definitely fixes my issue. :1st_place_medal: