1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 07:46:59 +03:00
Commit Graph

4 Commits

Author SHA1 Message Date
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
Jalil David Salamé Messina
cb9dc3a800 fix(clippy): Remove unnecessary clone/to_string calls 2023-03-16 07:40:12 -07:00
Wez Furlong
9d7e613cfa
wezterm.GLOBAL now returns references to stored data
This smoothes out a rough edge and makes things work
more naturally.

refs: https://github.com/wez/wezterm/discussions/2983
2023-01-24 18:26:14 -07:00
Wez Furlong
5bcb0de442 lua: add wezterm.GLOBAL 2022-06-18 21:31:53 -07:00