fix(paste): Ctrl+V over the command line still pastes copied objects

#1481 skipped the shortcut whenever any text input had focus. The command
line is focused almost always, so copied drawing objects no longer pasted
with Ctrl+V. The probe now tells the command line apart from other fields:
another field keeps Ctrl+V to itself; over the command line copied objects
start PASTECLIP and plain text is left to the input's native paste; with
nothing focused text goes to the command line as before. PASTECLIP goes
through Message::Command again, which also closes the context menus. The
tests use the codec crate name and cover the command-line case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-09-25 15:15:44 +03:00
1 parent 9c04fb8bd1
commit e7e759268a
3 files changed
+71 -34

No files matched your search

+11 -2
View File
@@ -2063,6 +2063,15 @@ pub enum ArrowKey {
Right,
}
/// The text input holding focus when Ctrl+V arrives (native only).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PasteFocus {
None,
CommandLine,
/// Any other text field (dialogs, panels).
Field,
}
#[derive(Debug, Clone)]
pub enum Message {
SpaceMouseWake,
@@ -2106,8 +2115,8 @@ pub enum Message {
/// Ctrl+V. Routed by `update` into an open text editor, the drawing-object
/// clipboard, or the system text clipboard.
PasteShortcut,
/// Result of probing whether a text input was focused when `PasteShortcut` arrived.
PasteShortcutResolved(bool),
/// Which text input held focus when `PasteShortcut` arrived.
PasteShortcutResolved(PasteFocus),
/// Completion of a system text clipboard read requested by PASTECLIP.
SystemClipboardPaste(SystemClipboardText),
/// Ctrl/Cmd+A — select all layer rows when the Layer Manager is open, or all