Skip to content

Commit

Permalink
Merge pull request #3421 from atlas-engineer/fix-3417
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Jun 20, 2024
2 parents 9ac48cc + 235a36d commit f93c945
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
25 changes: 15 additions & 10 deletions source/help.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -476,17 +476,22 @@ The value is saved to clipboard."
:class "container"
(:main
(:nav
(:nbutton :text "Quick-Start"
(:nbutton
:text "Quick-Start"
:title "Display a short tutorial on a side panel."
'(quick-start))
(:a :class "button" :href (nyxt-url 'describe-bindings)
:title "List all bindings for the current buffer."
"Describe-Bindings")
(:a :class "button" :href (nyxt-url 'manual)
:title "Full documentation about Nyxt, how it works and how to configure it."
"Manual")
(:a :class "button" :href (nyxt-url 'common-settings)
:title "Switch between Emacs/vi/CUA key bindings, set home page URL, and zoom level."
"Settings"))
(:nbutton
:text "Describe-Bindings"
:title "List all keyboard shortcuts for the current buffer."
'(make-buffer-focus :url (nyxt-url 'describe-bindings)))
(:nbutton
:text "Manual"
:title "Detailed Nyxt documentation including configuration guides."
'(make-buffer-focus :url (nyxt-url 'manual)))
(:nbutton
:text "Settings"
:title "Set keyboard shortcuts (CUA/Emacs/vi), homepage URL or zoom."
'(make-buffer-focus :url (nyxt-url 'common-settings))))
(:div :class "main"
(:div :class "logo" (:raw (glyph-logo *browser*)))
(:div
Expand Down
3 changes: 1 addition & 2 deletions source/panel.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ panel."))

(defun find-panel-buffer (name)
"Return first panel buffer which URL is a NAME `panel-page'."
(find name (panel-buffers (current-window))
:key (alex:compose #'internal-page-name #'url)))
(find name (panel-buffers (current-window)) :key (compose #'internal-page-name #'url)))

(defmethod set-internal-page-method ((page panel-page) form)
(when form
Expand Down
3 changes: 2 additions & 1 deletion source/renderer-script.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ See `find-internal-page-buffer'."))
"Return first buffer which URL is a NAME `internal-page'."
(find name (buffer-list) :key (compose #'internal-page-name #'url)))

(-> find-url-internal-page ((or quri:uri string null)) internal-page)
(defun find-url-internal-page (url)
"Return the `internal-page' to which URL corresponds."
"Return the `internal-page' corresponding to URL."
(gethash (internal-page-name url) *nyxt-url-commands*))

(export-always 'buffer-load-internal-page-focus)
Expand Down
10 changes: 5 additions & 5 deletions source/urls.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ ARGS is an arbitrary keyword arguments list that is translated to a URL query."
(lambda (url)
(let* ((%url (quri:uri url))
(internal-page (find-url-internal-page %url)))
;; So that `find-internal-page-buffer' returns a non-nil value.
(when (not (panel-page-p internal-page))
(setf (slot-value (current-buffer) 'url) %url))
(if internal-page
(let ((buffer (current-buffer)))
;; Allow `find-internal-page-buffer' to find it.
(when buffer (setf (slot-value buffer 'url) %url))
(apply (form internal-page)
(query-params->arglist (quri:uri-query-params %url))))
(apply (form internal-page)
(query-params->arglist (quri:uri-query-params %url)))
(warn "No internal page corresponds to URL ~a" %url)))))

(define-internal-scheme "nyxt-resource"
Expand Down

0 comments on commit f93c945

Please sign in to comment.