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

Keyboard end does not go at the end but at first line end of wrap #10888

Closed
1 task done
williamdes opened this issue Apr 23, 2024 · 3 comments · Fixed by #11153
Closed
1 task done

Keyboard end does not go at the end but at first line end of wrap #10888

williamdes opened this issue Apr 23, 2024 · 3 comments · Fixed by #11153
Labels
defect [core label] editor Feedback for code editing, formatting, editor iterations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc linux

Comments

@williamdes
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

image

As shown here
It should go to the end of the wrap when I hit Fin (End) on my keyboard.
Vscode works fine with this behavior. I guess this is an implementation bug.

  "soft_wrap": "preferred_line_length",
  "preferred_line_length": 180,

Environment

Zed: v1.0.0 (Zed Dev a0fa8a4)
OS: Debian 12
Memory: 62.4 GiB
Architecture: x86_64

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

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@williamdes williamdes added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Apr 23, 2024
@Moshyfawn Moshyfawn added editor Feedback for code editing, formatting, editor iterations, etc linux keymap / key binding Feedback for keyboard shortcuts, key mapping, etc and removed triage Maintainer needs to classify the issue labels Apr 23, 2024
@JosephTLyons JosephTLyons removed the admin read Pending admin review label Apr 24, 2024
@tverghis
Copy link
Contributor

Hi! I'd like to work on this issue.

@tverghis
Copy link
Contributor

tverghis commented Apr 29, 2024

I believe the issue is Editor::move_to_{beginning|end}_of_line always stop at soft-wraps. Should this be made configurable, like it is for Editor::select_to_{beginning|end}_of_line? If so, should the default (if un-configured) retain the existing behavior?

SomeoneToIgnore added a commit that referenced this issue May 2, 2024
Release Notes:

- Fixed #10888

This patch addresses behavior of
`Editor::move_to_{beginning|end}_of_line`. It adds a setting,
`stop_at_soft_wraps` when defining a keymap for the
`editor::MoveToBeginningOfLine` and `editor::MoveToEndOfLine` actions.
When `true`, it causes movement to the either end of the line (via, for
example Home or End), to go to the logical end, as opposed to the
nearest soft wrap point in the respective direction.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
@williamdes
Copy link
Contributor Author

The keybindings stuff is not that intuitive to edit, but here is how to make this setting work:
In: ~/.config/zed/keymap.json

[
  // Bindings from VS Code
  {
    "context": "Editor",
    "bindings": {
      "end":  [
         "editor::MoveToEndOfLine",
         {
           "stop_at_soft_wraps": false
         }
      ],
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] editor Feedback for code editing, formatting, editor iterations, etc keymap / key binding Feedback for keyboard shortcuts, key mapping, etc linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants