From b24fdfdb253db3c9e563b372bbdfdb9cd2c6adc8 Mon Sep 17 00:00:00 2001 From: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com> Date: Fri, 6 Jan 2023 12:04:15 +0100 Subject: fix: correctly parse filenames with special chars in git_status (#2296) --- lua/telescope/make_entry.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 362c1b6..ce34ba0 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -1352,7 +1352,13 @@ function make_entry.gen_from_git_status(opts) if entry == "" then return nil end - local mod, file = string.match(entry, "(..).*%s[->%s]?(.+)") + + local mod, file = entry:match "^(..) (.+)$" + -- Ignore entries that are the PATH in XY ORIG_PATH PATH + -- (renamed or copied files) + if not mod then + return nil + end return setmetatable({ value = file, -- cgit v1.2.3