perf(git): minor performance cleanups

This commit is contained in:
2026-04-27 13:27:22 +02:00
parent 5966454462
commit 20dc6cc3c9
4 changed files with 51 additions and 30 deletions
+5 -1
View File
@@ -2,8 +2,12 @@ local cr = vim.api.nvim_replace_termcodes("<CR>", true, false, true)
vim.keymap.set("n", "<CR>", function()
local worktree = vim.b.git_worktree
-- Anchor past the leading graph chars (matches the leading sha column,
-- not any hex word that happens to appear later in the subject).
local sha = worktree
and vim.api.nvim_get_current_line():match("(%x%x%x%x%x%x%x+)")
and vim.api
.nvim_get_current_line()
:match("^[*|/\\_ ]*(%x%x%x%x%x%x%x+)")
if sha then
require("git.show").open_commit(worktree, sha)
else