mirror of
https://github.com/NotAShelf/slides.nvim.git
synced 2024-11-01 11:01:18 +00:00
fullscreen option
This commit is contained in:
parent
7d6a115b50
commit
d660438a3b
2 changed files with 10 additions and 4 deletions
|
@ -25,8 +25,10 @@ use {
|
|||
## Configuration
|
||||
|
||||
```lua
|
||||
-- default config
|
||||
require'slides'.setup{
|
||||
bin = 'slides' -- default config, path to binary
|
||||
bin = 'slides' -- path to binary
|
||||
fullscreen = true -- open in fullscreen
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ local state = {
|
|||
}
|
||||
|
||||
local config = {
|
||||
bin = 'slides'
|
||||
bin = 'slides',
|
||||
fullscreen = true
|
||||
}
|
||||
|
||||
function M.close()
|
||||
|
@ -21,11 +22,14 @@ function M.setup(user_config)
|
|||
end
|
||||
|
||||
function M.show(file)
|
||||
|
||||
local window = vim.api.nvim_get_current_win()
|
||||
|
||||
local opts = {
|
||||
style = "minimal",
|
||||
relative = "editor",
|
||||
width = vim.api.nvim_get_option("columns"),
|
||||
height = vim.api.nvim_get_option("lines"),
|
||||
width = config.fullscreen and vim.api.nvim_get_option("columns") or vim.api.nvim_win_get_width(window),
|
||||
height = config.fullscreen and vim.api.nvim_get_option("lines") or vim.api.nvim_win_get_height(window),
|
||||
row = 1,
|
||||
col = 1,
|
||||
border = "shadow",
|
||||
|
|
Loading…
Reference in a new issue