diff options
| author | Josh Wainwright <josh.wainwright@ldra.com> | 2017-03-22 12:44:24 +0000 |
|---|---|---|
| committer | Josh Wainwright <josh.wainwright@ldra.com> | 2017-03-22 12:44:24 +0000 |
| commit | 9454d90081d4d55c5c6b1384992dd58614e2d150 (patch) | |
| tree | 3cf3df84cb37e6a2dd5110c9f294258165a9b178 /vis-lua.c | |
| parent | d9928d0d5e2015a3a41ae730549ecf8638205958 (diff) | |
| download | vis-9454d90081d4d55c5c6b1384992dd58614e2d150.tar.gz vis-9454d90081d4d55c5c6b1384992dd58614e2d150.tar.xz | |
vis-lua: add usage documentation to command_register
Diffstat (limited to 'vis-lua.c')
| -rw-r--r-- | vis-lua.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1142,7 +1142,16 @@ static bool command_lua(Vis *vis, Win *win, void *data, bool force, const char * * @tparam[opt] string help the single line help text as displayed in `:help` * @treturn bool whether the command has been successfully registered * @usage - * TODO + * vis:command_register("foo", function(argv, force, win, cursor, range) + * for i,arg in ipairs(argv) do + * print(i..": "..arg) + * end + * print("was command forced with ! "..(force and "yes" or "no")) + * print(win.file.name) + * print(cursor.pos) + * print(range ~= nil and ('['..range.start..', '..range.finish..']') or "invalid range") + * return true; + * end) */ static int command_register(lua_State *L) { Vis *vis = obj_ref_check(L, 1, "vis"); |
