|
|
@ -1805,7 +1805,7 @@ fn search_selection(cx: &mut Context) {
|
|
|
|
.join("|");
|
|
|
|
.join("|");
|
|
|
|
|
|
|
|
|
|
|
|
let msg = format!("register '{}' set to '{}'", '/', ®ex);
|
|
|
|
let msg = format!("register '{}' set to '{}'", '/', ®ex);
|
|
|
|
cx.editor.registers.get_mut('/').push(regex);
|
|
|
|
cx.editor.registers.push('/', regex);
|
|
|
|
cx.editor.set_status(msg);
|
|
|
|
cx.editor.set_status(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2121,16 +2121,14 @@ enum Operation {
|
|
|
|
fn delete_selection_impl(cx: &mut Context, op: Operation) {
|
|
|
|
fn delete_selection_impl(cx: &mut Context, op: Operation) {
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
|
|
|
|
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
|
|
|
|
|
|
|
|
|
if cx.register != Some('_') {
|
|
|
|
if cx.register != Some('_') {
|
|
|
|
// first yank the selection
|
|
|
|
// first yank the selection
|
|
|
|
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let values: Vec<String> = selection.fragments(text).map(Cow::into_owned).collect();
|
|
|
|
let values: Vec<String> = selection.fragments(text).map(Cow::into_owned).collect();
|
|
|
|
let reg_name = cx.register.unwrap_or('"');
|
|
|
|
let reg_name = cx.register.unwrap_or('"');
|
|
|
|
let registers = &mut cx.editor.registers;
|
|
|
|
cx.editor.registers.write(reg_name, values);
|
|
|
|
let reg = registers.get_mut(reg_name);
|
|
|
|
|
|
|
|
reg.write(values);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// then delete
|
|
|
|
// then delete
|
|
|
@ -5005,7 +5003,7 @@ fn record_macro(cx: &mut Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect::<String>();
|
|
|
|
.collect::<String>();
|
|
|
|
cx.editor.registers.get_mut(reg).write(vec![s]);
|
|
|
|
cx.editor.registers.write(reg, vec![s]);
|
|
|
|
cx.editor
|
|
|
|
cx.editor
|
|
|
|
.set_status(format!("Recorded to register [{}]", reg));
|
|
|
|
.set_status(format!("Recorded to register [{}]", reg));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|