Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Beginning of Line and Beginning of None Whitespace Character #7863

Open
1 task done
wmstack opened this issue Feb 15, 2024 · 2 comments · May be fixed by #25346
Open
1 task done

Separate Beginning of Line and Beginning of None Whitespace Character #7863

wmstack opened this issue Feb 15, 2024 · 2 comments · May be fixed by #25346
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] good first issue Issue suitable for first-time contributors

Comments

@wmstack
Copy link
Contributor

wmstack commented Feb 15, 2024

Check for existing issues

  • Completed

Describe the feature

Currently Zed's editor::moveToBeginningOfLine moves to the first none-whitespace character in the line, while editor::deleteToBeginningOfLine doesn't but deletes to the true beginning of the line including indentation whitespace

This means there is no command to delete to the first none-whitespace character. Also these two commands look similar but have different behaviours when it comes to choosing what the beginning of the line is.

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

No response

@wmstack wmstack added admin read feature [core label] labels Feb 15, 2024
@wmstack
Copy link
Contributor Author

wmstack commented Feb 16, 2024

I want to add that d ^ in zed vim will delete to the first none-whitespace character, but using the deleteToBeginningOfLine will delete to the first character in the line.

@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc and removed triage labels Feb 20, 2024
@nathansobo nathansobo added the good first issue Issue suitable for first-time contributors label Jan 30, 2025
@nathansobo
Copy link
Contributor

This makes sense as an improvement. We could add a stop_at_first_char: bool field to the movement and deletion commands to allow this behavior to be parameterized in both cases and make the actions consistent. I agree that similar names should yield similar behavior.

felixpackard added a commit to felixpackard/zed that referenced this issue Feb 21, 2025
make move/select/delete to beginning of line actions consistent with other beginning of line actions by adding a `stop_at_first_char` option

closes zed-industries#7863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] good first issue Issue suitable for first-time contributors
Projects
None yet
3 participants