|
|
@ -440,7 +440,8 @@ impl MappableCommand {
|
|
|
|
shrink_selection, "Shrink selection to previously expanded syntax node",
|
|
|
|
shrink_selection, "Shrink selection to previously expanded syntax node",
|
|
|
|
select_next_sibling, "Select next sibling in the syntax tree",
|
|
|
|
select_next_sibling, "Select next sibling in the syntax tree",
|
|
|
|
select_prev_sibling, "Select previous sibling the in syntax tree",
|
|
|
|
select_prev_sibling, "Select previous sibling the in syntax tree",
|
|
|
|
select_all_siblings, "Select all siblings in the syntax tree",
|
|
|
|
select_all_siblings, "Select all siblings of the current node",
|
|
|
|
|
|
|
|
select_all_children, "Select all children of the current node",
|
|
|
|
jump_forward, "Jump forward on jumplist",
|
|
|
|
jump_forward, "Jump forward on jumplist",
|
|
|
|
jump_backward, "Jump backward on jumplist",
|
|
|
|
jump_backward, "Jump backward on jumplist",
|
|
|
|
save_selection, "Save current selection to jumplist",
|
|
|
|
save_selection, "Save current selection to jumplist",
|
|
|
@ -4991,6 +4992,23 @@ fn select_all_siblings(cx: &mut Context) {
|
|
|
|
cx.editor.apply_motion(motion);
|
|
|
|
cx.editor.apply_motion(motion);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn select_all_children(cx: &mut Context) {
|
|
|
|
|
|
|
|
let motion = |editor: &mut Editor| {
|
|
|
|
|
|
|
|
let (view, doc) = current!(editor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let Some(syntax) = doc.syntax() {
|
|
|
|
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
|
|
|
|
let current_selection = doc.selection(view.id);
|
|
|
|
|
|
|
|
let selection =
|
|
|
|
|
|
|
|
object::select_all_children(syntax.tree(), text, current_selection.clone());
|
|
|
|
|
|
|
|
doc.set_selection(view.id, selection);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
motion(cx.editor);
|
|
|
|
|
|
|
|
cx.editor.last_motion = Some(Motion(Box::new(motion)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn match_brackets(cx: &mut Context) {
|
|
|
|
fn match_brackets(cx: &mut Context) {
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let is_select = cx.editor.mode == Mode::Select;
|
|
|
|
let is_select = cx.editor.mode == Mode::Select;
|
|
|
|