1
0
Fork 0

- added toc when a gemini file is loaded from a local file.

This commit is contained in:
cage 2021-08-26 16:23:24 +02:00
parent 78de3329a8
commit 8376d1b0fd
2 changed files with 9 additions and 14 deletions

View File

@ -97,8 +97,7 @@
(ensure-just-one-stream-rendering)
(force-rendering-of-cached-file stream-object)
(setf (stream-status stream-object) :completed)
(let ((toc-event (make-instance 'program-events:gemini-toc-open)))
(program-events:push-event toc-event)))
(ui:open-gemini-toc))
((gemini-client:text-file-stream-p meta)
(ensure-just-one-stream-rendering)
(force-rendering-of-cached-file stream-object)

View File

@ -1042,6 +1042,7 @@
gemini-client:*gemini-page-theme*)))
(gemini-viewer:maybe-initialize-metadata window)
(refresh-gemini-message-window links page-data ir-text nil)
(ui:open-gemini-toc)
(windows:draw window)))))
(defclass gemini-request-event (program-event)
@ -1143,18 +1144,13 @@
(t
(let* ((file-string (fs:slurp-file local-path))
(parent-dir (fs:parent-dir-path local-path))
(parsed (gemini-parser:parse-gemini-file file-string))
(links (gemini-parser:sexp->links parsed
nil
nil
parent-dir
:comes-from-local-file t))
(ir-text (gemini-parser:sexp->text-rows parsed
gemini-client:*gemini-page-theme*)))
(gemini-viewer:maybe-initialize-metadata window)
(gemini-viewer:push-url-to-history window local-path)
(refresh-gemini-message-window links file-string ir-text nil)
(windows:draw window))))))))
(event (make-instance 'gemini-display-data-page
:local-path parent-dir
:window window
:payload file-string)))
(let ((*process-events-immediately* t))
(push-event event))
(gemini-viewer:push-url-to-history window local-path))))))))
(defclass gemini-back-event (program-event) ())