Add home and end key support
This commit is contained in:
@@ -67,9 +67,11 @@
|
|||||||
"up": "editor::MoveUp",
|
"up": "editor::MoveUp",
|
||||||
"pageup": "editor::PageUp",
|
"pageup": "editor::PageUp",
|
||||||
"shift-pageup": "editor::MovePageUp",
|
"shift-pageup": "editor::MovePageUp",
|
||||||
|
"home": "editor::MoveToBeginningOfLine",
|
||||||
"down": "editor::MoveDown",
|
"down": "editor::MoveDown",
|
||||||
"pagedown": "editor::PageDown",
|
"pagedown": "editor::PageDown",
|
||||||
"shift-pagedown": "editor::MovePageDown",
|
"shift-pagedown": "editor::MovePageDown",
|
||||||
|
"end": "editor::MoveToEndOfLine",
|
||||||
"left": "editor::MoveLeft",
|
"left": "editor::MoveLeft",
|
||||||
"right": "editor::MoveRight",
|
"right": "editor::MoveRight",
|
||||||
"ctrl-p": "editor::MoveUp",
|
"ctrl-p": "editor::MoveUp",
|
||||||
@@ -110,6 +112,12 @@
|
|||||||
"stop_at_soft_wraps": true
|
"stop_at_soft_wraps": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"shift-home": [
|
||||||
|
"editor::SelectToBeginningOfLine",
|
||||||
|
{
|
||||||
|
"stop_at_soft_wraps": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"ctrl-shift-a": [
|
"ctrl-shift-a": [
|
||||||
"editor::SelectToBeginningOfLine",
|
"editor::SelectToBeginningOfLine",
|
||||||
{
|
{
|
||||||
@@ -122,6 +130,12 @@
|
|||||||
"stop_at_soft_wraps": true
|
"stop_at_soft_wraps": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"shift-end": [
|
||||||
|
"editor::SelectToEndOfLine",
|
||||||
|
{
|
||||||
|
"stop_at_soft_wraps": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"ctrl-shift-e": [
|
"ctrl-shift-e": [
|
||||||
"editor::SelectToEndOfLine",
|
"editor::SelectToEndOfLine",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ pub fn key_to_native(key: &str) -> Cow<str> {
|
|||||||
"right" => NSRightArrowFunctionKey,
|
"right" => NSRightArrowFunctionKey,
|
||||||
"pageup" => NSPageUpFunctionKey,
|
"pageup" => NSPageUpFunctionKey,
|
||||||
"pagedown" => NSPageDownFunctionKey,
|
"pagedown" => NSPageDownFunctionKey,
|
||||||
|
"home" => NSHomeFunctionKey,
|
||||||
|
"end" => NSEndFunctionKey,
|
||||||
"delete" => NSDeleteFunctionKey,
|
"delete" => NSDeleteFunctionKey,
|
||||||
"f1" => NSF1FunctionKey,
|
"f1" => NSF1FunctionKey,
|
||||||
"f2" => NSF2FunctionKey,
|
"f2" => NSF2FunctionKey,
|
||||||
@@ -258,6 +260,8 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke {
|
|||||||
Some(NSRightArrowFunctionKey) => "right".to_string(),
|
Some(NSRightArrowFunctionKey) => "right".to_string(),
|
||||||
Some(NSPageUpFunctionKey) => "pageup".to_string(),
|
Some(NSPageUpFunctionKey) => "pageup".to_string(),
|
||||||
Some(NSPageDownFunctionKey) => "pagedown".to_string(),
|
Some(NSPageDownFunctionKey) => "pagedown".to_string(),
|
||||||
|
Some(NSHomeFunctionKey) => "home".to_string(),
|
||||||
|
Some(NSEndFunctionKey) => "end".to_string(),
|
||||||
Some(NSDeleteFunctionKey) => "delete".to_string(),
|
Some(NSDeleteFunctionKey) => "delete".to_string(),
|
||||||
Some(NSF1FunctionKey) => "f1".to_string(),
|
Some(NSF1FunctionKey) => "f1".to_string(),
|
||||||
Some(NSF2FunctionKey) => "f2".to_string(),
|
Some(NSF2FunctionKey) => "f2".to_string(),
|
||||||
|
|||||||
Reference in New Issue
Block a user