diff --git a/ci/README.md b/ci/README.md index 11326e2..381eb99 100644 --- a/ci/README.md +++ b/ci/README.md @@ -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: diff --git a/src/command-window.lisp b/src/command-window.lisp index 45938b0..ddcf4a0 100644 --- a/src/command-window.lisp +++ b/src/command-window.lisp @@ -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" diff --git a/src/tui-utils.lisp b/src/tui-utils.lisp index f427280..18abd7d 100644 --- a/src/tui-utils.lisp +++ b/src/tui-utils.lisp @@ -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)))