From 18fc02b499b368287e3aa267ec0b0d22afc0f19b Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Fri, 6 Jan 2023 13:23:39 +0100 Subject: [PATCH] fix: live_grep additional_args parsing (#2306) --- lua/telescope/builtin/__files.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/telescope/builtin/__files.lua b/lua/telescope/builtin/__files.lua index 6ccd778..0021379 100644 --- a/lua/telescope/builtin/__files.lua +++ b/lua/telescope/builtin/__files.lua @@ -71,13 +71,16 @@ local opts_contain_invert = function(args) end if #v >= 2 and v:sub(1, 1) == "-" and v:sub(2, 2) ~= "-" then + local non_option = false for i = 2, #v do local vi = v:sub(i, i) if vi == "=" then -- ignore option -g=xxx break - elseif vi == "v" then + elseif vi == "g" or vi == "f" or vi == "m" or vi == "e" or vi == "r" or vi == "t" or vi == "T" then + non_option = true + elseif non_option == false and vi == "v" then invert = true - elseif vi == "l" then + elseif non_option == false and vi == "l" then files_with_matches = true end end