commit a7fb4e4758b562ca2c69e370619794b421263528 Solene Rapenne <solene@perso.pw> 2018-01-23 19:34:43 +0100 Filter syntax /pattern and / pattern
clic.lisp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/clic.lisp b/clic.lisp index 7d75ac2..cc9126d 100644 --- a/clic.lisp +++ b/clic.lisp @@ -329,7 +329,7 @@ ;; with only lines matching the string (no regex) (loop for line across *previous-buffer* do - (when (search text line :test #'char-equal) + (when (search text (car (split (subseq line 1) #\Tab)) :test #'char-equal) (vector-push line *buffer*))) (display-buffer "1")) @@ -462,7 +462,14 @@ (p)) ;; search a pattern in a menu - ;; search should return 0 if we use it + ;; syntax /pattern + ((and + (search "/" input) + (> (length input) 1)) + (filter-line (subseq input 1))) + + ;; same as previously + ;; but with syntax / pattern ((= 0 (or (search "/ " input) 1)) (filter-line (subseq input 2)))