File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
lua/advanced_git_search/telescope Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 1
1
local utils = require (" advanced_git_search.utils" )
2
+ local entry_display = require (" telescope.pickers.entry_display" )
2
3
3
4
local M = {}
4
5
local last_prompt = nil
@@ -15,18 +16,39 @@ M.git_log_entry_maker = function(entry)
15
16
local hash = attrs [1 ]
16
17
local date = attrs [2 ]
17
18
local author = attrs [3 ]
19
+ for i = 4 , # attrs do
20
+ author = author .. " " .. attrs [i ]
21
+ end
22
+
18
23
-- join split from second element
19
24
local message = split [2 ]
20
25
if # split > 2 then
21
26
for i = 3 , # split do
22
- message = message .. " _ " .. split [i ]
27
+ message = message .. " " .. split [i ]
23
28
end
24
29
end
25
30
31
+ local displayer = entry_display .create ({
32
+ separator = " " ,
33
+ items = {
34
+ { width = 7 },
35
+ { width = 7 },
36
+ { remaining = true },
37
+ },
38
+ })
39
+
40
+ local make_display = function (display_entry )
41
+ return displayer ({
42
+ { display_entry .opts .commit_hash , " TelescopeResultsIdentifier" },
43
+ { display_entry .opts .author , " TelescopeResultsVariable" },
44
+ { display_entry .opts .message , " TelescopeResultsConstant" },
45
+ })
46
+ end
47
+
26
48
return {
27
49
value = entry ,
28
- display = date .. " by " .. author .. " --" .. message ,
29
- -- display = hash .. " @ " .. date .. " by " .. author .. " --" .. message ,
50
+ -- display = date .. " by " .. author .. " --" .. message,
51
+ display = make_display ,
30
52
ordinal = author .. " " .. message ,
31
53
preview_title = hash .. " -- " .. message ,
32
54
opts = {
Original file line number Diff line number Diff line change @@ -139,7 +139,6 @@ M.search_log_content_file = function()
139
139
bufnr = vim .fn .bufnr (),
140
140
}),
141
141
previewer = telescope_ags_previewers .git_diff_content_previewer (),
142
- -- sorter = sorters.highlighter_only(),
143
142
attach_mappings = function (_ , map )
144
143
telescope_ags_mappings .open_diff_view_current_file_selected_commit (
145
144
map
You can’t perform that action at this time.
0 commit comments