Skip to content

Commit 6809503

Browse files
authored
fix(info): safe scale refactor (#155)
1 parent b81f0a7 commit 6809503

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ You can use command `Colorbox` to control the player with below subcommands:
194194
- `reinstall`: Clean & re-install all git submodules.
195195
- **Note:** use `concurrency=1` to specify the `concurrency` parameters.
196196
- `info`: Show detailed information and configured status.
197-
- **Note:** use `scale=0.7` to specify popup window's size in range `(0, 1)`, by default is `scale=0.7`.
197+
- **Note:** use `scale=0.7` to specify popup window's size in range `(0, 1]`, by default is `scale=0.7`.
198198

199199
> [!NOTE]
200200
>

lua/colorbox.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ local function _info(args)
729729
opts = opts or { scale = 0.7 }
730730
opts.scale = type(opts.scale) == "string" and (tonumber(opts.scale) or 0.7)
731731
or 0.7
732+
opts.scale = numbers.bound(opts.scale, 0, 1)
732733
logging.get("colorbox"):debug("|_info| opts:%s", vim.inspect(opts))
733734

734735
local total_width = vim.o.columns

0 commit comments

Comments
 (0)