Add new plugin runtime function

This commit is contained in:
Zachary Yedidia
2016-09-27 14:24:52 -04:00
parent c1d08a6dc0
commit 0de167b07b
3 changed files with 5 additions and 1 deletions

View File

@@ -326,6 +326,7 @@ func main() {
L.SetGlobal("ReadRuntimeFile", luar.New(L, PluginReadRuntimeFile)) L.SetGlobal("ReadRuntimeFile", luar.New(L, PluginReadRuntimeFile))
L.SetGlobal("ListRuntimeFiles", luar.New(L, PluginListRuntimeFiles)) L.SetGlobal("ListRuntimeFiles", luar.New(L, PluginListRuntimeFiles))
L.SetGlobal("AddRuntimeFile", luar.New(L, PluginAddRuntimeFile)) L.SetGlobal("AddRuntimeFile", luar.New(L, PluginAddRuntimeFile))
L.SetGlobal("AddRuntimeFilesFromDirectory", luar.New(L, PluginAddRuntimeFilesFromDirectory))
jobs = make(chan JobFunction, 100) jobs = make(chan JobFunction, 100)
events = make(chan tcell.Event, 100) events = make(chan tcell.Event, 100)

File diff suppressed because one or more lines are too long

View File

@@ -127,6 +127,9 @@ called `test`, you would create the `test.md` file for example, and runt the fun
AddRuntimeFile("test", "help", "test.md") AddRuntimeFile("test", "help", "test.md")
``` ```
Use `AddRuntimeFilesFromDirectory(name, type, dir, pattern)` to add a number of files
to the runtime.
# Autocomplete command arguments # Autocomplete command arguments
See this example to learn how to use `MakeCompletion` and `MakeCommand` See this example to learn how to use `MakeCompletion` and `MakeCommand`