Skip to content

Commit

Permalink
mode/hint: Replace 'qsa' with 'rqsa' to restore Shadow DOM support
Browse files Browse the repository at this point in the history
  • Loading branch information
heiwiper committed Apr 8, 2024
1 parent 12a1dd0 commit 5cbfe5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/mode/hint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ A positive value shifts to the bottom.")
(style (ps:new (|CSSStyleSheet|)))
(hints (ps:lisp (list 'quote hints)))
(i 0))
(dolist (hinted-element (nyxt/ps:qsa document "[nyxt-hintable]"))
(dolist (hinted-element (nyxt/ps:rqsa document "[nyxt-hintable]"))
(let ((hint (aref hints i)))
(ps:chain hinted-element (set-attribute "nyxt-hint" hint))
(ps:chain shadow (append-child (create-hint-overlay hinted-element hint)))
Expand Down Expand Up @@ -196,14 +196,14 @@ A positive value shifts to the bottom.")
alphabet))))))

(define-parenscript set-hintable-attribute (selector)
(ps:dolist (element (nyxt/ps:qsa document (ps:lisp selector)))
(ps:dolist (element (nyxt/ps:rqsa document (ps:lisp selector)))
(if (ps:lisp (eq :vi (hinting-type (find-submode 'hint-mode))))
(when (nyxt/ps:element-in-view-port-p element)
(ps:chain element (set-attribute "nyxt-hintable" "")))
(ps:chain element (set-attribute "nyxt-hintable" "")))))

(define-parenscript remove-hintable-attribute ()
(ps:dolist (element (nyxt/ps:qsa document "[nyxt-hintable]"))
(ps:dolist (element (nyxt/ps:rqsa document "[nyxt-hintable]"))
(ps:chain element (remove-attribute "nyxt-hintable"))))

(defun add-hints (&key selector (buffer (current-buffer)))
Expand All @@ -224,7 +224,7 @@ A positive value shifts to the bottom.")
(ps:when hints-parent
(ps:chain hints-parent (remove))))
(when (ps:lisp (show-hint-scope-p (find-submode 'hint-mode)))
(ps:dolist (element (nyxt/ps:qsa document ".nyxt-element-hint"))
(ps:dolist (element (nyxt/ps:rqsa document ".nyxt-element-hint"))
(ps:chain element class-list (remove "nyxt-element-hint")))))

(defun remove-hints (&key (buffer (current-buffer)))
Expand Down

0 comments on commit 5cbfe5d

Please sign in to comment.