mirror of https://codeberg.org/cage/tinmop/
- [GUI] filtered out keys that are not valid as index when selecting gemlog in 'gemlog-window'.
This commit is contained in:
parent
c24c0930e7
commit
5a6462d85c
|
@ -194,16 +194,17 @@
|
|||
(list (elt items
|
||||
(- (1- (length items))
|
||||
actual-index))))))
|
||||
(let* ((treeview (gui:treeview (gui-goodies:tree table)))
|
||||
(items (gui:items treeview))
|
||||
(pressed-char (gui:event-char e))
|
||||
(pressed-char-code (gui:event-char-code e)))
|
||||
(if (ignore-errors (parse-integer pressed-char))
|
||||
(let ((index (clamp-index items (parse-integer (gui:event-char e)))))
|
||||
(gui:treeview-set-selection treeview index))
|
||||
(let ((index (clamp-index items (+ 10 (- pressed-char-code
|
||||
97)))))
|
||||
(gui:treeview-set-selection treeview index))))))
|
||||
(let* ((treeview (gui:treeview (gui-goodies:tree table)))
|
||||
(items (gui:items treeview))
|
||||
(pressed-char (gui:event-char e))
|
||||
(pressed-char-code (gui:event-char-code e)))
|
||||
(when (cl-ppcre:scan "(?i)^[a-z0-9]$" pressed-char)
|
||||
(if (ignore-errors (parse-integer pressed-char))
|
||||
(let ((index (clamp-index items (parse-integer (gui:event-char e)))))
|
||||
(gui:treeview-set-selection treeview index))
|
||||
(let ((index (clamp-index items (+ 10 (- pressed-char-code
|
||||
97)))))
|
||||
(gui:treeview-set-selection treeview index)))))))
|
||||
:append t)
|
||||
(gui:focus (gui:treeview (gui-goodies:tree table)))
|
||||
(gui:transient toplevel master))))
|
||||
|
|
Loading…
Reference in New Issue