feat(clipboard): add an in-memory clipboard history with search and paste #41

Closed
BlackAngelTV wants to merge 27 commits from feat/clipboard-history into main
pull from: feat/clipboard-history
Showing only changes of commit e7f460964e - Show all commits
+7 -2
View File
@@ -3171,10 +3171,15 @@ class Boss:
self.ring_bell_if_allowed()
return
previews = [(text, self._clipboard_history_preview(text) or _('(blank)')) for text in entries]
# The picker is itself the active window while it is open, so keep the window the user was
# working in to paste into once it closes. The window can be gone by then.
target = self.window_for_dispatch or self.active_window
def chosen(text: str | None) -> None:
if text:
self.paste_to_active_window(text)
if text and target is not None:
w = self.window_id_map.get(target.id)
if w is not None:
w.paste_with_actions(text)
self.choose_entry(_('Clipboard history'), previews, chosen)