input: Move caret to line start or end with selected content (#288)

Ref: https://support.apple.com/en-hk/102650

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
This commit is contained in:
ihavecoke 2024-10-02 17:35:27 +08:00 committed by GitHub
parent b9e7217662
commit 20b9f9c0f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,6 +77,10 @@ pub fn init(cx: &mut AppContext) {
KeyBinding::new("shift-home", SelectToHome, Some(CONTEXT)),
KeyBinding::new("shift-end", SelectToEnd, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("shift-cmd-left", SelectToHome, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("shift-cmd-right", SelectToEnd, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("ctrl-cmd-space", ShowCharacterPalette, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("cmd-a", SelectAll, Some(CONTEXT)),
@ -97,8 +101,12 @@ pub fn init(cx: &mut AppContext) {
#[cfg(target_os = "macos")]
KeyBinding::new("ctrl-a", Home, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("cmd-left", Home, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("ctrl-e", End, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("cmd-right", End, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("cmd-z", Undo, Some(CONTEXT)),
#[cfg(target_os = "macos")]
KeyBinding::new("cmd-shift-z", Redo, Some(CONTEXT)),