1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 23:21:08 +03:00
wezterm/lua-api-crates/share-data/src
Wez Furlong 8755e731d3
add __len and __pairs metamethods to wezterm.GLOBALS
Fixes this:

```
> wezterm.GLOBAL.foo = {"bar", "baz"}
> wezterm.GLOBAL.foo
[
    "bar",
    "baz",
]
> #wezterm.GLOBAL.foo
runtime error: [string "repl"]:1: attempt to get length of a userdata value (field 'foo')
stack traceback:
        [string "repl"]:1: in main chunk
>
```

and allows this:

```
> for k, v in pairs(wezterm.GLOBAL.foo) do print(k, v) ; end
```
2023-03-21 21:04:52 -07:00
..
lib.rs add __len and __pairs metamethods to wezterm.GLOBALS 2023-03-21 21:04:52 -07:00