1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-14 22:54:02 +01:00

- resetted selected item position when a 'suggestion-window' is shown.

This commit is contained in:
cage 2021-07-23 19:14:23 +02:00
parent f33d793338
commit 1e1af396eb
3 changed files with 11 additions and 4 deletions

View File

@ -244,7 +244,7 @@ be either `:keybinding' or `:string'. the former for key command the latter for
(defgeneric remove-messages (object))
(defun manage-command-event (command-window event)
"Intercept UI events in keybindg mode"
"Intercept UI events in keybindig mode"
(with-accessors ((command-line command-line)
(suggestions-win suggestions-win)) command-window
;; some envents should by intercepted by command window
@ -283,7 +283,7 @@ be either `:keybinding' or `:string'. the former for key command the latter for
:tree *global-keymap*))))))
(defmethod enqueue-command ((object command-window) command decode-key-p)
"Enqueue and process, if possibl,e `command` object, if decode-key
"Enqueue and process, if possible `command` object, if decode-key
is not null decode key to something more human readable."
(with-accessors ((command-line command-line)
(info-message info-message)
@ -514,8 +514,9 @@ command line."
((char= #\Tab event)
(insert-selected-suggestion command-window))
(t
(when (null suggestions-win)
(setf suggestions-win (complete-window:init)))
(if (null suggestions-win)
(setf suggestions-win (complete-window:init))
(complete-window:reset-selected-item suggestions-win))
(win-show suggestions-win)
(setf command-line
(insert-at-point command-window event command-line))

View File

@ -40,6 +40,11 @@
(:documentation "A window to shows the possible completion for an
user input"))
(defun reset-selected-item (complete-win)
(setf (selected-item-column-index complete-win) +starting-item-index+
(selected-item-row-index complete-win) +starting-item-index+)
complete-win)
(defmethod calculate ((object complete-window) dt)
(declare (ignore object dt)))

View File

@ -1743,6 +1743,7 @@
:complete-window
:selected-item-row-index
:selected-item-column-index
:reset-selected-item
:init))
(defpackage :keybindings-window