Skip to content

Commit

Permalink
mode/web: Deprecate auto-follow-timer.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed May 4, 2022
1 parent f705541 commit 5259b9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
13 changes: 1 addition & 12 deletions source/mode/element-hint.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,7 @@
(prompter:follow-mode-functions
(lambda (suggestion)
(highlight-selected-hint :element suggestion
:scroll nil)
(sera:and-let* ((auto-follow (nyxt/web-mode:auto-follow-hints-p (find-submode 'web-mode)))
(matches (string-equal
(prompter:input (current-prompt-buffer))
(plump:get-attribute suggestion "nyxt-hint")))
(input (prompter:input (current-prompt-buffer))))
(run-thread "hint auto-follow thread"
(sleep (nyxt/web-mode:auto-follow-timer (find-submode 'web-mode)))
(when (string= input (prompter:input (current-prompt-buffer)))
(prompter:return-selection (current-prompt-buffer)))))))
:scroll nil)))
(prompter:actions (list 'identity
(lambda-command click* (elements)
(dolist (element (rest elements))
Expand Down Expand Up @@ -349,8 +340,6 @@ FUNCTION is the action to perform on the selected elements."
(define-command follow-hint ()
"Show a set of element hints, and go to the user inputted one in the current
buffer.
Auto-follows hints by their ID, if `web-mode's `auto-follow-hints-p' is true."
(let ((buffer (current-buffer)))
(query-hints "Go to element"
(lambda (results)
Expand Down
13 changes: 1 addition & 12 deletions source/mode/web.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,7 @@ search.")
(auto-follow-hints-p
nil
:type boolean
:documentation "Whether the hints are automatically followed when matching user input.
Matches the hint code (like \"ABC\"). Only follows when hint code
case-insensitively equal to user input (\"abc\", \"AbC\" etc.).
The period after which the auto-follow will happen is governed by `auto-follow-timer'.")
(auto-follow-timer
0.5
:type float
:documentation "For how long (in seconds) should Nyxt wait until auto-following the hint.
See `auto-follow-hints-p'.")
:documentation "Whether the hints are automatically followed when matching user input.")
(box-style (theme:themed-css (theme *browser*)
(".nyxt-hint"
:background-color theme:primary
Expand Down

0 comments on commit 5259b9a

Please sign in to comment.