fullscreen option

This commit is contained in:
aspeddro 2021-09-29 20:16:44 -03:00
parent 7d6a115b50
commit d660438a3b
No known key found for this signature in database
GPG key ID: 0C09619EB1B7A7CD
2 changed files with 10 additions and 4 deletions

View file

@ -25,8 +25,10 @@ use {
## Configuration ## Configuration
```lua ```lua
-- default config
require'slides'.setup{ require'slides'.setup{
bin = 'slides' -- default config, path to binary bin = 'slides' -- path to binary
fullscreen = true -- open in fullscreen
} }
``` ```

View file

@ -5,7 +5,8 @@ local state = {
} }
local config = { local config = {
bin = 'slides' bin = 'slides',
fullscreen = true
} }
function M.close() function M.close()
@ -21,11 +22,14 @@ function M.setup(user_config)
end end
function M.show(file) function M.show(file)
local window = vim.api.nvim_get_current_win()
local opts = { local opts = {
style = "minimal", style = "minimal",
relative = "editor", relative = "editor",
width = vim.api.nvim_get_option("columns"), width = config.fullscreen and vim.api.nvim_get_option("columns") or vim.api.nvim_win_get_width(window),
height = vim.api.nvim_get_option("lines"), height = config.fullscreen and vim.api.nvim_get_option("lines") or vim.api.nvim_win_get_height(window),
row = 1, row = 1,
col = 1, col = 1,
border = "shadow", border = "shadow",