1
0
Fork 0

- fixed event triggered by backspace when the keybinding suggestion

tree is shown (thanks tgl!);
- updated ci/README.md.
This commit is contained in:
cage 2022-02-23 20:17:14 +01:00
parent 5ae32630da
commit b10530e1d0
3 changed files with 19 additions and 20 deletions

View File

@ -1,12 +1,8 @@
## Build with containers
The directory with the configs and the scripts to build with containers is named 'ci', as this is usually used for a Continuous Integration or Continuous Delivery (CI/CD) infrastructure.
The bash script build.sh do all the needed stuffs for you, but one between podman or docker must be installed on your system and in your PATH. If both are installed, podman is preferred, as its default is to run rootless.
The directory that contains the configs and the scripts to build tinmop using containers is named 'ci', as this is usually used for a Continuous Integration or Continuous Delivery (CI/CD) infrastructure.
The bash script build.sh does all the needed stuff for you, but either podman or docker must be installed on your system and in your PATH. If both are installed, podman is preferred, as its default is to run rootless.
You have to invoke the script as PATH/TO/build.sh ARCH, for example, from the ci dir, the invocation for host arch is:

View File

@ -251,18 +251,19 @@ be either `:keybinding' or `:string'. the former for key command the latter for
(with-accessors ((command-line command-line)
(suggestions-win suggestions-win)) command-window
;; some envents should by intercepted by command window
(cond
((eq :control-left event) ; suggestion win pagination
(move-suggestion-page-left command-window))
((eq :control-right event) ; suggestion win pagination
(move-suggestion-page-right command-window))
((eq :backspace event) ; delete last command or char
(setf command-line (safe-all-but-last-elt command-line))
(when-let ((last-command (safe-last-elt command-line)))
(setf command-line (safe-all-but-last-elt command-line))
(enqueue-command command-window last-command nil)))
(t
(enqueue-command command-window event t)))))
(let ((decoded-event (decode-key-event event :convert-symbol-to-string nil)))
(cond
((eq :control-left decoded-event) ; suggestion win pagination
(move-suggestion-page-left command-window))
((eq :control-right decoded-event) ; suggestion win pagination
(move-suggestion-page-right command-window))
((eq :backspace decoded-event) ; delete last command or char
(when-let ((command-before-last (safe-all-but-last-elt command-line)))
(setf command-line nil)
(loop for i in command-before-last do
(enqueue-command command-window i nil))))
(t
(enqueue-command command-window event t))))))
(defun update-suggestions (window key-decoded)
"Update suggestion window"

View File

@ -95,13 +95,15 @@
as argument `complex-string'."
(length (complex-char-array complex-string)))
(defun decode-key-event (event)
(defun decode-key-event (event &key (convert-symbol-to-string t))
(let* ((key (croatoan:event-key event))
(decoded-event (cond
((characterp key)
(key-to-string key))
((symbolp key)
(symbol-name key))
(if convert-symbol-to-string
(symbol-name key)
key))
(t
(error (_ "Unknown key event ~a") key)))))
(values decoded-event key)))