From 5ccf72e6d057f79d94eb3f2ee2ebd5a36f430d7b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 8 Nov 2024 13:20:00 +0100 Subject: [PATCH] docs(win): document width/height behavior for win --- doc/snacks-win.txt | 2 ++ docs/win.md | 2 ++ lua/snacks/win.lua | 2 ++ 3 files changed, 6 insertions(+) diff --git a/doc/snacks-win.txt b/doc/snacks-win.txt index d9d6744f..4a0ca641 100644 --- a/doc/snacks-win.txt +++ b/doc/snacks-win.txt @@ -58,6 +58,8 @@ Easily create and manage floating windows or splits ---@class snacks.win.Config: vim.api.keyset.win_config ---@field style? string merges with config from `Snacks.config.styles[style]` ---@field show? boolean Show the window immediately (default: true) + ---@field height? number Height of the window. Use <1 for relative height. 0 means full height. (default: 0.9) + ---@field width? number Width of the window. Use <1 for relative width. 0 means full width. (default: 0.9) ---@field minimal? boolean Disable a bunch of options to make the window minimal (default: true) ---@field position? "float"|"bottom"|"top"|"left"|"right" ---@field buf? number If set, use this buffer instead of creating a new one diff --git a/docs/win.md b/docs/win.md index 31ecaf24..d4e8cb6d 100644 --- a/docs/win.md +++ b/docs/win.md @@ -28,6 +28,8 @@ Snacks.win({ ---@class snacks.win.Config: vim.api.keyset.win_config ---@field style? string merges with config from `Snacks.config.styles[style]` ---@field show? boolean Show the window immediately (default: true) +---@field height? number Height of the window. Use <1 for relative height. 0 means full height. (default: 0.9) +---@field width? number Width of the window. Use <1 for relative width. 0 means full width. (default: 0.9) ---@field minimal? boolean Disable a bunch of options to make the window minimal (default: true) ---@field position? "float"|"bottom"|"top"|"left"|"right" ---@field buf? number If set, use this buffer instead of creating a new one diff --git a/lua/snacks/win.lua b/lua/snacks/win.lua index fff0cfef..ded156ea 100644 --- a/lua/snacks/win.lua +++ b/lua/snacks/win.lua @@ -20,6 +20,8 @@ local M = setmetatable({}, { ---@class snacks.win.Config: vim.api.keyset.win_config ---@field style? string merges with config from `Snacks.config.styles[style]` ---@field show? boolean Show the window immediately (default: true) +---@field height? number Height of the window. Use <1 for relative height. 0 means full height. (default: 0.9) +---@field width? number Width of the window. Use <1 for relative width. 0 means full width. (default: 0.9) ---@field minimal? boolean Disable a bunch of options to make the window minimal (default: true) ---@field position? "float"|"bottom"|"top"|"left"|"right" ---@field buf? number If set, use this buffer instead of creating a new one