|
|
@ -905,10 +905,11 @@ fn move_next_long_word_end(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
fn move_para_impl<F>(cx: &mut Context, move_fn: F)
|
|
|
|
fn move_para_impl<F>(cx: &mut Context, move_fn: F)
|
|
|
|
where
|
|
|
|
where
|
|
|
|
F: Fn(RopeSlice, Range, usize, Movement) -> Range,
|
|
|
|
F: Fn(RopeSlice, Range, usize, Movement) -> Range + 'static,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let count = cx.count();
|
|
|
|
let count = cx.count();
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let motion = move |editor: &mut Editor| {
|
|
|
|
|
|
|
|
let (view, doc) = current!(editor);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let behavior = if doc.mode == Mode::Select {
|
|
|
|
let behavior = if doc.mode == Mode::Select {
|
|
|
|
Movement::Extend
|
|
|
|
Movement::Extend
|
|
|
@ -921,6 +922,9 @@ where
|
|
|
|
.clone()
|
|
|
|
.clone()
|
|
|
|
.transform(|range| move_fn(text, range, count, behavior));
|
|
|
|
.transform(|range| move_fn(text, range, count, behavior));
|
|
|
|
doc.set_selection(view.id, selection);
|
|
|
|
doc.set_selection(view.id, selection);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
motion(cx.editor);
|
|
|
|
|
|
|
|
cx.editor.last_motion = Some(Motion(Box::new(motion)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn move_prev_paragraph(cx: &mut Context) {
|
|
|
|
fn move_prev_paragraph(cx: &mut Context) {
|
|
|
|