From 1d3367359a20bf720388ec92fb11b3ebc67cfe8e Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 21 Jun 2021 16:01:46 -0400 Subject: SlackTools: make !filesearch auto-globbing unless given an absolute path --- SlackTools/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SlackTools/plugin.py b/SlackTools/plugin.py index f6c0484..26b63ab 100644 --- a/SlackTools/plugin.py +++ b/SlackTools/plugin.py @@ -118,6 +118,8 @@ class SlackTools(callbacks.Plugin): cursor.execute("select c.name, p.name, p.descrip from categories c, packages p where c.id=p.category and p.category=? and lower(p.name) glob ? order by c.name, p.name limit ?", (category, term, maxresults+1)) # file search (no way to specify category) else: + if(term[:1] != '/'): + term = '*' + term + '*' cursor.execute("select distinct c.name, p.name, p.descrip from categories c, packages p, files f where c.id=p.category and p.id=f.package and f.path glob ? order by c.name, p.name limit ?", (term, maxresults+1)) result = cursor.fetchall() -- cgit v1.2.3