summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2020-11-16 21:10:26 +0100
committerGitHub <noreply@github.com>2020-11-16 15:10:26 -0500
commit81172630270325947d2c6b3afda5599e34b48499 (patch)
tree575dde0f6ad204926e010e3b861738d469ac6026 /lua/telescope/make_entry.lua
parentc01b7ad024cbab82d6c54feebf1eb6f86a2e8d2e (diff)
feat: Add git builtins (#240)
Conni2461 is a great coder and contributor :)
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index 5e7d493..906eb95 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -134,7 +134,7 @@ do
end
local execute_keys = {
- path = function(t)
+ path = function(t)
return t.cwd .. path.separator .. t.filename, false
end,
@@ -215,6 +215,24 @@ do
end
end
+function make_entry.gen_from_git_commits(opts)
+ opts = opts or {}
+
+ return function(entry)
+ if entry == "" then
+ return nil
+ end
+
+ local sha, msg = string.match(entry, '([^ ]+) (.+)')
+
+ return {
+ value = sha,
+ ordinal = sha .. ' ' .. msg,
+ display = sha .. ' ' .. msg,
+ }
+ end
+end
+
function make_entry.gen_from_quickfix(opts)
opts = opts or {}
opts.tail_path = get_default(opts.tail_path, true)