select.lua: fix preselecting the current subtitle line

Fixes 4d32db21c5.
This commit is contained in:
Guido Cella 2024-05-13 19:54:17 +02:00 committed by Kacper Michajłow
parent 07e5d69351
commit ce2f501c23
1 changed files with 1 additions and 1 deletions

View File

@ -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