@@ -5,6 +5,7 @@ local util = require("neogit.lib.util")
5
5
6
6
local signs = require (" neogit.lib.signs" )
7
7
local Ui = require (" neogit.lib.ui" )
8
+ local config = require (" neogit.config" )
8
9
9
10
local Path = require (" plenary.path" )
10
11
@@ -317,20 +318,23 @@ function Buffer:show()
317
318
elseif self .kind == " vsplit_left" then
318
319
win = api .nvim_open_win (self .handle , true , { split = " left" , vertical = true })
319
320
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
323
323
local vim_height = vim .o .lines
324
324
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 )
325
327
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
+ })
334
338
335
339
api .nvim_win_set_cursor (content_window , { 1 , 0 })
336
340
win = content_window
0 commit comments