diff --git a/README.md b/README.md index a7dd71af..5f53b917 100644 --- a/README.md +++ b/README.md @@ -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] > diff --git a/lua/colorbox.lua b/lua/colorbox.lua index d115212f..2cf641ae 100644 --- a/lua/colorbox.lua +++ b/lua/colorbox.lua @@ -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