Fix: copy/paste multi-step
This commit is contained in:
@@ -343,13 +343,26 @@ pub(super) fn handle_modal_input(ctx: &mut InputContext, key: KeyEvent) -> Input
|
||||
editor.select_all();
|
||||
}
|
||||
KeyCode::Char('c') if ctrl => {
|
||||
editor.copy();
|
||||
ctx.app.editor_ctx.editor.copy();
|
||||
let text = ctx.app.editor_ctx.editor.yank_text();
|
||||
if let Some(clip) = &mut ctx.app.clipboard {
|
||||
let _ = clip.set_text(text);
|
||||
}
|
||||
}
|
||||
KeyCode::Char('x') if ctrl => {
|
||||
editor.cut();
|
||||
ctx.app.editor_ctx.editor.cut();
|
||||
let text = ctx.app.editor_ctx.editor.yank_text();
|
||||
if let Some(clip) = &mut ctx.app.clipboard {
|
||||
let _ = clip.set_text(text);
|
||||
}
|
||||
}
|
||||
KeyCode::Char('v') if ctrl => {
|
||||
editor.paste();
|
||||
if let Some(clip) = &mut ctx.app.clipboard {
|
||||
if let Ok(text) = clip.get_text() {
|
||||
ctx.app.editor_ctx.editor.set_yank_text(text);
|
||||
}
|
||||
}
|
||||
ctx.app.editor_ctx.editor.paste();
|
||||
}
|
||||
KeyCode::Left | KeyCode::Right | KeyCode::Up | KeyCode::Down if shift => {
|
||||
if !editor.is_selecting() {
|
||||
|
||||
Reference in New Issue
Block a user