Skip to content

Commit

Permalink
fix(info): safe scale refactor (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
linrongbin16 authored Dec 30, 2023
1 parent b81f0a7 commit 6809503
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ You can use command `Colorbox` to control the player with below subcommands:
- `reinstall`: Clean & re-install all git submodules.
- **Note:** use `concurrency=1` to specify the `concurrency` parameters.
- `info`: Show detailed information and configured status.
- **Note:** use `scale=0.7` to specify popup window's size in range `(0, 1)`, by default is `scale=0.7`.
- **Note:** use `scale=0.7` to specify popup window's size in range `(0, 1]`, by default is `scale=0.7`.

> [!NOTE]
>
Expand Down
1 change: 1 addition & 0 deletions lua/colorbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ local function _info(args)
opts = opts or { scale = 0.7 }
opts.scale = type(opts.scale) == "string" and (tonumber(opts.scale) or 0.7)
or 0.7
opts.scale = numbers.bound(opts.scale, 0, 1)
logging.get("colorbox"):debug("|_info| opts:%s", vim.inspect(opts))

local total_width = vim.o.columns
Expand Down

0 comments on commit 6809503

Please sign in to comment.