aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 6799c9c..dd0f54e 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -1201,7 +1201,11 @@ do
if item.type == 'Text' and #item.value == 1 and type(item.value[1]) == 'string' and item.value[1]:match("^[a-zA-Z_][a-zA-Z0-9_]$") then
insert(items, "." .. tostring(item.value[1]))
else
- insert(items, "[ " .. tostring(lua.expr) .. "]")
+ if lua.expr:sub(1, 1) == '[' then
+ insert(items, "[ " .. tostring(lua.expr) .. "]")
+ else
+ insert(items, "[" .. tostring(lua.expr) .. "]")
+ end
end
end
end