Feat: displayer hl_chars and TelescopeResults hlgroups (#349)

This commit is contained in:
Simon Hauser
2020-12-19 21:13:05 +01:00
committed by GitHub
parent 084a30b8fa
commit 2488e31df8
4 changed files with 53 additions and 29 deletions

View File

@@ -62,8 +62,18 @@ entry_display.create = function(configuration)
table.insert(highlights, { { hl_start, hl_end }, configuration.separator_hl })
end
end
local final_str = table.concat(results, configuration.separator or "")
if configuration.hl_chars then
for i = 1, #final_str do
local c = final_str:sub(i,i)
local hl = configuration.hl_chars[c]
if hl then
table.insert(highlights, { { i - 1, i }, hl })
end
end
end
return table.concat(results, configuration.separator or ""), highlights
return final_str, highlights
end
end