mirror of https://codeberg.org/cage/tinmop/
- added adjust-strategy-last to show text in message-window;
- removed call to 'adjust-selected-rows' when redrawing message-window; - fixed 'adjust-selected-rows', wa never actually called.
This commit is contained in:
parent
7a919d64f1
commit
5e230407c6
|
@ -226,11 +226,20 @@
|
|||
(defun adjust-rows-select-first (window)
|
||||
(select-first-row window))
|
||||
|
||||
(defun adjust-rows-select-last (window)
|
||||
(with-accessors ((rows rows)) window
|
||||
(when rows
|
||||
(let ((height (win-height-no-border window)))
|
||||
(when (not (< (rows-length window) height))
|
||||
(select-row window (- (rows-length window)
|
||||
height))))))
|
||||
window)
|
||||
|
||||
(defmethod adjust-selected-rows ((object row-oriented-widget) (strategy function))
|
||||
(with-accessors ((row-selected-index row-selected-index)) object
|
||||
(when (< (rows-length object)
|
||||
row-selected-index)
|
||||
(funcall strategy object)))
|
||||
(when (< row-selected-index
|
||||
(rows-length object))
|
||||
(funcall strategy object)))
|
||||
object)
|
||||
|
||||
(defmethod selected-row ((object row-oriented-widget))
|
||||
|
|
|
@ -186,15 +186,13 @@
|
|||
(print-text window line-position-mark mark-x mark-y))))
|
||||
|
||||
(defmethod draw ((object message-window))
|
||||
(with-accessors ((adjust-rows-strategy adjust-rows-strategy)) object
|
||||
(when-window-shown (object)
|
||||
(adjust-selected-rows object adjust-rows-strategy)
|
||||
(win-clear object :redraw nil)
|
||||
(win-box object)
|
||||
(draw-text object)
|
||||
(when (not (line-oriented-window:rows-empty-p object))
|
||||
(draw-buffer-line-mark object))
|
||||
(call-next-method))))
|
||||
(when-window-shown (object)
|
||||
(win-clear object :redraw nil)
|
||||
(win-box object)
|
||||
(draw-text object)
|
||||
(when (not (line-oriented-window:rows-empty-p object))
|
||||
(draw-buffer-line-mark object))
|
||||
(call-next-method)))
|
||||
|
||||
(let ((index 0)
|
||||
(frames -1)
|
||||
|
|
|
@ -1863,6 +1863,7 @@
|
|||
:select-row
|
||||
:select-first-row
|
||||
:adjust-rows-select-first
|
||||
:adjust-rows-select-last
|
||||
:adjust-selected-rows
|
||||
:selected-row
|
||||
:ignore-selecting-action
|
||||
|
@ -1989,6 +1990,7 @@
|
|||
(:export
|
||||
:message-window
|
||||
:metadata
|
||||
:adjust-rows-strategy
|
||||
:gemini-window-p*
|
||||
:gemini-window-p
|
||||
:display-gemini-text-p
|
||||
|
@ -1996,6 +1998,7 @@
|
|||
:row-get-original-object
|
||||
:viewport-width
|
||||
:draw-downloading-animation
|
||||
:adjust-selected-rows
|
||||
:visible-rows
|
||||
:row-vertical-space-p
|
||||
:row-preformatted-p
|
||||
|
|
Loading…
Reference in New Issue