mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-17 08:10:36 +01:00
- [GUI] fixed order of tags when searching gemtext;
- [GUI] prevented crash when searching an empty gemtext widget.
This commit is contained in:
parent
6dc7298b5b
commit
79b9364904
@ -48,9 +48,9 @@
|
||||
(declare (ignore e))
|
||||
(loop for match in (matches frame) do
|
||||
(gui:tag-delete gemtext-widget (gui:match-tag-name match)))
|
||||
(setf (matches frame)
|
||||
(gui:search-all-text gemtext-widget (gui:text (entry frame))
|
||||
:case-insensitive (gui:value case-sensitive-checkbox)))
|
||||
(let ((tags (gui:search-all-text gemtext-widget (gui:text (entry frame))
|
||||
:case-insensitive (gui:value case-sensitive-checkbox))))
|
||||
(setf (matches frame) (nreverse tags)))
|
||||
(loop for match in (matches frame) do
|
||||
(gui:tag-configure gemtext-widget
|
||||
(gui:match-tag-name match)
|
||||
@ -58,10 +58,14 @@
|
||||
:highlightbackground)))))
|
||||
(setf (gui:command (button-next frame))
|
||||
(lambda ()
|
||||
(setf (counter frame) (rem (1+ (counter frame)) (length (matches frame))))
|
||||
(gui:see gemtext-widget (gui:match-start (elt (matches frame) (counter frame))))))
|
||||
(when (matches frame)
|
||||
(setf (counter frame) (rem (1+ (counter frame)) (length (matches frame))))
|
||||
(gui:see gemtext-widget `(:tag ,(gui:match-start (elt (matches frame) (counter frame)))
|
||||
:first)))))
|
||||
|
||||
(setf (gui:command (button-previous frame))
|
||||
(lambda ()
|
||||
(setf (counter frame) (max 0 (1- (counter frame))))
|
||||
(gui:see gemtext-widget (gui:match-start (elt (matches frame) (counter frame))))))
|
||||
(when (matches frame)
|
||||
(setf (counter frame) (max 0 (1- (counter frame))))
|
||||
(gui:see gemtext-widget (gui:match-start (elt (matches frame) (counter frame)))))))
|
||||
frame))
|
||||
|
Loading…
x
Reference in New Issue
Block a user