mirror of https://github.com/Hilbis/Hilbish
fix: add back prompt global var
fixes an issue with multiline prompt overriding user's prompt permanentlywindows-fixes
parent
a0dff5babf
commit
f1dfd59c4c
4
api.go
4
api.go
|
@ -175,7 +175,7 @@ These will be formatted and replaced with the appropriate values.
|
||||||
--- @param str string
|
--- @param str string
|
||||||
*/
|
*/
|
||||||
func hlprompt(L *lua.LState) int {
|
func hlprompt(L *lua.LState) int {
|
||||||
prompt := L.CheckString(1)
|
prompt = L.CheckString(1)
|
||||||
lr.SetPrompt(fmtPrompt(prompt))
|
lr.SetPrompt(fmtPrompt(prompt))
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
@ -386,7 +386,7 @@ func hlwhich(L *lua.LState) int {
|
||||||
l.Push(lua.LNil)
|
l.Push(lua.LNil)
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
l.Push(lua.LString(path))
|
l.Push(lua.LString(path))
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,5 +71,5 @@ func (h *fileHistory) Len() int {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *fileHistory) Dump() interface{} {
|
func (h *fileHistory) Dump() interface{} {
|
||||||
return nil
|
return h.items
|
||||||
}
|
}
|
||||||
|
|
3
main.go
3
main.go
|
@ -40,7 +40,7 @@ func main() {
|
||||||
confDir, _ = os.UserConfigDir()
|
confDir, _ = os.UserConfigDir()
|
||||||
preloadPath = strings.Replace(preloadPath, "~", homedir, 1)
|
preloadPath = strings.Replace(preloadPath, "~", homedir, 1)
|
||||||
sampleConfPath = strings.Replace(sampleConfPath, "~", homedir, 1)
|
sampleConfPath = strings.Replace(sampleConfPath, "~", homedir, 1)
|
||||||
|
|
||||||
// i honestly dont know what directories to use for this
|
// i honestly dont know what directories to use for this
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "linux":
|
case "linux":
|
||||||
|
@ -165,6 +165,7 @@ func main() {
|
||||||
|
|
||||||
input:
|
input:
|
||||||
for interactive {
|
for interactive {
|
||||||
|
lr.SetPrompt(fmtPrompt(prompt))
|
||||||
running = false
|
running = false
|
||||||
|
|
||||||
input, err := lr.Read()
|
input, err := lr.Read()
|
||||||
|
|
Loading…
Reference in New Issue