diff --git a/api.go b/api.go index 99b2c83..f2d4aa1 100644 --- a/api.go +++ b/api.go @@ -175,7 +175,7 @@ These will be formatted and replaced with the appropriate values. --- @param str string */ func hlprompt(L *lua.LState) int { - prompt := L.CheckString(1) + prompt = L.CheckString(1) lr.SetPrompt(fmtPrompt(prompt)) return 0 @@ -386,7 +386,7 @@ func hlwhich(L *lua.LState) int { l.Push(lua.LNil) return 1 } - + l.Push(lua.LString(path)) return 1 } diff --git a/history.go b/history.go index 921b6e7..f652547 100644 --- a/history.go +++ b/history.go @@ -71,5 +71,5 @@ func (h *fileHistory) Len() int { } func (h *fileHistory) Dump() interface{} { - return nil + return h.items } diff --git a/main.go b/main.go index 739c7ff..36decf3 100644 --- a/main.go +++ b/main.go @@ -40,7 +40,7 @@ func main() { confDir, _ = os.UserConfigDir() preloadPath = strings.Replace(preloadPath, "~", homedir, 1) sampleConfPath = strings.Replace(sampleConfPath, "~", homedir, 1) - + // i honestly dont know what directories to use for this switch runtime.GOOS { case "linux": @@ -165,6 +165,7 @@ func main() { input: for interactive { + lr.SetPrompt(fmtPrompt(prompt)) running = false input, err := lr.Read() diff --git a/vars.go b/vars.go index eddf585..07d25a7 100644 --- a/vars.go +++ b/vars.go @@ -7,6 +7,7 @@ var ( defaultHistDir = "" commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'" + prompt string multilinePrompt = "> " )