implement paste-translation for #16

This commit is contained in:
2025-11-13 12:39:06 -07:00
parent 3dc9b991ec
commit 65f18c9abf
5 changed files with 217 additions and 24 deletions

View File

@@ -167,7 +167,7 @@ impl Mode {
'v' => app.mode = Mode::Visual(app.grid.cursor()),
':' => app.mode = Mode::Command(Chord::new(':')),
'p' => {
app.clipboard.paste(&mut app.grid);
app.clipboard.paste(&mut app.grid, true);
app.grid.apply_momentum(app.clipboard.momentum());
return;
}
@@ -264,6 +264,14 @@ impl Mode {
app.mode = Mode::Normal;
app.msg = StatusMessage::info("Yanked 1 cell");
}
("g", 'p') => {
app.clipboard.paste(&mut app.grid, false);
app.grid.apply_momentum(app.clipboard.momentum());
app.mode = Mode::Normal;
let plural = if app.clipboard.qty() > 1 {"cells"} else {"cell"};
app.msg = StatusMessage::info(format!("Pasted {plural}, no formatting"));
return;
}
_ => {}
}
}