1
0
Fork 0

- changed 'source-text' to 'support-text'.

This commit is contained in:
cage 2021-04-05 17:33:16 +02:00
parent 97a0c10aa9
commit 9572f2a917
7 changed files with 22 additions and 22 deletions

View File

@ -57,12 +57,12 @@ So the whole list is like: '((\"foo\" \"bar\") (\"old\" \"new\") ...)")
(cdr mapping)))
(defun rewriting-link-message-hook-fn (message-window)
(with-accessors ((source-text message-window:source-text)) message-window
(let* ((all-links (text-utils:collect-links source-text))
(with-accessors ((support-text message-window:support-text)) message-window
(let* ((all-links (text-utils:collect-links support-text))
(links-mapping (rewriting-link-messages-links-rules all-links)))
(loop for mapping in links-mapping do
(setf source-text
(rewriting-link-replace-mapping mapping source-text))))))
(setf support-text
(rewriting-link-replace-mapping mapping support-text))))))
(defun rewriting-link-links-window-hook-fn (all-links)
(let ((links-mapping (rewriting-link-messages-links-rules all-links))

View File

@ -689,7 +689,7 @@
(when-let* ((metadata (message-window:metadata window))
(source (gemini-metadata-source-file metadata))
(last (misc:safe-last-elt (gemini-metadata-history metadata))))
(setf (message-window:source-text window) source)
(setf (message-window:support-text window) source)
(draw window)
(ui:info-message (format nil (_ "Viewing source of: ~a") last))))

View File

@ -20,10 +20,10 @@
row-oriented-widget
focus-marked-window
title-window)
((source-text
((support-text
:initform nil
:initarg :source-text
:reader source-text)
:initarg :support-text
:reader support-text)
(line-position-mark
:initform (make-tui-string "0")
:initarg :line-position-mark
@ -50,8 +50,8 @@
(setf (keybindings window)
keybindings:*message-keymap*)))
(defmethod (setf source-text) (new-text (object message-window))
(setf (slot-value object 'source-text) new-text)
(defmethod (setf support-text) (new-text (object message-window))
(setf (slot-value object 'support-text) new-text)
(handler-bind ((conditions:out-of-bounds
(lambda (e)
(invoke-restart 'ignore-selecting-action e))))
@ -119,7 +119,7 @@
(defgeneric prepare-for-rendering (object &key (jump-to-first-row)))
(defgeneric append-source-text (object text
(defgeneric append-support-text (object text
&key prepare-for-rendering jump-to-first-row))
(defgeneric scroll-down (object &optional amount))
@ -200,21 +200,21 @@
:normal-text ""))
(defmethod prepare-for-rendering ((object message-window) &key (jump-to-first-row t))
(with-accessors ((source-text source-text)) object
(with-accessors ((support-text support-text)) object
(when hooks:*before-prepare-for-rendering-message*
(hooks:run-hook 'hooks:*before-prepare-for-rendering-message* object))
(setf (rows object)
(text->rendered-lines-rows object source-text))
(text->rendered-lines-rows object support-text))
(when jump-to-first-row
(select-row object 0))
object))
(defmethod append-source-text ((object message-window) text
(defmethod append-support-text ((object message-window) text
&key
(prepare-for-rendering nil)
(jump-to-first-row nil))
(with-slots (source-text) object
(setf source-text (strcat source-text text))
(with-slots (support-text) object
(setf support-text (strcat support-text text))
(when prepare-for-rendering
(prepare-for-rendering object :jump-to-first-row jump-to-first-row))))

View File

@ -1912,14 +1912,14 @@
(:shadowing-import-from :misc :random-elt :shuffle)
(:export
:message-window
:source-text
:support-text
:metadata
:gemini-window-p
:display-gemini-text-p
:display-chat-p
:text->rendered-lines-rows
:prepare-for-display-status-mode
:append-source-text
:append-support-text
:scroll-down
:scroll-up
:scroll-end

View File

@ -1361,7 +1361,7 @@
(db:mark-all-chat-messages-read chat-id)
(setf (windows:keybindings specials:*message-window*)
keybindings:*chat-message-keymap*)
(setf (message-window:source-text specials:*message-window*)
(setf (message-window:support-text specials:*message-window*)
(chats-list-window:chat->text chat))
(message-window:scroll-end specials:*message-window*)
(setf (message-window:metadata specials:*message-window*)

View File

@ -815,7 +815,7 @@ db:renumber-timeline-message-index."
(actual-attachments (if (string= attachments reblogged-status-attachments)
attachments
(strcat reblogged-status-attachments attachments))))
(setf (message-window:source-text *message-window*)
(setf (message-window:support-text *message-window*)
(strcat header
actual-body
poll-text

View File

@ -42,7 +42,7 @@
(temporary-files-count (length fs:*temporary-files-created*)))
(if (> temporary-files-count 0)
(progn
(setf (message-window:source-text *message-window*) temporary-text)
(setf (message-window:support-text *message-window*) temporary-text)
(windows:draw *message-window*)
(ask-string-input #'on-input-complete
:prompt (format nil
@ -1877,7 +1877,7 @@ gemini://gemini.circumlunar.space/docs/companion/subscription.gmi
"Send contents of window to a command"
(flet ((on-input-complete (command)
(when (string-not-empty-p command)
(when-let ((data (message-window:source-text *message-window*)))
(when-let ((data (message-window:support-text *message-window*)))
(push-event (make-instance 'send-to-pipe-event
:data data
:command command))