Skip to content

DeleteToPreviousWordStart/DeleteToPreviousSubwordStart when used on an empty line deletes from previous line. #9140

@tlaaaa

Description

@tlaaaa

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Using any of these shortcuts which delete entire words/subwords on an empty line deletes content from the previous line as well.

Expected behaviour: deletes in a way similar to DeleteToEndOfLine, where if used on an empty line simply deletes that line and leaves the previous line untouched.

eg.

      "alt-d": "editor::DeleteToNextWordEnd",
~
      "cmd-x": "editor::Cut",
      "cmd-c": "editor::Copy", 

If the cursor is placed at the tilda (replacing it), using a DeleteToPreviousWordStart results in

      "alt-d": "editor::DeleteToNextWordEnd
      "cmd-x": "editor::Cut",
      "cmd-c": "editor::Copy", 

and not

      "alt-d": "editor::DeleteToNextWordEnd",
      "cmd-x": "editor::Cut",
      "cmd-c": "editor::Copy", 

as expected.

I imagine this is not intended as this behaviour is different from all other text editors I've used!

Environment

Zed: v0.125.3 (Zed)
OS: macOS 14.2.0
Memory: 8 GiB
Architecture: aarch64

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:controls/keybindsKeyboard shortcuts, mapping, binding, keymaps, etcarea:editorFeedback for code editing, formatting, editor iterations, etcbugDEPRECATED label: use issue type 'Bug' insteadstaleLabel used by `stale` action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions