Skip to content

Commit

Permalink
status(format-status-url): Refactor scheme checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadcg committed Feb 20, 2025
1 parent 85b8635 commit 2b0734d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions source/status.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,11 @@ By default, renders a hourglass when loading a URL."
"Format the current URL for the STATUS buffer."
(let* ((buffer (current-buffer (window status)))
(url (url buffer))
(url-display
(cond ((equalp (quri:uri-scheme url) "https")
(quri:uri-host url))
((equalp (quri:uri-scheme url) "http")
(format nil "! ~a" (render-url url)))
(t (render-url url)))))
(url-display (cond ((quri:uri-https-p url)
(quri:uri-host url))
((quri:uri-http-p url)
(format nil "! ~a" (render-url url)))
(t (render-url url)))))
(spinneret:with-html-string
(:nbutton :buffer status :text url-display :title (title buffer)
'(nyxt:set-url)))))
Expand Down

1 comment on commit 2b0734d

@jmercouris
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally equivalent, but a little more clear, thank you!

Please sign in to comment.