From ce2f501c2389a881a00f5a94e8d61555a3bd3054 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 13 May 2024 19:54:17 +0200 Subject: [PATCH] select.lua: fix preselecting the current subtitle line Fixes 4d32db21c5. --- player/lua/select.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/player/lua/select.lua b/player/lua/select.lua index c3f2f3c077..2ad997b207 100644 --- a/player/lua/select.lua +++ b/player/lua/select.lua @@ -221,7 +221,7 @@ mp.add_forced_key_binding(nil, "select-subtitle-line", function () for line in r.stdout:gsub("<.->", ""):gsub("{\\.-}", ""):gmatch("[^\n]+") do sub_lines[#sub_lines + 1] = line:sub(2):gsub("]", " ", 1) - if line:find("^" .. sub_start) then + if line:find("^%[" .. sub_start) then default_item = #sub_lines end end