Add emacs mark mode (#23297)

Updates #21927
Replaces https://github.com/zed-industries/zed/pull/22904
Closes #8580

Adds actions (default keybinds with emacs keymap):
- editor::SetMark (`ctrl-space` and `ctrl-@`)
- editor::ExchangeMark (`ctrl-x ctrl-x`)

Co-Authored-By: Peter <peter@zed.dev>

Release Notes:

- Add Emacs mark mode (`ctrl-space` / `ctrl-@` to set mark; `ctrl-x
ctrl-x` to swap mark/cursor)
- Breaking change: `selection` keyboard context has been replaced with
`selection_mode`

---------

Co-authored-by: Peter <peter@zed.dev>
This commit is contained in:
Conrad Irwin 2025-01-21 08:18:25 -07:00 committed by GitHub
parent c4542ca731
commit 94189e1784
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 10 deletions

View file

@ -356,6 +356,8 @@ impl EditorElement {
register_action(view, cx, Editor::unfold_all);
register_action(view, cx, Editor::unfold_at);
register_action(view, cx, Editor::fold_selected_ranges);
register_action(view, cx, Editor::set_mark);
register_action(view, cx, Editor::exchange_mark);
register_action(view, cx, Editor::show_completions);
register_action(view, cx, Editor::toggle_code_actions);
register_action(view, cx, Editor::open_excerpts);