diff --git a/src/program-events.lisp b/src/program-events.lisp index 62c4f12..b367c24 100644 --- a/src/program-events.lisp +++ b/src/program-events.lisp @@ -1096,27 +1096,21 @@ (defun refresh-gemini-message-window (links source rendered-text ir-rows append-text) (let* ((win specials:*message-window*) (window-metadata (message-window:metadata win))) - (if append-text - (with-accessors ((rows message-window::rows)) win - (let ((new-rows (message-window:text->rendered-lines-rows win - ir-rows)) - (reversed-rows (reverse rows))) - (message-window:append-source-text win rendered-text :prepare-for-rendering nil) - (gemini-viewer:append-metadata-link window-metadata links) - (gemini-viewer:append-metadata-source window-metadata source) - (loop for new-row in new-rows do - (push new-row reversed-rows)) - (setf rows (reverse reversed-rows)))) - (with-accessors ((rows message-window::rows)) win - (let ((new-rows (message-window:text->rendered-lines-rows win - ir-rows)) - (reversed-rows (reverse rows))) - (loop for new-row in new-rows do - (push new-row reversed-rows)) - (setf rows (reverse reversed-rows)) - (message-window:append-source-text win rendered-text :prepare-for-rendering nil) - (setf (gemini-viewer:gemini-metadata-source-file window-metadata) source) - (setf (gemini-viewer:gemini-metadata-links window-metadata) links)))))) + (with-accessors ((rows message-window::rows)) win + (let ((new-rows (message-window:text->rendered-lines-rows win + ir-rows)) + (reversed-rows (reverse rows))) + (loop for new-row in new-rows do + (push new-row reversed-rows)) + (setf rows (reverse reversed-rows)) + (message-window:append-source-text win rendered-text :prepare-for-rendering nil) + (if append-text + (progn + (gemini-viewer:append-metadata-link window-metadata links) + (gemini-viewer:append-metadata-source window-metadata source)) + (progn + (setf (gemini-viewer:gemini-metadata-source-file window-metadata) source) + (setf (gemini-viewer:gemini-metadata-links window-metadata) links))))))) (defmethod process-event ((object gemini-got-line-event)) (with-accessors ((response payload)