tags: don't error when trying to migrate a tag when no tag exists

This commit is contained in:
Vincent Bernat 2021-01-24 18:27:57 +01:00
parent 36951ef8ee
commit 6442ecbecd

View file

@ -98,6 +98,7 @@ config.keys.global = awful.util.table.join(
function() function()
if screen.count() == 1 then return nil end if screen.count() == 1 then return nil end
local t = awful.tag.selected() local t = awful.tag.selected()
if t == nil then return nil end
local s = awful.util.cycle(screen.count(), t.screen + 1) local s = awful.util.cycle(screen.count(), t.screen + 1)
awful.tag.history.restore() awful.tag.history.restore()
t = shifty.tagtoscr(s, t) t = shifty.tagtoscr(s, t)
@ -108,6 +109,7 @@ config.keys.global = awful.util.table.join(
function() function()
if screen.count() == 1 then return nil end if screen.count() == 1 then return nil end
local t = awful.tag.selected() local t = awful.tag.selected()
if t == nil then return nil end
local o = t.screen local o = t.screen
local s = awful.util.cycle(screen.count(), o + 1) local s = awful.util.cycle(screen.count(), o + 1)
for _, t in pairs(screen[o]:tags()) do for _, t in pairs(screen[o]:tags()) do