on master help sign in
Rename paragraph motion commands from move to goto (#2226)
3f2bd77Michael Davis
helix-term/src/commands.rs+7−7
@@ -209,8 +209,6 @@ impl MappableCommand {
209 move_next_long_word_start, "Move to beginning of next long word",
209 move_next_long_word_start, "Move to beginning of next long word",
210 move_prev_long_word_start, "Move to beginning of previous long word",
210 move_prev_long_word_start, "Move to beginning of previous long word",
211 move_next_long_word_end, "Move to end of next long word",
211 move_next_long_word_end, "Move to end of next long word",
212− move_prev_paragraph, "Move to previous paragraph",
213− move_next_paragraph, "Move to next paragraph",
214 extend_next_word_start, "Extend to beginning of next word",
212 extend_next_word_start, "Extend to beginning of next word",
215 extend_prev_word_start, "Extend to beginning of previous word",
213 extend_prev_word_start, "Extend to beginning of previous word",
216 extend_next_long_word_start, "Extend to beginning of next long word",
214 extend_next_long_word_start, "Extend to beginning of next long word",
@@ -390,6 +388,8 @@ impl MappableCommand {
390 goto_prev_parameter, "Goto previous parameter",
388 goto_prev_parameter, "Goto previous parameter",
391 goto_next_comment, "Goto next comment",
389 goto_next_comment, "Goto next comment",
392 goto_prev_comment, "Goto previous comment",
390 goto_prev_comment, "Goto previous comment",
391+ goto_next_paragraph, "Goto next paragraph",
392+ goto_prev_paragraph, "Goto previous paragraph",
393 dap_launch, "Launch debug target",
393 dap_launch, "Launch debug target",
394 dap_toggle_breakpoint, "Toggle breakpoint",
394 dap_toggle_breakpoint, "Toggle breakpoint",
395 dap_continue, "Continue program execution",
395 dap_continue, "Continue program execution",
@@ -922,7 +922,7 @@ fn move_next_long_word_end(cx: &mut Context) {
922 move_word_impl(cx, movement::move_next_long_word_end)
922 move_word_impl(cx, movement::move_next_long_word_end)
923}
923}
924
924
925−fn move_para_impl<F>(cx: &mut Context, move_fn: F)
925+fn goto_para_impl<F>(cx: &mut Context, move_fn: F)
926where
926where
927 F: Fn(RopeSlice, Range, usize, Movement) -> Range + 'static,
927 F: Fn(RopeSlice, Range, usize, Movement) -> Range + 'static,
928{
928{
@@ -946,12 +946,12 @@ where
946 cx.editor.last_motion = Some(Motion(Box::new(motion)));
946 cx.editor.last_motion = Some(Motion(Box::new(motion)));
947}
947}
948
948
949−fn move_prev_paragraph(cx: &mut Context) {
949+fn goto_prev_paragraph(cx: &mut Context) {
950− move_para_impl(cx, movement::move_prev_paragraph)
950+ goto_para_impl(cx, movement::move_prev_paragraph)
951}
951}
952
952
953−fn move_next_paragraph(cx: &mut Context) {
953+fn goto_next_paragraph(cx: &mut Context) {
954− move_para_impl(cx, movement::move_next_paragraph)
954+ goto_para_impl(cx, movement::move_next_paragraph)
955}
955}
956
956
957fn goto_file_start(cx: &mut Context) {
957fn goto_file_start(cx: &mut Context) {
helix-term/src/keymap/default.rs+2−2
@@ -104,7 +104,7 @@ pub fn default() -> HashMap<Mode, Keymap> {
104 "c" => goto_prev_class,
104 "c" => goto_prev_class,
105 "a" => goto_prev_parameter,
105 "a" => goto_prev_parameter,
106 "o" => goto_prev_comment,
106 "o" => goto_prev_comment,
107− "p" => move_prev_paragraph,
107+ "p" => goto_prev_paragraph,
108 "space" => add_newline_above,
108 "space" => add_newline_above,
109 },
109 },
110 "]" => { "Right bracket"
110 "]" => { "Right bracket"
@@ -114,7 +114,7 @@ pub fn default() -> HashMap<Mode, Keymap> {
114 "c" => goto_next_class,
114 "c" => goto_next_class,
115 "a" => goto_next_parameter,
115 "a" => goto_next_parameter,
116 "o" => goto_next_comment,
116 "o" => goto_next_comment,
117− "p" => move_next_paragraph,
117+ "p" => goto_next_paragraph,
118 "space" => add_newline_below,
118 "space" => add_newline_below,
119 },
119 },
120
120