Commit be70ce8
committed
fix: pass opts.name to serpent to correct reference deserialize
Before, obj/func ref is sometimes deserialized as nil since:
1. serpent don't know who fn1 before the full table is returned since
the serialized data is a compact version to ensure func/obj ref is
consistant
2. lua table is random, so it's also possible to deserialize fn2
correctly, but fn1=nil
```
return { fn1 = my_func, fn2 = fn1 }
```
Apply opts.name="_" for serpent, it would be like:
```
local _ = { fn1 = my_func }
_.fn2 = _.fn1
return _
```1 parent bd281b9 commit be70ce8
5 files changed
Lines changed: 18 additions & 8 deletions
File tree
- lua/fzf-lua
- previewer
- test
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1565 | 1565 | | |
1566 | 1566 | | |
1567 | 1567 | | |
1568 | | - | |
1569 | 1568 | | |
1570 | 1569 | | |
1571 | 1570 | | |
1572 | 1571 | | |
1573 | 1572 | | |
1574 | | - | |
| 1573 | + | |
1575 | 1574 | | |
1576 | 1575 | | |
1577 | 1576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
201 | 213 | | |
0 commit comments