Filter syntax /pattern and / pattern - clic - Clic is an command line interacti… | |
git clone git://bitreich.org/clic/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit a7fb4e4758b562ca2c69e370619794b421263528 | |
parent f8678efc9938f34c2d873fe85c9d41015b1c7c4f | |
Author: Solene Rapenne <[email protected]> | |
Date: Tue, 23 Jan 2018 19:34:43 +0100 | |
Filter syntax /pattern and / pattern | |
Diffstat: | |
M clic.lisp | 11 +++++++++-- | |
1 file changed, 9 insertions(+), 2 deletions(-) | |
--- | |
diff --git 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-equ… | |
(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))) | |