From 416c06d3f532aff711b0fe75e839c157eddfd72e Mon Sep 17 00:00:00 2001 From: Mike Lowis Date: Thu, 18 May 2023 16:45:51 -0400 Subject: [PATCH] undo change from left-most to right-most match. Need to consider this more carefully --- bin/pick.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pick.c b/bin/pick.c index f710170..eab307b 100644 --- a/bin/pick.c +++ b/bin/pick.c @@ -139,8 +139,8 @@ static bool match(char *string, size_t offset, size_t *start, size_t *end) return false; s2 = s1, e2 = e1; // Init s2 and e2 before use below - /* next find the longest match. If multiple, take the right most one */ - while (find_match(string, Query, ++offset, &s1, &e1) && ((e1-s1) >= (e2-s2))) + /* next find the longest match. If multiple, take the left most one */ + while (find_match(string, Query, ++offset, &s1, &e1) && ((e1-s1) <= (e2-s2))) s1 = s2, e1 = e2; /* return the best match */ -- 2.54.0