awful.placement: Add various `stretch` aliases

Use the same convention as `align` aliases
This commit is contained in:
Emmanuel Lepage Vallee 2016-03-15 02:09:32 -04:00
parent 7b7802f559
commit 19913ba62d
1 changed files with 16 additions and 0 deletions

View File

@ -627,6 +627,22 @@ function placement.stretch(d, args)
attach(d, placement["stretch_"..args.direction], args) attach(d, placement["stretch_"..args.direction], args)
end end
-- Add the alias functions
for _,v in ipairs {"left", "right", "up", "down"} do
placement["stretch_"..v] = function(d, args)
local new_args = setmetatable({direction = v}, {__index=args})
placement.stretch(d, new_args)
end
end
---@DOC_awful_placement_stretch_left_EXAMPLE@
---@DOC_awful_placement_stretch_right_EXAMPLE@
---@DOC_awful_placement_stretch_up_EXAMPLE@
---@DOC_awful_placement_stretch_down_EXAMPLE@
return placement return placement
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80