From 753b719f3f30ddb66e183ea105e86dcbfe5123e3 Mon Sep 17 00:00:00 2001 From: pseudometa <73286100+chrisgrieser@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:24:53 +0200 Subject: [PATCH] refactor(pickaxe): better method for moving query --- lua/tinygit/pickaxe.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/tinygit/pickaxe.lua b/lua/tinygit/pickaxe.lua index 7874fdc..6b08326 100644 --- a/lua/tinygit/pickaxe.lua +++ b/lua/tinygit/pickaxe.lua @@ -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