@@ -5,6 +5,7 @@ local util = require("neogit.lib.util")
55
66local signs = require (" neogit.lib.signs" )
77local Ui = require (" neogit.lib.ui" )
8+ local config = require (" neogit.config" )
89
910local Path = require (" plenary.path" )
1011
@@ -317,20 +318,23 @@ function Buffer:show()
317318 elseif self .kind == " vsplit_left" then
318319 win = api .nvim_open_win (self .handle , true , { split = " left" , vertical = true })
319320 elseif self .kind == " floating" then
320- local floating = require (" neogit.config" ).values .floating
321-
322- -- Creates the border window
321+ local width = config .values .floating .width
322+ local height = config .values .floating .height
323323 local vim_height = vim .o .lines
324324 local vim_width = vim .o .columns
325+ width = width > 1 and width or math.floor (vim_width * width )
326+ height = height > 1 and height or math.floor (vim_height * height )
325327
326- floating .width = floating .width > 1 and floating .width or math.floor (vim_width * floating .width )
327- floating .height = floating .height > 1 and floating .height or math.floor (vim_height * floating .height )
328- floating .col = (vim_width - floating .width ) / 2
329- -- floating.row = (vim_height - floating.height) / 2
330- floating .row = vim_height * 0.15
331- floating .focusable = true
332-
333- local content_window = api .nvim_open_win (self .handle , true , floating )
328+ local content_window = api .nvim_open_win (self .handle , true , {
329+ width = width ,
330+ height = height ,
331+ relative = config .values .floating .relative ,
332+ border = config .values .floating .border ,
333+ style = config .values .floating .style ,
334+ col = config .values .floating .col or (vim_width - width ) / 2 ,
335+ row = config .values .floating .row or (vim_height - height ) / 2 ,
336+ focusable = true ,
337+ })
334338
335339 api .nvim_win_set_cursor (content_window , { 1 , 0 })
336340 win = content_window
0 commit comments