From 510798bc485de60b0be35c78f93a5b8800e69c7b Mon Sep 17 00:00:00 2001 From: Georgi Dimitrov Date: Tue, 10 Dec 2024 16:54:52 +0200 Subject: [PATCH] neovim: fix gitsigns next/prev funcs --- nvim/lua/plugins/git.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua index f0aa0b3..50e0489 100644 --- a/nvim/lua/plugins/git.lua +++ b/nvim/lua/plugins/git.lua @@ -31,16 +31,22 @@ return { end local function next_hunk() if vim.wo.diff then - vim.cmd.normal({ ']c', bang = true }) + return ']c' else - gitsigns.nav_hunk('next') + vim.schedule(function() + gitsigns.nav_hunk('next') + end) + return '' end end local function prev_hunk() if vim.wo.diff then - vim.cmd.normal({ '[c', bang = true }) + return '[c' else - gitsigns.nav_hunk('prev') + vim.schedule(function() + gitsigns.nav_hunk('prev') + end) + return '' end end