From 88886a14449f69c30fb7c49931a52ecbd5d392c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= Date: Mon, 17 Oct 2022 11:09:15 +0300 Subject: [PATCH] mode/hint: Add selection-actions. --- source/mode/hint.lisp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/mode/hint.lisp b/source/mode/hint.lisp index 8f7728237e4..11599c4c7a3 100644 --- a/source/mode/hint.lisp +++ b/source/mode/hint.lisp @@ -242,10 +242,17 @@ For instance, to include images: :key #'prompter:value) (append matching-hints other-hints)))) (prompter:selection-actions - (unless (fit-to-prompt-p (find-submode 'hint-mode)) - (lambda (suggestion) - (highlight-selected-hint :element suggestion - :scroll nil)))) + (list (unless (fit-to-prompt-p (find-submode 'hint-mode)) + (lambda-command highlight-selected-hint* (suggestion) + "Highlight hint." + (highlight-selected-hint :element suggestion))) + (lambda-command scroll-to-selected-hint* (suggestion) + "Highlight and scroll to hint." + (highlight-selected-hint :element suggestion :scroll t)) + (lambda-command copy-selected-hint* (suggestion) + "Copy hint URL to clipboard." + (highlight-selected-hint :element suggestion :scroll t) + (copy-to-clipboard (plump:attribute suggestion "href"))))) (prompter:marks-actions (lambda (marks) (let ((%marks (mapcar (lambda (mark) (str:concat "#nyxt-hint-" (identifier mark)))