|
|
@ -3632,11 +3632,7 @@ fn wclose(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
fn select_register(cx: &mut Context) {
|
|
|
|
fn select_register(cx: &mut Context) {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
if let KeyEvent {
|
|
|
|
if let Some(ch) = event.char() {
|
|
|
|
code: KeyCode::Char(ch),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
} = event
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cx.editor.selected_register.select(ch);
|
|
|
|
cx.editor.selected_register.select(ch);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -3687,11 +3683,7 @@ fn select_textobject_inner(cx: &mut Context) {
|
|
|
|
fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
|
|
|
|
fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
|
|
|
|
let count = cx.count();
|
|
|
|
let count = cx.count();
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
if let KeyEvent {
|
|
|
|
if let Some(ch) = event.char() {
|
|
|
|
code: KeyCode::Char(ch),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
} = event
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
|
|
|
|
|
|
|
@ -3713,11 +3705,7 @@ fn select_textobject(cx: &mut Context, objtype: textobject::TextObject) {
|
|
|
|
|
|
|
|
|
|
|
|
fn surround_add(cx: &mut Context) {
|
|
|
|
fn surround_add(cx: &mut Context) {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
if let KeyEvent {
|
|
|
|
if let Some(ch) = event.char() {
|
|
|
|
code: KeyCode::Char(ch),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
} = event
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
@ -3743,17 +3731,9 @@ fn surround_add(cx: &mut Context) {
|
|
|
|
fn surround_replace(cx: &mut Context) {
|
|
|
|
fn surround_replace(cx: &mut Context) {
|
|
|
|
let count = cx.count();
|
|
|
|
let count = cx.count();
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
if let KeyEvent {
|
|
|
|
if let Some(from) = event.char() {
|
|
|
|
code: KeyCode::Char(from),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
} = event
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
if let KeyEvent {
|
|
|
|
if let Some(to) = event.char() {
|
|
|
|
code: KeyCode::Char(to),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
} = event
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
@ -3783,11 +3763,7 @@ fn surround_replace(cx: &mut Context) {
|
|
|
|
fn surround_delete(cx: &mut Context) {
|
|
|
|
fn surround_delete(cx: &mut Context) {
|
|
|
|
let count = cx.count();
|
|
|
|
let count = cx.count();
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
cx.on_next_key(move |cx, event| {
|
|
|
|
if let KeyEvent {
|
|
|
|
if let Some(ch) = event.char() {
|
|
|
|
code: KeyCode::Char(ch),
|
|
|
|
|
|
|
|
..
|
|
|
|
|
|
|
|
} = event
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
|
let selection = doc.selection(view.id);
|
|
|
|