removed unused code

This commit is contained in:
wood 2019-10-12 10:50:37 +03:00
parent cf828e34cb
commit 37ddeec5a5

View File

@ -15,44 +15,8 @@ local wndend
local cursor local cursor
local pattern="" local pattern=""
local is_active local is_active
local is_altkeys
local is_playlist_loaded local is_playlist_loaded
local altkeys={
['a']='ф',
['b']='и',
['c']='с',
['d']='в',
['e']='у',
['f']='а',
['g']='п',
['h']='р',
['i']='ш',
['j']='о',
['k']='л',
['l']='д',
['m']='ь',
['n']='т',
['o']='щ',
['p']='з',
['q']='й',
['r']='к',
['s']='ы',
['t']='е',
['u']='г',
['v']='м',
['w']='ц',
['x']='ч',
['y']='н',
['z']='я',
['`']='ё',
[',']='б',
['.']='ю',
[';']='ж',
['\'']='э',
['[']='х',
[']']='ъ',
}
-- UTF-8 lower/upper conversion -- UTF-8 lower/upper conversion
local utf8_lc_uc = { local utf8_lc_uc = {
["a"] = "A", ["a"] = "A",
@ -215,8 +179,6 @@ function add_bindings()
for i,v in ipairs(cyr_chars) do for i,v in ipairs(cyr_chars) do
mp.add_key_binding(v, 'search'..i+1000, typing(v),"repeatable") mp.add_key_binding(v, 'search'..i+1000, typing(v),"repeatable")
end end
-- mp.add_key_binding('Ctrl+6', 'searchaltkeys', switchkbrd)
end end
function remove_bindings() function remove_bindings()
@ -232,7 +194,6 @@ function remove_bindings()
for i,v in ipairs(cyr_chars) do for i,v in ipairs(cyr_chars) do
mp.remove_key_binding('search'..i+1000) mp.remove_key_binding('search'..i+1000)
end end
-- mp.remove_key_binding('searchaltkeys')
end end
function activate() function activate()
@ -292,19 +253,10 @@ function resumetimer()
timer:resume() timer:resume()
end end
function switchkbrd()
is_altkeys = not is_altkeys
showplaylist()
end
function typing(char) function typing(char)
return function() return function()
local c=string.lower(char) local c=string.lower(char)
if is_altkeys then pattern = pattern..c
pattern = pattern..( altkeys[c] or c )
else
pattern = pattern..c
end
filterpls() filterpls()
showplaylist() showplaylist()
resumetimer() resumetimer()
@ -397,11 +349,7 @@ function showplaylist()
if wndstart+window-1<#plsfiltered then if wndstart+window-1<#plsfiltered then
msg = msg.."..." msg = msg.."..."
end end
if is_altkeys then msg="/"..pattern.."\n"..msg
msg="(ru)/"..pattern.."\n"..msg
else
msg="/"..pattern.."\n"..msg
end
mp.osd_message(msg, osd_time) mp.osd_message(msg, osd_time)
end end