awful.tag.viewmore: Make screen optional (FS#1203)

The documentation says that screen, the last argument to viewmore(), is an
optional argument. However, the implementation only treated it as an optional
argument in one place.

Fix this by always setting the screen variable itself to a screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2013-12-30 11:33:09 +01:00
parent aa51379be0
commit 5cd8c7e540

View file

@ -467,7 +467,8 @@ end
-- @param tags A table with tags to view only.
-- @param screen Optional screen number of the tags.
function tag.viewmore(tags, screen)
local screen_tags = tag.gettags(screen or capi.mouse.screen)
local screen = screen or capi.mouse.screen
local screen_tags = tag.gettags(screen)
for _, _tag in ipairs(screen_tags) do
if not util.table.hasitem(tags, _tag) then
_tag.selected = false