зеркало из
https://github.com/Hilbis/Hilbish
synced 2025-07-09 04:22:03 +00:00
fix: add back prompt global var
fixes an issue with multiline prompt overriding user's prompt permanently
Этот коммит содержится в:
родитель
a0dff5babf
Коммит
f1dfd59c4c
2
api.go
2
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
|
||||
|
@ -71,5 +71,5 @@ func (h *fileHistory) Len() int {
|
||||
}
|
||||
|
||||
func (h *fileHistory) Dump() interface{} {
|
||||
return nil
|
||||
return h.items
|
||||
}
|
||||
|
1
main.go
1
main.go
@ -165,6 +165,7 @@ func main() {
|
||||
|
||||
input:
|
||||
for interactive {
|
||||
lr.SetPrompt(fmtPrompt(prompt))
|
||||
running = false
|
||||
|
||||
input, err := lr.Read()
|
||||
|
1
vars.go
1
vars.go
@ -7,6 +7,7 @@ var (
|
||||
defaultHistDir = ""
|
||||
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"
|
||||
|
||||
prompt string
|
||||
multilinePrompt = "> "
|
||||
)
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user