From: Luca CPZ <1777696+lcpz@users.noreply.github.com> Date: Thu, 14 Feb 2019 15:26:41 +0000 (+0000) Subject: Merge pull request #420 from sim590/unpack-lua51-compat X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/013654cd1af4bb69f31c1c641cdb24bd8b7c58df?hp=93b31ef0e9851f593984657c0215ba2ed6488b2a Merge pull request #420 from sim590/unpack-lua51-compat util/menu_iterator: retro compatibility with lua 5.1 --- diff --git a/helpers.lua b/helpers.lua index 4d75f7b..d3fa259 100644 --- a/helpers.lua +++ b/helpers.lua @@ -12,7 +12,8 @@ local io = { lines = io.lines, open = io.open } local pairs = pairs local rawget = rawget -local table = { sort = table.sort } +local table = { sort = table.sort, unpack = table.unpack } +local unpack = unpack or table.unpack -- lua 5.1 retro-compatibility -- Lain helper functions for internal use -- lain.helpers diff --git a/util/menu_iterator.lua b/util/menu_iterator.lua index 0ea4e0e..9959b25 100644 --- a/util/menu_iterator.lua +++ b/util/menu_iterator.lua @@ -11,12 +11,13 @@ -- lain.util.menu_iterator local naughty = require("naughty") +local helpers = require("lain.helpers") local util = require("lain.util") local atable = require("awful.util").table local assert = assert local pairs = pairs local tconcat = table.concat -local unpack = unpack +local unpack = unpack or table.unpack -- lua 5.1 retro-compatibility local state = { cid = nil }