on master help sign in
Rename paragraph motion commands from move to goto (#2226)

* fix command name for next/prev paragraph motion * rename move_next/prev_paragraph to goto_next/prev_paragraph

commit3f2bd7770e9cdbb57c139ef950e2d63ccf8ac674 authorMichael Davis <mcarsondavis@gmail.com> dateSat 23 Apr 2022, 20:48 (5 years ago) parent5ca8dfe
2 files changed+9−9
helix-term/src/commands.rs+7−7 helix-term/src/keymap/default.rs+2−2
helix-term/src/commands.rs+7−7
@@ -209,8 +209,6 @@ impl MappableCommand {
209209 move_next_long_word_start, "Move to beginning of next long word",
210210 move_prev_long_word_start, "Move to beginning of previous long word",
211211 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",
214212 extend_next_word_start, "Extend to beginning of next word",
215213 extend_prev_word_start, "Extend to beginning of previous word",
216214 extend_next_long_word_start, "Extend to beginning of next long word",
@@ -390,6 +388,8 @@ impl MappableCommand {
390388 goto_prev_parameter, "Goto previous parameter",
391389 goto_next_comment, "Goto next comment",
392390 goto_prev_comment, "Goto previous comment",
391+ goto_next_paragraph, "Goto next paragraph",
392+ goto_prev_paragraph, "Goto previous paragraph",
393393 dap_launch, "Launch debug target",
394394 dap_toggle_breakpoint, "Toggle breakpoint",
395395 dap_continue, "Continue program execution",
@@ -922,7 +922,7 @@ fn move_next_long_word_end(cx: &mut Context) {
922922 move_word_impl(cx, movement::move_next_long_word_end)
923923}
924924
925−fn move_para_impl<F>(cx: &mut Context, move_fn: F)
925+fn goto_para_impl<F>(cx: &mut Context, move_fn: F)
926926where
927927 F: Fn(RopeSlice, Range, usize, Movement) -> Range + 'static,
928928{
@@ -946,12 +946,12 @@ where
946946 cx.editor.last_motion = Some(Motion(Box::new(motion)));
947947}
948948
949−fn move_prev_paragraph(cx: &mut Context) {
950− move_para_impl(cx, movement::move_prev_paragraph)
949+fn goto_prev_paragraph(cx: &mut Context) {
950+ goto_para_impl(cx, movement::move_prev_paragraph)
951951}
952952
953−fn move_next_paragraph(cx: &mut Context) {
954− move_para_impl(cx, movement::move_next_paragraph)
953+fn goto_next_paragraph(cx: &mut Context) {
954+ goto_para_impl(cx, movement::move_next_paragraph)
955955}
956956
957957fn goto_file_start(cx: &mut Context) {
helix-term/src/keymap/default.rs+2−2
@@ -104,7 +104,7 @@ pub fn default() -> HashMap<Mode, Keymap> {
104104 "c" => goto_prev_class,
105105 "a" => goto_prev_parameter,
106106 "o" => goto_prev_comment,
107− "p" => move_prev_paragraph,
107+ "p" => goto_prev_paragraph,
108108 "space" => add_newline_above,
109109 },
110110 "]" => { "Right bracket"
@@ -114,7 +114,7 @@ pub fn default() -> HashMap<Mode, Keymap> {
114114 "c" => goto_next_class,
115115 "a" => goto_next_parameter,
116116 "o" => goto_next_comment,
117− "p" => move_next_paragraph,
117+ "p" => goto_next_paragraph,
118118 "space" => add_newline_below,
119119 },
120120