fix(git_branch): previewer commit hash dynamic highlighting (#2921)

* Fix highlight of commit hash in git branches preview

* Update lua/telescope/previewers/buffer_previewer.lua

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>

---------

Co-authored-by: James Trew <66286082+jamestrew@users.noreply.github.com>
(cherry picked from commit b744cf5975)
This commit is contained in:
Pedro Ferrari
2024-02-16 22:44:31 -03:00
committed by Simon Hauser
parent 6d2be79385
commit ec3474b596

View File

@@ -654,9 +654,8 @@ previewers.git_branch_log = defaulter(function(opts)
local highlight_buffer = function(bufnr, content)
for i = 1, #content do
local line = content[i]
local _, hstart = line:find "[%*%s|]*"
local hstart, hend = line:find "[0-9a-fA-F]+"
if hstart then
local hend = hstart + 7
if hend < #line then
pcall(
vim.api.nvim_buf_add_highlight,