From 6cfce41a3c26f6eb297a1f290cf45729be29242d Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 22 Nov 2023 10:56:33 +0100 Subject: [PATCH 1/2] Update status message when discarding selection --- lua/neogit/status.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/neogit/status.lua b/lua/neogit/status.lua index 31145bfac..758ac32f7 100644 --- a/lua/neogit/status.lua +++ b/lua/neogit/status.lua @@ -924,7 +924,9 @@ local unstage = operation("unstage", function() end) local function discard_message(files, hunk_count) - if hunk_count > 0 then + if vim.api.nvim_get_mode() == "V" then + return string.format("Discard selection?") + elseif hunk_count > 0 then return string.format("Discard %d hunks?", hunk_count) elseif #files > 1 then return string.format("Discard %d files?", #files) From b84833fe7360828dd411239754d3d58686146637 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 22 Nov 2023 11:00:26 +0100 Subject: [PATCH 2/2] Don't string format --- lua/neogit/status.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/neogit/status.lua b/lua/neogit/status.lua index 758ac32f7..aadc0478b 100644 --- a/lua/neogit/status.lua +++ b/lua/neogit/status.lua @@ -925,7 +925,7 @@ end) local function discard_message(files, hunk_count) if vim.api.nvim_get_mode() == "V" then - return string.format("Discard selection?") + return "Discard selection?" elseif hunk_count > 0 then return string.format("Discard %d hunks?", hunk_count) elseif #files > 1 then