Hi everybody,

I've been using stumpwm for a couple of weeks now and it's awesome,
great work!!

Now, windowlist command tries to match what I type with a window name,
which is great, except that it has two problems:

* `j` and `k` move-up and move-down the list, which is confusing.

* Pressing Backspace inserts a `?` char, instead of deleting the
  preceding char.

Fix for the backspace is pretty simple, at least in the way I've done it
(not sure if it's the right way, though). Given that matching is
supported and it's very useful, I'm puzzled by the choice of binding j and
k, because, altough it allow easier browsing, it defeats the whole matching
idea. It wouldn't be better to just delete those?

Thanks!

diff --git a/menu.lisp b/menu.lisp
index 649e085..39c622b 100644
--- a/menu.lisp
+++ b/menu.lisp
@@ -146,10 +146,14 @@ backspace or F9), return it otherwise return nil"
   long as the user types lower-case characters."
   (let ((input-char (get-input-char key-seq)))
     (when input-char
-      (setf (menu-state-current-input menu)
-           (concatenate 'string
-                        (menu-state-current-input menu)
-                        (string input-char)))
+      (if (char= #\Backspace input-char)
+          (setf (menu-state-current-input menu)
+                (subseq (menu-state-current-input menu)
+                        0 (- (length (menu-state-current-input menu)) 1)))
+          (setf (menu-state-current-input menu)
+                (concatenate 'string
+                             (menu-state-current-input menu)
+                             (string input-char))))
       (do* ((cur-pos 0 (1+ cur-pos))
            (rest-elem (menu-state-table menu)
                       (cdr rest-elem))


-- 
Rodrigo Lazo


_______________________________________________
Stumpwm-devel mailing list
Stumpwm-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/stumpwm-devel

Reply via email to