mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-26 09:27:36 +01:00
- prevented crash when performing searching in an empty message window.
This commit is contained in:
parent
8acd72dba3
commit
18110dbd42
@ -618,22 +618,21 @@
|
|||||||
|
|
||||||
(defmethod search-regex ((object message-window) regex)
|
(defmethod search-regex ((object message-window) regex)
|
||||||
(with-accessors ((row-selected-index row-selected-index)) object
|
(with-accessors ((row-selected-index row-selected-index)) object
|
||||||
(let* ((selected-row (selected-row object))
|
(when-let ((selected-row (selected-row object)))
|
||||||
(selected-text (normal-text selected-row))
|
(let* ((selected-text (normal-text selected-row))
|
||||||
(actual-row-starting (if (scan regex
|
(actual-row-starting (if (scan regex
|
||||||
(tui-string->chars-string selected-text))
|
(tui-string->chars-string selected-text))
|
||||||
(1+ row-selected-index)
|
(1+ row-selected-index)
|
||||||
row-selected-index))
|
row-selected-index))
|
||||||
(line-found (rows-position-if object
|
(line-found (rows-position-if object
|
||||||
(lambda (a)
|
(lambda (a)
|
||||||
(scan regex
|
(scan regex
|
||||||
(tui-string->chars-string (normal-text a))))
|
(tui-string->chars-string (normal-text a))))
|
||||||
:start (clamp actual-row-starting
|
:start (clamp actual-row-starting
|
||||||
0
|
0
|
||||||
(rows-length object))))
|
(rows-length object))))
|
||||||
(replacements-strings ()))
|
(replacements-strings ()))
|
||||||
(when line-found
|
(when line-found
|
||||||
(progn
|
|
||||||
(row-move object (- line-found row-selected-index))
|
(row-move object (- line-found row-selected-index))
|
||||||
(draw object)
|
(draw object)
|
||||||
(multiple-value-bind (first-window-line-simple first-window-line-complex)
|
(multiple-value-bind (first-window-line-simple first-window-line-complex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user