diff options
| author | Jonas Strittmatter <40792180+smjonas@users.noreply.github.com> | 2023-01-06 12:04:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-06 12:04:15 +0100 |
| commit | b24fdfdb253db3c9e563b372bbdfdb9cd2c6adc8 (patch) | |
| tree | 7dee250544af66cbb191733ab52a840c05887db2 /lua/telescope/make_entry.lua | |
| parent | 0326347eba8103ffd820547f84b75a07bff23256 (diff) | |
fix: correctly parse filenames with special chars in git_status (#2296)
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 8 |
1 files changed, 7 insertions, 1 deletions
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, |
