Skip to content

Commit 1986b75

Browse files
committed
Support configuring popup kind
1 parent 060a625 commit 1986b75

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ neogit.setup {
212212
kind = "floating_console",
213213
},
214214
popup = {
215-
kind = "split",
215+
kind = "popup",
216216
},
217217
stash = {
218218
kind = "tab",

doc/neogit.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ to Neovim users.
229229
kind = "floating_console",
230230
},
231231
popup = {
232-
kind = "split",
232+
kind = "popup",
233233
},
234234
stash = {
235235
kind = "tab",

lua/neogit/config.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ end
8888
---| "split_below_all" Like :below split
8989
---| "vsplit" Open in a vertical split
9090
---| "floating" Open in a floating window
91+
---| "popup" Open in a popup
9192
---| "auto" vsplit if window would have 80 cols, otherwise split
9293

9394
---@class NeogitCommitBufferConfig Commit buffer options
@@ -451,7 +452,7 @@ function M.get_default_values()
451452
kind = "floating_console",
452453
},
453454
popup = {
454-
kind = "split",
455+
kind = "popup",
455456
},
456457
stash = {
457458
kind = "tab",
@@ -704,13 +705,14 @@ function M.validate_config()
704705
"floating",
705706
"floating_console",
706707
"replace",
708+
"popup",
707709
"auto",
708710
}, val)
709711
then
710712
err(
711713
name,
712714
string.format(
713-
"Expected `%s` to be one of 'split', 'vsplit', 'split_above', 'vsplit_left', tab', 'floating', 'replace' or 'auto', got '%s'",
715+
"Expected `%s` to be one of 'split', 'vsplit', 'split_above', 'split_above_all', 'split_below', 'split_below_all', 'vsplit_left', tab', 'floating', 'floating_console', 'replace', 'popup' or 'auto', got '%s'",
714716
name,
715717
val
716718
)

lua/neogit/lib/popup/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
local config = require("neogit.config")
12
local PopupBuilder = require("neogit.lib.popup.builder")
23
local Buffer = require("neogit.lib.buffer")
34
local logger = require("neogit.logger")
@@ -407,7 +408,7 @@ function M:show()
407408
self.buffer = Buffer.create {
408409
name = self.state.name,
409410
filetype = "NeogitPopup",
410-
kind = "popup",
411+
kind = config.values.popup.kind,
411412
mappings = self:mappings(),
412413
status_column = " ",
413414
autocmds = {

0 commit comments

Comments
 (0)