From 83b4d6ff1dac0d483ad1a470fef80485c151a0ea Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Wed, 7 Jan 2026 15:46:45 -0800 Subject: don't redraw when cursor position doesn't change --- main.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 57a4e12..c139c07 100644 --- a/main.lua +++ b/main.lua @@ -101,9 +101,9 @@ local function save_favourites() end local function set_cursor(pos, opts) - state:menu():set_cursor(pos, osd_menu_lines(), opts) + local moved = state:menu():set_cursor(pos, osd_menu_lines(), opts) - if not (opts and opts.skip_redraw) then + if moved and not (opts and opts.skip_redraw) then update_osd() end end @@ -117,7 +117,7 @@ local function cursor_down() end local function cursor_start() - set_cursor(0) + set_cursor(1) end local function cursor_end() @@ -179,7 +179,7 @@ local function move_option_down() end local function move_option_start() - move_option(0) + move_option(1) end local function move_option_end() @@ -608,7 +608,8 @@ local function open_option_epg(opt) title = 'EPG: ' .. opt.name .. ' (' .. ch .. ')', type = 'epg', }) - set_cursor(curr, {centre = true}) + set_cursor(curr, {centre = true, skip_redraw = true}) + update_osd() end local function add_info_field(dst, k, v, fmt) @@ -890,7 +891,7 @@ local function start_search() menu.title = title menu.search_active = true menu:set_search_cursor(#menu.search_text + 1) - menu:set_cursor(1, osd_menu_lines()) + menu:set_cursor(1) else menu = state:push_menu({ title = title, -- cgit v1.2.3-70-g09d2