mirror of https://codeberg.org/cage/tinmop/
- changed 'source-text' to 'support-text'.
This commit is contained in:
parent
97a0c10aa9
commit
9572f2a917
|
@ -57,12 +57,12 @@ So the whole list is like: '((\"foo\" \"bar\") (\"old\" \"new\") ...)")
|
||||||
(cdr mapping)))
|
(cdr mapping)))
|
||||||
|
|
||||||
(defun rewriting-link-message-hook-fn (message-window)
|
(defun rewriting-link-message-hook-fn (message-window)
|
||||||
(with-accessors ((source-text message-window:source-text)) message-window
|
(with-accessors ((support-text message-window:support-text)) message-window
|
||||||
(let* ((all-links (text-utils:collect-links source-text))
|
(let* ((all-links (text-utils:collect-links support-text))
|
||||||
(links-mapping (rewriting-link-messages-links-rules all-links)))
|
(links-mapping (rewriting-link-messages-links-rules all-links)))
|
||||||
(loop for mapping in links-mapping do
|
(loop for mapping in links-mapping do
|
||||||
(setf source-text
|
(setf support-text
|
||||||
(rewriting-link-replace-mapping mapping source-text))))))
|
(rewriting-link-replace-mapping mapping support-text))))))
|
||||||
|
|
||||||
(defun rewriting-link-links-window-hook-fn (all-links)
|
(defun rewriting-link-links-window-hook-fn (all-links)
|
||||||
(let ((links-mapping (rewriting-link-messages-links-rules all-links))
|
(let ((links-mapping (rewriting-link-messages-links-rules all-links))
|
||||||
|
|
|
@ -689,7 +689,7 @@
|
||||||
(when-let* ((metadata (message-window:metadata window))
|
(when-let* ((metadata (message-window:metadata window))
|
||||||
(source (gemini-metadata-source-file metadata))
|
(source (gemini-metadata-source-file metadata))
|
||||||
(last (misc:safe-last-elt (gemini-metadata-history 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)
|
(draw window)
|
||||||
(ui:info-message (format nil (_ "Viewing source of: ~a") last))))
|
(ui:info-message (format nil (_ "Viewing source of: ~a") last))))
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
row-oriented-widget
|
row-oriented-widget
|
||||||
focus-marked-window
|
focus-marked-window
|
||||||
title-window)
|
title-window)
|
||||||
((source-text
|
((support-text
|
||||||
:initform nil
|
:initform nil
|
||||||
:initarg :source-text
|
:initarg :support-text
|
||||||
:reader source-text)
|
:reader support-text)
|
||||||
(line-position-mark
|
(line-position-mark
|
||||||
:initform (make-tui-string "0")
|
:initform (make-tui-string "0")
|
||||||
:initarg :line-position-mark
|
:initarg :line-position-mark
|
||||||
|
@ -50,8 +50,8 @@
|
||||||
(setf (keybindings window)
|
(setf (keybindings window)
|
||||||
keybindings:*message-keymap*)))
|
keybindings:*message-keymap*)))
|
||||||
|
|
||||||
(defmethod (setf source-text) (new-text (object message-window))
|
(defmethod (setf support-text) (new-text (object message-window))
|
||||||
(setf (slot-value object 'source-text) new-text)
|
(setf (slot-value object 'support-text) new-text)
|
||||||
(handler-bind ((conditions:out-of-bounds
|
(handler-bind ((conditions:out-of-bounds
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(invoke-restart 'ignore-selecting-action e))))
|
(invoke-restart 'ignore-selecting-action e))))
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
|
|
||||||
(defgeneric prepare-for-rendering (object &key (jump-to-first-row)))
|
(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))
|
&key prepare-for-rendering jump-to-first-row))
|
||||||
|
|
||||||
(defgeneric scroll-down (object &optional amount))
|
(defgeneric scroll-down (object &optional amount))
|
||||||
|
@ -200,21 +200,21 @@
|
||||||
:normal-text ""))
|
:normal-text ""))
|
||||||
|
|
||||||
(defmethod prepare-for-rendering ((object message-window) &key (jump-to-first-row t))
|
(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*
|
(when hooks:*before-prepare-for-rendering-message*
|
||||||
(hooks:run-hook 'hooks:*before-prepare-for-rendering-message* object))
|
(hooks:run-hook 'hooks:*before-prepare-for-rendering-message* object))
|
||||||
(setf (rows object)
|
(setf (rows object)
|
||||||
(text->rendered-lines-rows object source-text))
|
(text->rendered-lines-rows object support-text))
|
||||||
(when jump-to-first-row
|
(when jump-to-first-row
|
||||||
(select-row object 0))
|
(select-row object 0))
|
||||||
object))
|
object))
|
||||||
|
|
||||||
(defmethod append-source-text ((object message-window) text
|
(defmethod append-support-text ((object message-window) text
|
||||||
&key
|
&key
|
||||||
(prepare-for-rendering nil)
|
(prepare-for-rendering nil)
|
||||||
(jump-to-first-row nil))
|
(jump-to-first-row nil))
|
||||||
(with-slots (source-text) object
|
(with-slots (support-text) object
|
||||||
(setf source-text (strcat source-text text))
|
(setf support-text (strcat support-text text))
|
||||||
(when prepare-for-rendering
|
(when prepare-for-rendering
|
||||||
(prepare-for-rendering object :jump-to-first-row jump-to-first-row))))
|
(prepare-for-rendering object :jump-to-first-row jump-to-first-row))))
|
||||||
|
|
||||||
|
|
|
@ -1912,14 +1912,14 @@
|
||||||
(:shadowing-import-from :misc :random-elt :shuffle)
|
(:shadowing-import-from :misc :random-elt :shuffle)
|
||||||
(:export
|
(:export
|
||||||
:message-window
|
:message-window
|
||||||
:source-text
|
:support-text
|
||||||
:metadata
|
:metadata
|
||||||
:gemini-window-p
|
:gemini-window-p
|
||||||
:display-gemini-text-p
|
:display-gemini-text-p
|
||||||
:display-chat-p
|
:display-chat-p
|
||||||
:text->rendered-lines-rows
|
:text->rendered-lines-rows
|
||||||
:prepare-for-display-status-mode
|
:prepare-for-display-status-mode
|
||||||
:append-source-text
|
:append-support-text
|
||||||
:scroll-down
|
:scroll-down
|
||||||
:scroll-up
|
:scroll-up
|
||||||
:scroll-end
|
:scroll-end
|
||||||
|
|
|
@ -1361,7 +1361,7 @@
|
||||||
(db:mark-all-chat-messages-read chat-id)
|
(db:mark-all-chat-messages-read chat-id)
|
||||||
(setf (windows:keybindings specials:*message-window*)
|
(setf (windows:keybindings specials:*message-window*)
|
||||||
keybindings:*chat-message-keymap*)
|
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))
|
(chats-list-window:chat->text chat))
|
||||||
(message-window:scroll-end specials:*message-window*)
|
(message-window:scroll-end specials:*message-window*)
|
||||||
(setf (message-window:metadata specials:*message-window*)
|
(setf (message-window:metadata specials:*message-window*)
|
||||||
|
|
|
@ -815,7 +815,7 @@ db:renumber-timeline-message-index."
|
||||||
(actual-attachments (if (string= attachments reblogged-status-attachments)
|
(actual-attachments (if (string= attachments reblogged-status-attachments)
|
||||||
attachments
|
attachments
|
||||||
(strcat 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
|
(strcat header
|
||||||
actual-body
|
actual-body
|
||||||
poll-text
|
poll-text
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
(temporary-files-count (length fs:*temporary-files-created*)))
|
(temporary-files-count (length fs:*temporary-files-created*)))
|
||||||
(if (> temporary-files-count 0)
|
(if (> temporary-files-count 0)
|
||||||
(progn
|
(progn
|
||||||
(setf (message-window:source-text *message-window*) temporary-text)
|
(setf (message-window:support-text *message-window*) temporary-text)
|
||||||
(windows:draw *message-window*)
|
(windows:draw *message-window*)
|
||||||
(ask-string-input #'on-input-complete
|
(ask-string-input #'on-input-complete
|
||||||
:prompt (format nil
|
:prompt (format nil
|
||||||
|
@ -1877,7 +1877,7 @@ gemini://gemini.circumlunar.space/docs/companion/subscription.gmi
|
||||||
"Send contents of window to a command"
|
"Send contents of window to a command"
|
||||||
(flet ((on-input-complete (command)
|
(flet ((on-input-complete (command)
|
||||||
(when (string-not-empty-p 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
|
(push-event (make-instance 'send-to-pipe-event
|
||||||
:data data
|
:data data
|
||||||
:command command))
|
:command command))
|
||||||
|
|
Loading…
Reference in New Issue