1
0
Fork 0

- prevented crash when bookmarking the start page in gemini fullscreen

mode (Thanks reDFog!).
This commit is contained in:
cage 2022-02-19 11:21:49 +01:00
parent 5f8dc6c5a2
commit 8f04e4efbb
2 changed files with 31 additions and 26 deletions

View File

@ -63,6 +63,7 @@
(defun current-gemini-url ()
(when (message-window:gemini-window-p)
(let* ((metadata (message-window:metadata specials:*message-window*))
(link (last-elt (gemini-viewer:gemini-metadata-history metadata))))
(when-let* ((metadata (message-window:metadata specials:*message-window*))
(history (gemini-viewer:gemini-metadata-history metadata))
(link (last-elt history)))
link)))

View File

@ -2276,7 +2276,12 @@ gemini page the program is rendering."
:complete-fn #'complete:directory-complete))))
(defun bookmark-gemini-page ()
(if (message-window:gemini-window-p)
(cond
((not (message-window:gemini-window-p))
(error-message (_ "The window is not displaying a gemini document")))
((not (gemini-viewer:current-gemini-url))
(error-message (_ "This page can not be added to bookmarks")))
(t
(let* ((link (gemini-viewer:current-gemini-url))
(metadata (message-window:metadata *message-window*))
(source (gemini-viewer:gemini-metadata-source-file metadata))
@ -2298,8 +2303,7 @@ gemini page the program is rendering."
(notify (format nil (_ "Added ~s in bookmark") link))))
(ui:ask-string-input #'on-description-completed
:prompt (format nil (_ "Insert bookmark description: "))
:initial-value description)))
(error-message (_ "The window is not displaying a gemini document"))))
:initial-value description))))))
(defun generate-bookmark-page ()
(let ((bookmarks-sections (db:bookmark-all-grouped-by-section)))