mirror of
https://github.com/NotAShelf/slides.nvim.git
synced 2024-11-01 19:11:17 +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
|
## 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
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue