| File ChangeLog.LuaAPI changed (mode: 100644) (index aff6a8ca6..464fc45de) |
| ... |
... |
documented in the regular ChangeLog. |
| 9 |
9 |
|
|
| 10 |
10 |
Upgraded Lua from 5.4.7 to 5.4.8. |
Upgraded Lua from 5.4.7 to 5.4.8. |
| 11 |
11 |
|
|
|
12 |
|
Fixed a crash on passing a value that's not convertible to a string to |
|
13 |
|
VifmView:loadcustom(). |
|
14 |
|
|
| 12 |
15 |
0.13 to 0.14-beta (2025-01-19) |
0.13 to 0.14-beta (2025-01-19) |
| 13 |
16 |
|
|
| 14 |
17 |
Bumped API version to v0.2.0. |
Bumped API version to v0.2.0. |
| File data/vim/doc/app/vifm-lua.txt changed (mode: 100644) (index 19d12f613..e6c365ebd) |
| 1 |
|
*vifm-lua.txt* For Vifm version 1.0 Last change: 2025 Mar 22 |
|
|
1 |
|
*vifm-lua.txt* For Vifm version 1.0 Last change: 2026 Jan 13 |
| 2 |
2 |
|
|
| 3 |
3 |
Email for bugs and suggestions: <xaizek@posteo.net> |
Email for bugs and suggestions: <xaizek@posteo.net> |
| 4 |
4 |
|
|
| |
| ... |
... |
Possible fields of {info}: |
| 1593 |
1593 |
- "title" (string) |
- "title" (string) |
| 1594 |
1594 |
Title of the view. |
Title of the view. |
| 1595 |
1595 |
- "paths" (array of strings) |
- "paths" (array of strings) |
| 1596 |
|
List of paths. Can be empty. Paths that don't correspond to an existing |
|
| 1597 |
|
file or duplicates are ignored. |
|
|
1596 |
|
List of paths. Can be empty. Items that don't correspond to an existing |
|
1597 |
|
file, cannot be converted to a string or duplicates are ignored. |
| 1598 |
1598 |
- "type" (string) (default: "custom") |
- "type" (string) (default: "custom") |
| 1599 |
1599 |
What kind of custom view to create: |
What kind of custom view to create: |
| 1600 |
1600 |
- "custom" |
- "custom" |
| File src/lua/vifmview.c changed (mode: 100644) (index e29bd2d07..f07e5fd75) |
| ... |
... |
VLUA_API(vifmview_loadcustom)(lua_State *lua) |
| 583 |
583 |
while(lua_next(lua, -2) != 0) |
while(lua_next(lua, -2) != 0) |
| 584 |
584 |
{ |
{ |
| 585 |
585 |
const char *path = lua_tostring(lua, -1); |
const char *path = lua_tostring(lua, -1); |
| 586 |
|
(void)flist_custom_add(view, path); |
|
|
586 |
|
if(path != NULL) |
|
587 |
|
{ |
|
588 |
|
(void)flist_custom_add(view, path); |
|
589 |
|
} |
| 587 |
590 |
lua_pop(lua, 1); |
lua_pop(lua, 1); |
| 588 |
591 |
} |
} |
| 589 |
592 |
|
|
| File tests/lua/api_view.c changed (mode: 100644) (index 3a89893b7..ec6c8a857) |
| ... |
... |
TEST(vifmview_loadcustom) |
| 426 |
426 |
assert_string_equal("a", lwin.dir_entry[0].name); |
assert_string_equal("a", lwin.dir_entry[0].name); |
| 427 |
427 |
assert_string_equal("aa", lwin.dir_entry[1].name); |
assert_string_equal("aa", lwin.dir_entry[1].name); |
| 428 |
428 |
|
|
|
429 |
|
/* Invalid type is filtered out. */ |
|
430 |
|
GLUA_ENDS(vlua, "", |
|
431 |
|
"print(vifm.currview():loadcustom({ title = 'title'," |
|
432 |
|
"paths = { 'a', {} } }))"); |
|
433 |
|
assert_true(flist_custom_active(&lwin)); |
|
434 |
|
assert_int_equal(CV_REGULAR, lwin.custom.type); |
|
435 |
|
assert_int_equal(1, lwin.list_rows); |
|
436 |
|
assert_string_equal("a", lwin.dir_entry[0].name); |
|
437 |
|
|
| 429 |
438 |
/* Good invocation for unsorted view. */ |
/* Good invocation for unsorted view. */ |
| 430 |
439 |
GLUA_ENDS(vlua, "", |
GLUA_ENDS(vlua, "", |
| 431 |
440 |
"print(vifm.currview():loadcustom({ title = 'title'," |
"print(vifm.currview():loadcustom({ title = 'title'," |