1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 22:33:52 +03:00
wezterm/lua-api-crates/share-data
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
..
src add __len and __pairs metamethods to wezterm.GLOBALS 2023-03-21 21:04:52 -07:00
Cargo.toml wezterm.GLOBAL now returns references to stored data 2023-01-24 18:26:14 -07:00