add missing new lua command WorkingDirectory to docs (#797)

* add missing new lua command WorkingDirectory to docs

* added messenger.AddLog to doc and changed lua commands from . to :
This commit is contained in:
Tommy
2017-09-02 15:30:19 +01:00
committed by Zachary Yedidia
parent 4f2fc096e5
commit c4d8b9e7fb

View File

@@ -71,9 +71,11 @@ as Go's GOOS variable, so `darwin`, `windows`, `linux`, `freebsd`...)
* `Loc(x, y int) Loc`: returns a new `Loc` struct
* `JoinPaths(dir... string) string` combines multiple directories to a full path
* `WorkingDirectory() string`: returns a rooted path name to the current working directory
* `DirectoryName(path string)` returns all but the last element of path ,typically the path's directory
* `JoinPaths(dir... string) string`: combines multiple directories to a full path
* `DirectoryName(path string)`: returns all but the last element of path ,typically the path's directory
* `GetOption(name string)`: returns the value of the requested option
@@ -140,10 +142,31 @@ The possible methods which you can call using the `messenger` variable are:
* `messenger.Message(msg ...interface{})`
* `messenger.Error(msg ...interface{})`
* `messenger.YesNoPrompt(prompt string) (bool, bool)`
* `messenger.YesNoPrompt(prompt string) (bool,bool)`
* `messenger.Prompt(prompt, historyType string, completionType Completion) (string, bool)`
* `messenger.AddLog(msg ...interface{})`
If you want a standard prompt, just use `messenger.Prompt(prompt, "", 0)`
## Note
`golang` function signatures use `.` and lua uses `:` so
```go
messenger.Message()
```
turns to
```lua
messenger:Message()
```
If you want a standard prompt, just use
```lua
messenger:Prompt(prompt, "", 0)
```
Debug or logging your plugin can be done with below lua example code.
```lua
messenger:AddLog("Message goes here ",pluginVariableToPrintHere)
```
In Micro Editor to see your plugin logging output press `ctrl E` then type `log`
A logging window will open and any logging sent from your plugin will be displayed here.
# Adding help files, syntax files, or colorschemes in your plugin