Skip to content
Merged
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 @@ -309,6 +309,7 @@ neogit.setup {
},
popup = {
kind = "split",
show_title = false,
},
stash = {
kind = "tab",
Expand Down
1 change: 1 addition & 0 deletions doc/neogit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ to Neovim users.
},
popup = {
kind = "split",
show_title = false,
},
stash = {
kind = "tab",
Expand Down
2 changes: 2 additions & 0 deletions lua/neogit/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ end

---@class NeogitConfigPopup Popup window options
---@field kind WindowKind The type of window that should be opened
---@field show_title boolean Show a title for the popup

---@class NeogitConfigFloating
---@field relative? string
Expand Down Expand Up @@ -535,6 +536,7 @@ function M.get_default_values()
},
popup = {
kind = "split",
show_title = false,
},
stash = {
kind = "tab",
Expand Down
6 changes: 3 additions & 3 deletions lua/neogit/lib/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function Buffer:show()
api.nvim_win_set_cursor(content_window, { 1, 0 })
win = content_window
elseif self.kind == "popup" then
-- local title, _ = self.name:gsub("^Neogit", ""):gsub("Popup$", "")
local title, _ = self.name:gsub("^Neogit", ""):gsub("Popup$", "")

local content_window = api.nvim_open_win(self.handle, true, {
anchor = "SW",
Expand All @@ -401,8 +401,8 @@ function Buffer:show()
row = vim.o.lines - vim.o.cmdheight - (vim.o.laststatus > 0 and 1 or 0),
style = "minimal",
border = { "─", "─", "─", "", "", "", "", "" },
-- title = (" %s Actions "):format(title),
-- title_pos = "center",
title = config.values.popup.show_title and (" %s Actions "):format(title) or nil,
title_pos = config.values.popup.show_title and "center" or nil,
})

api.nvim_win_set_cursor(content_window, { 1, 0 })
Expand Down
7 changes: 6 additions & 1 deletion tests/specs/neogit/config_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Neogit config", function()
end)

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

Expand Down Expand Up @@ -241,6 +241,11 @@ describe("Neogit config", function()
assert.True(vim.tbl_count(require("neogit.config").validate_config()) ~= 0)
end)

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

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