summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2021-02-09 18:25:57 +0100
committerGitHub <noreply@github.com>2021-02-09 18:25:57 +0100
commit3a7fa41857394cd2d90d00891413c12fada039c3 (patch)
treebff862cb4e8f3623fe167f1105e9f1dac72dfb95 /lua/telescope/make_entry.lua
parent993e383dd5356bf10c5cf2b5d0ac88f9c7746181 (diff)
fix: all git builtin respect cwd now (#517)
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua24
1 files changed, 13 insertions, 11 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index d6059af..4c0696f 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -927,12 +927,12 @@ function make_entry.gen_from_autocommands(_)
end
end
-function make_entry.gen_from_git_status(_)
+function make_entry.gen_from_git_status(opts)
local displayer = entry_display.create {
separator = " ",
items = {
- { width = 1},
- { width = 1},
+ { width = 1 },
+ { width = 1 },
{ remaining = true },
}
}
@@ -947,8 +947,8 @@ function make_entry.gen_from_git_status(_)
end
return displayer {
- { string.sub(entry.status, 1, 1), staged},
- { string.sub(entry.status, -1), modified},
+ { string.sub(entry.status, 1, 1), staged },
+ { string.sub(entry.status, -1), modified },
entry.value,
}
end
@@ -956,12 +956,14 @@ function make_entry.gen_from_git_status(_)
return function (entry)
if entry == '' then return nil end
local mod, file = string.match(entry, '(..).*%s[->%s]?(.+)')
- return {
- value = file,
- status = mod,
- ordinal = entry,
- display = make_display,
- }
+
+ return {
+ value = file,
+ status = mod,
+ ordinal = entry,
+ display = make_display,
+ path = opts.cwd .. path.separator .. file
+ }
end
end