Add option to set winblend
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
local api = vim.api
|
||||
local fn = vim.fn
|
||||
|
||||
local OPTIONS = {}
|
||||
|
||||
local function echom(message)
|
||||
api.nvim_command('echom "' .. tostring(message) .. '"')
|
||||
end
|
||||
@@ -16,7 +18,7 @@ function open_floating_window()
|
||||
-- create a unlisted scratch buffer for the border
|
||||
local border_buffer = api.nvim_create_buf(false, true)
|
||||
|
||||
api.nvim_buf_set_option(buffer, 'bufhidden', 'hide')
|
||||
api.nvim_buf_set_option(buffer, 'bufhidden', 'wipe')
|
||||
api.nvim_buf_set_option(buffer, 'filetype', 'lazygit')
|
||||
|
||||
local columns = api.nvim_get_option("columns")
|
||||
@@ -58,10 +60,11 @@ function open_floating_window()
|
||||
local border_window = api.nvim_open_win(border_buffer, true, border_opts)
|
||||
api.nvim_command('set winhl=Normal:Floating')
|
||||
local window = api.nvim_open_win(buffer, true, opts)
|
||||
api.nvim_command('set winhl=Normal:Floating')
|
||||
|
||||
api.nvim_command('set winblend=' .. OPTIONS.lazygit_floating_window_winblend)
|
||||
|
||||
-- use autocommand to ensure that the border_buffer closes at the same time as the main buffer
|
||||
api.nvim_command('au BufWipeout <buffer> execute "silent bwipeout!"' .. border_buffer)
|
||||
api.nvim_command('au BufLeave <buffer> hide')
|
||||
return window
|
||||
end
|
||||
|
||||
@@ -102,6 +105,11 @@ function lazygit()
|
||||
exec_lazygit_command()
|
||||
end
|
||||
|
||||
function setup()
|
||||
OPTIONS.lazygit_floating_window_winblend = api.nvim_get_var("lazygit_floating_window_winblend")
|
||||
end
|
||||
|
||||
return {
|
||||
setup = setup,
|
||||
lazygit = lazygit,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user