Menubar: Match for command names as well.
Enabling matching the command name of the menubar entries with the query, which improves the flexibility of the widget. The functionality works as follows: You want to run GIMP, which has a name of "GNU Image Manipulation Program". Previously by typing in gimp one would have <no matches>, but now it will match GIMP entry. Signed-off-by: Ignas Anikevicius (gns_ank) <anikevicius@gmail.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
6809f6afcf
commit
d121d94366
|
@ -136,12 +136,14 @@ local function menulist_update(query)
|
|||
end
|
||||
end
|
||||
|
||||
-- Add the applications
|
||||
-- Add the applications according to their name and cmdline
|
||||
for i, v in ipairs(menu_entries) do
|
||||
v.focused = false
|
||||
if not current_category or v.category == current_category then
|
||||
if string.match(v.name, nocase(query)) then
|
||||
if string.match(v.name, "^" .. nocase(query)) then
|
||||
if string.match(v.name, nocase(query))
|
||||
or string.match(v.cmdline, nocase(query)) then
|
||||
if string.match(v.name, "^" .. nocase(query))
|
||||
or string.match(v.cmdline, "^" .. nocase(query)) then
|
||||
table.insert(shownitems, v)
|
||||
else
|
||||
table.insert(match_inside, v)
|
||||
|
|
Loading…
Reference in New Issue