From c490fbe5d988fc0c53539fbf887f28b964f9898d Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 19 May 2024 22:43:19 +0200 Subject: [PATCH] plugins/neogit: Adapt to upstream options changes --- plugins/git/neogit/options.nix | 42 +++++++++++++++++++---- tests/test-sources/plugins/git/neogit.nix | 33 +++++++++++++++--- 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/plugins/git/neogit/options.nix b/plugins/git/neogit/options.nix index 401442e9..ebafa18c 100644 --- a/plugins/git/neogit/options.nix +++ b/plugins/git/neogit/options.nix @@ -13,10 +13,6 @@ let in { filewatcher = { - interval = helpers.defaultNullOpts.mkUnsignedInt 1000 '' - Interval between two refreshes. - ''; - enabled = helpers.defaultNullOpts.mkBool true '' When enabled, will watch the `.git/` directory for changes and refresh the status buffer in response to filesystem events. @@ -312,9 +308,19 @@ in q = "Close"; "" = "Submit"; "" = "Abort"; + "" = "PrevMessage"; + "" = "NextMessage"; + "" = "ResetMessage"; } '' "Mappings for the commit editor."; + commit_editor_I = mkMappingOption '' + { + "" = "Submit"; + "" = "Abort"; + } + '' "Mappings for the commit editor (insert mode)"; + rebase_editor = mkMappingOption '' { p = "Pick"; @@ -331,9 +337,18 @@ in gj = "MoveDown"; "" = "Submit"; "" = "Abort"; + "[c" = "OpenOrScrollUp"; + "]c" = "OpenOrScrollDown"; } '' "Mappings for the rebase editor."; + rebase_editor_I = mkMappingOption '' + { + "" = "Submit"; + "" = "Abort"; + } + '' "Mappings for the rebase editor (insert mode)."; + finder = mkMappingOption '' { "" = "Select"; @@ -346,6 +361,12 @@ in "" = "MultiselectToggleNext"; "" = "MultiselectTogglePrevious"; "" = "NOP"; + "" = "ScrollWheelDown"; + "" = "ScrollWheelUp"; + "" = "NOP"; + "" = "NOP"; + "" = "MouseClick"; + "<2-LeftMouse>" = "NOP"; } '' "Mappings for the finder."; @@ -353,12 +374,16 @@ in { "?" = "HelpPopup"; A = "CherryPickPopup"; - D = "DiffPopup"; + d = "DiffPopup"; M = "RemotePopup"; P = "PushPopup"; X = "ResetPopup"; Z = "StashPopup"; + i = "IgnorePopup"; + t = "TagPopup"; b = "BranchPopup"; + B = "BisectPopup"; + w = "WorktreePopup"; c = "CommitPopup"; f = "FetchPopup"; l = "LogPopup"; @@ -383,17 +408,20 @@ in S = "StageUnstaged"; "" = "StageAll"; u = "Unstage"; + K = "Untrack"; U = "UnstageStaged"; + y = "ShowRefs"; "$" = "CommandHistory"; - "#" = "Console"; Y = "YankSelected"; "" = "RefreshBuffer"; - "" = "GoToFile"; + "" = "GoToFile"; "" = "VSplitOpen"; "" = "SplitOpen"; "" = "TabOpen"; "{" = "GoToPreviousHunkHeader"; "}" = "GoToNextHunkHeader"; + "[c" = "OpenOrScrollUp"; + "]c" = "OpenOrScrollDown"; } '' "Mappings for status."; }; diff --git a/tests/test-sources/plugins/git/neogit.nix b/tests/test-sources/plugins/git/neogit.nix index 805586ff..a2037a3c 100644 --- a/tests/test-sources/plugins/git/neogit.nix +++ b/tests/test-sources/plugins/git/neogit.nix @@ -14,7 +14,6 @@ settings = { filewatcher = { - interval = 1000; enabled = true; }; graph_style = "ascii"; @@ -151,6 +150,13 @@ q = "Close"; "" = "Submit"; "" = "Abort"; + "" = "PrevMessage"; + "" = "NextMessage"; + "" = "ResetMessage"; + }; + commit_editor_I = { + "" = "Submit"; + "" = "Abort"; }; rebase_editor = { p = "Pick"; @@ -167,6 +173,12 @@ gj = "MoveDown"; "" = "Submit"; "" = "Abort"; + "[c" = "OpenOrScrollUp"; + "]c" = "OpenOrScrollDown"; + }; + rebase_editor_I = { + "" = "Submit"; + "" = "Abort"; }; finder = { "" = "Select"; @@ -179,16 +191,26 @@ "" = "MultiselectToggleNext"; "" = "MultiselectTogglePrevious"; "" = "NOP"; + "" = "ScrollWheelDown"; + "" = "ScrollWheelUp"; + "" = "NOP"; + "" = "NOP"; + "" = "MouseClick"; + "<2-LeftMouse>" = "NOP"; }; popup = { "?" = "HelpPopup"; A = "CherryPickPopup"; - D = "DiffPopup"; + d = "DiffPopup"; M = "RemotePopup"; P = "PushPopup"; X = "ResetPopup"; Z = "StashPopup"; + i = "IgnorePopup"; + t = "TagPopup"; b = "BranchPopup"; + B = "BisectPopup"; + w = "WorktreePopup"; c = "CommitPopup"; f = "FetchPopup"; l = "LogPopup"; @@ -210,17 +232,20 @@ S = "StageUnstaged"; "" = "StageAll"; u = "Unstage"; + K = "Untrack"; U = "UnstageStaged"; + y = "ShowRefs"; "$" = "CommandHistory"; - "#" = "Console"; Y = "YankSelected"; "" = "RefreshBuffer"; - "" = "GoToFile"; + "" = "GoToFile"; "" = "VSplitOpen"; "" = "SplitOpen"; "" = "TabOpen"; "{" = "GoToPreviousHunkHeader"; "}" = "GoToNextHunkHeader"; + "[c" = "OpenOrScrollUp"; + "]c" = "OpenOrScrollDown"; }; }; notification_icon = "󰊢";