Skip to content

Commit 8a97366

Browse files
committed
Support configuring popup kind
1 parent 446197d commit 8a97366

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
@@ -207,7 +207,7 @@ neogit.setup {
207207
kind = "floating_console",
208208
},
209209
popup = {
210-
kind = "split",
210+
kind = "popup",
211211
},
212212
stash = {
213213
kind = "tab",

doc/neogit.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ TODO: Detail what these do
160160
kind = "split",
161161
},
162162
popup = {
163-
kind = "split",
163+
kind = "popup",
164164
},
165165
refs_view = {
166166
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
@@ -442,7 +443,7 @@ function M.get_default_values()
442443
kind = "floating_console",
443444
},
444445
popup = {
445-
kind = "split",
446+
kind = "popup",
446447
},
447448
stash = {
448449
kind = "tab",
@@ -692,13 +693,14 @@ function M.validate_config()
692693
"floating",
693694
"floating_console",
694695
"replace",
696+
"popup",
695697
"auto",
696698
}, val)
697699
then
698700
err(
699701
name,
700702
string.format(
701-
"Expected `%s` to be one of 'split', 'vsplit', 'split_above', 'vsplit_left', tab', 'floating', 'replace' or 'auto', got '%s'",
703+
"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'",
702704
name,
703705
val
704706
)

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)