mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-26 21:00:21 +00:00
stats.lua: remove term_height_limit script-opt
It is excessive control to manually configure the terminal height limit just for stats, if anything this should be added as an option used all throughout mpv.
This commit is contained in:
committed by
Kacper Michajłow
parent
d6951e4039
commit
15ad917bb1
@@ -1,2 +1,3 @@
|
||||
remove `stats-term_width_limit` script-opt
|
||||
add `stats-term_clip` script-opt
|
||||
remove `stats-term_height_limit` script-opt
|
||||
|
||||
@@ -120,12 +120,6 @@ Configurable Options
|
||||
|
||||
Whether to clip lines to the terminal width.
|
||||
|
||||
``term_height_limit``
|
||||
Default: -1
|
||||
|
||||
Sets the terminal height.
|
||||
A value of 0 means the height is infinite, -1 means it's automatic.
|
||||
|
||||
``plot_perfdata``
|
||||
Default: yes
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ local o = {
|
||||
file_tag_max_count = 16, -- only show the first x file tags
|
||||
show_frame_info = false, -- whether to show the current frame info
|
||||
term_clip = true,
|
||||
term_height_limit = -1, -- overwrites the terminal height
|
||||
debug = false,
|
||||
|
||||
-- Graph options and style
|
||||
@@ -92,11 +91,6 @@ local o = {
|
||||
}
|
||||
options.read_options(o)
|
||||
|
||||
o.term_height_limit = tonumber(o.term_height_limit) or -1
|
||||
if o.term_height_limit < 0 then
|
||||
o.term_height_limit = nil
|
||||
end
|
||||
|
||||
local format = string.format
|
||||
local max = math.max
|
||||
local min = math.min
|
||||
@@ -1110,10 +1104,9 @@ end
|
||||
-- content : table of the content where each entry is one line
|
||||
-- apply_scroll: scroll the content
|
||||
local function finalize_page(header, content, apply_scroll)
|
||||
local term_size = mp.get_property_native("term-size", {})
|
||||
local term_height = o.term_height_limit or term_size.h or 24
|
||||
local term_height = mp.get_property_native("term-size/h", 24)
|
||||
local from, to = 1, #content
|
||||
if apply_scroll and term_height > 0 then
|
||||
if apply_scroll then
|
||||
-- Up to 40 lines for libass because it can put a big performance toll on
|
||||
-- libass to process many lines which end up outside (below) the screen.
|
||||
-- In the terminal reduce height by 2 for the status line (can be more then one line)
|
||||
|
||||
Reference in New Issue
Block a user