From 7e7a4a5543121cbea26d3f0f1130e4a3f7ee94c6 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 4 Nov 2025 10:02:32 +0200 Subject: [PATCH] fix advanced search auto globbing feature --- lua/crentist/telescope/advanced_grep.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/crentist/telescope/advanced_grep.lua b/lua/crentist/telescope/advanced_grep.lua index 48e1e5c..dd9f06b 100644 --- a/lua/crentist/telescope/advanced_grep.lua +++ b/lua/crentist/telescope/advanced_grep.lua @@ -27,7 +27,13 @@ local advanced_grep = function(opts) if pieces[2] then table.insert(args, "-g") - table.insert(args, pieces[2]) + + local input_glob = pieces[2] + local glob = input_glob + if not input_glob:find("*", 1, true) then + glob = '**/*' .. input_glob .. '*/**' + end + table.insert(args, glob) end return vim.iter({ args, { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" } })