Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ neogit.setup {
recent = {
folded = true,
hidden = false,
always = false,
},
rebase = {
folded = true,
Expand Down
1 change: 1 addition & 0 deletions doc/neogit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ to Neovim users.
recent = {
folded = true,
hidden = false,
always = false,
},
rebase = {
folded = true,
Expand Down
4 changes: 3 additions & 1 deletion lua/neogit/buffers/status/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@ function M.Status(state, config)

local show_recent = #state.recent.items > 0
and not config.sections.recent.hidden
and (config.sections.recent.always or not show_upstream_unmerged)


return {
List {
Expand Down Expand Up @@ -748,7 +750,7 @@ function M.Status(state, config)
folded = config.sections.unmerged_pushRemote.folded,
name = "pushRemote_unmerged",
},
not show_upstream_unmerged and show_recent and Section {
show_recent and Section {
title = SectionTitle { title = "Recent Commits", highlight = "NeogitRecentcommits" },
count = false,
render = SectionItemCommit,
Expand Down
1 change: 1 addition & 0 deletions lua/neogit/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ function M.get_default_values()
recent = {
folded = true,
hidden = false,
always = false,
},
rebase = {
folded = true,
Expand Down
10 changes: 10 additions & 0 deletions tests/specs/neogit/config_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,16 @@ describe("Neogit config", function()
assert.True(vim.tbl_count(require("neogit.config").validate_config()) ~= 0)
end)

it("should return invalid when sections.recent.hidden isn't a boolean", function()
config.values.sections.recent.hidden = "not a boolean"
assert.True(vim.tbl_count(require("neogit.config").validate_config()) ~= 0)
end)

it("should return invalid when sections.recent.always isn't a boolean", function()
config.values.sections.recent.always = "not a boolean"
assert.False(vim.tbl_count(require("neogit.config").validate_config()) ~= 0)
end)

it("should return invalid when sections.recent.folded isn't a boolean", function()
config.values.sections.recent.folded = "not a boolean"
assert.True(vim.tbl_count(require("neogit.config").validate_config()) ~= 0)
Expand Down