|
|
@ -297,9 +297,11 @@ pub fn split_selection(cx: &mut Context) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
cx.callback = Some(Box::new(move |compositor: &mut Compositor| {
|
|
|
|
cx.callback = Some(Box::new(
|
|
|
|
|
|
|
|
move |compositor: &mut Compositor, editor: &mut Editor| {
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn split_selection_on_newline(cx: &mut Context) {
|
|
|
|
pub fn split_selection_on_newline(cx: &mut Context) {
|
|
|
@ -399,7 +401,8 @@ pub fn append_mode(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: I, A, o and O can share a lot of the primitives.
|
|
|
|
// TODO: I, A, o and O can share a lot of the primitives.
|
|
|
|
pub fn command_mode(cx: &mut Context) {
|
|
|
|
pub fn command_mode(cx: &mut Context) {
|
|
|
|
cx.callback = Some(Box::new(|compositor: &mut Compositor| {
|
|
|
|
cx.callback = Some(Box::new(
|
|
|
|
|
|
|
|
|compositor: &mut Compositor, editor: &mut Editor| {
|
|
|
|
let prompt = Prompt::new(
|
|
|
|
let prompt = Prompt::new(
|
|
|
|
":".to_owned(),
|
|
|
|
":".to_owned(),
|
|
|
|
|_input: &str| {
|
|
|
|
|_input: &str| {
|
|
|
@ -461,13 +464,25 @@ pub fn command_mode(cx: &mut Context) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pub fn file_picker(cx: &mut Context) {
|
|
|
|
pub fn file_picker(cx: &mut Context) {
|
|
|
|
cx.callback = Some(Box::new(|compositor: &mut Compositor| {
|
|
|
|
cx.callback = Some(Box::new(
|
|
|
|
|
|
|
|
|compositor: &mut Compositor, editor: &mut Editor| {
|
|
|
|
let picker = ui::file_picker("./");
|
|
|
|
let picker = ui::file_picker("./");
|
|
|
|
compositor.push(Box::new(picker));
|
|
|
|
compositor.push(Box::new(picker));
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn buffer_picker(cx: &mut Context) {
|
|
|
|
|
|
|
|
cx.callback = Some(Box::new(
|
|
|
|
|
|
|
|
|compositor: &mut Compositor, editor: &mut Editor| {
|
|
|
|
|
|
|
|
let picker = ui::buffer_picker(&editor.views, editor.focus);
|
|
|
|
|
|
|
|
compositor.push(Box::new(picker));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// calculate line numbers for each selection range
|
|
|
|
// calculate line numbers for each selection range
|
|
|
|