Skip to content

Commit

Permalink
fix(git_branch): previewer commit hash dynamic highlighting (#2921)
Browse files Browse the repository at this point in the history
* Fix highlight of commit hash in git branches preview

* Update lua/telescope/previewers/buffer_previewer.lua

Co-authored-by: James Trew <[email protected]>

---------

Co-authored-by: James Trew <[email protected]>
(cherry picked from commit b744cf5)
  • Loading branch information
petobens authored and Conni2461 committed Mar 6, 2024
1 parent 6d2be79 commit ec3474b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lua/telescope/previewers/buffer_previewer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ec3474b

Please sign in to comment.