Skip to content

Commit

Permalink
refactor(pickaxe): better method for moving query
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Oct 13, 2023
1 parent e3ba4f6 commit 753b719
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/tinygit/pickaxe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ local function showDiff(commitIdx)
-- search for the query
if query ~= "" then
fn.matchadd("Search", query) -- highlight, CAVEAT: is case-sensitive
vim.fn.search(query) -- move cursor
vim.fn.execute("/" .. query, "silent!") -- insert query so only `n` needs to be pressed
vim.fn.setreg("/", query) -- so `n` searches directly
vim.cmd.normal { "n", bang = true } -- move to first match
end

-- keymaps: info message as extmark
Expand Down

0 comments on commit 753b719

Please sign in to comment.