From ec3474b596a64c8a3779a701d482892ab22f928f Mon Sep 17 00:00:00 2001 From: Pedro Ferrari Date: Fri, 16 Feb 2024 22:44:31 -0300 Subject: [PATCH] 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 b744cf59752aaa01561afb4223006de26f3836fd) --- lua/telescope/previewers/buffer_previewer.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/telescope/previewers/buffer_previewer.lua b/lua/telescope/previewers/buffer_previewer.lua index 74f715ef68..3c95ab2e15 100644 --- a/lua/telescope/previewers/buffer_previewer.lua +++ b/lua/telescope/previewers/buffer_previewer.lua @@ -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,