summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index e4b3d4e..607b8ea 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -685,14 +685,30 @@ function make_entry.gen_from_buffer_lines(opts)
separator = ' │ ',
items = {
{ width = 5 },
- { remaining = true },
+ { remaining = true, },
},
}
local make_display = function(entry)
+
return displayer {
{ entry.lnum, opts.lnum_highlight_group or 'TelescopeResultsSpecialComment' },
- entry.line
+ {
+ entry.line, function()
+ if not opts.line_highlights then return {} end
+
+ local line_hl = opts.line_highlights[entry.lnum] or {}
+ -- TODO: We could probably squash these together if the are the same...
+ -- But I don't think that it's worth it at the moment.
+ local result = {}
+
+ for col, hl in pairs(line_hl) do
+ table.insert(result, { {col, col+1}, hl })
+ end
+
+ return result
+ end
+ },
}
end