mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "9d69b63a0f7cd7f10b9e1d7a9154966940647938" and "1e48a3e03d734a09ccf2993c8409e5e5dc64cad3" have entirely different histories.
9d69b63a0f
...
1e48a3e03d
2
go.mod
2
go.mod
|
@ -28,4 +28,4 @@ replace github.com/maxlandon/readline => ./readline
|
||||||
|
|
||||||
replace layeh.com/gopher-luar => github.com/layeh/gopher-luar v1.0.10
|
replace layeh.com/gopher-luar => github.com/layeh/gopher-luar v1.0.10
|
||||||
|
|
||||||
replace github.com/arnodel/golua => github.com/Rosettea/golua v0.0.0-20220419183026-6d22d6fec5ac
|
replace github.com/arnodel/golua => github.com/Rosettea/golua v0.0.0-20220406024702-f447a8095170
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -1,7 +1,5 @@
|
||||||
github.com/Rosettea/golua v0.0.0-20220406024702-f447a8095170 h1:k2MAUwR1diHqqoFPEhxMKAQoz131tMSti8ArzCTg2HI=
|
github.com/Rosettea/golua v0.0.0-20220406024702-f447a8095170 h1:k2MAUwR1diHqqoFPEhxMKAQoz131tMSti8ArzCTg2HI=
|
||||||
github.com/Rosettea/golua v0.0.0-20220406024702-f447a8095170/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE=
|
github.com/Rosettea/golua v0.0.0-20220406024702-f447a8095170/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE=
|
||||||
github.com/Rosettea/golua v0.0.0-20220419183026-6d22d6fec5ac h1:dtXrgjch8PQyf7C90anZUquB5U3dr8AcMGJofeuirrI=
|
|
||||||
github.com/Rosettea/golua v0.0.0-20220419183026-6d22d6fec5ac/go.mod h1:9jzpYPiU2is0HVGCiuIOBSXdergHUW44IEjmuN1UrIE=
|
|
||||||
github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220306140409-795a84b00b4e h1:P2XupP8SaylWaudD1DqbWtZ3mIa8OsE9635LmR+Q+lg=
|
github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220306140409-795a84b00b4e h1:P2XupP8SaylWaudD1DqbWtZ3mIa8OsE9635LmR+Q+lg=
|
||||||
github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220306140409-795a84b00b4e/go.mod h1:R09vh/04ILvP2Gj8/Z9Jd0Dh0ZIvaucowMEs6abQpWs=
|
github.com/Rosettea/sh/v3 v3.4.0-0.dev.0.20220306140409-795a84b00b4e/go.mod h1:R09vh/04ILvP2Gj8/Z9Jd0Dh0ZIvaucowMEs6abQpWs=
|
||||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
|
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
|
||||||
|
|
|
@ -2,7 +2,6 @@ package readline
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
@ -79,7 +78,9 @@ func (rl *Instance) Readline() (string, error) {
|
||||||
var err error
|
var err error
|
||||||
i, err = os.Stdin.Read(b)
|
i, err = os.Stdin.Read(b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, syscall.EAGAIN) {
|
// i shouldnt really check the error like this but i dont know what
|
||||||
|
// the actual thing is so
|
||||||
|
if err.Error() == "read /dev/stdin: resource temporarily unavailable" {
|
||||||
err = syscall.SetNonblock(syscall.Stdin, false)
|
err = syscall.SetNonblock(syscall.Stdin, false)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
continue
|
continue
|
||||||
|
@ -867,8 +868,6 @@ func (rl *Instance) escapeSeq(r []rune) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rl *Instance) carridgeReturn() {
|
func (rl *Instance) carridgeReturn() {
|
||||||
rl.moveCursorByAdjust(len(rl.line))
|
|
||||||
rl.updateHelpers()
|
|
||||||
rl.clearHelpers()
|
rl.clearHelpers()
|
||||||
print("\r\n")
|
print("\r\n")
|
||||||
if rl.HistoryAutoWrite {
|
if rl.HistoryAutoWrite {
|
||||||
|
|
|
@ -47,10 +47,6 @@ func (rl *Instance) updateReferences() {
|
||||||
fullRest := toEndLine % GetTermWidth()
|
fullRest := toEndLine % GetTermWidth()
|
||||||
rl.fullX = fullRest
|
rl.fullX = fullRest
|
||||||
|
|
||||||
if fullRest == 0 && fullOffset > 0 {
|
|
||||||
print("\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use rl.pos value to get the offset to go TO/FROM the CURRENT POSITION
|
// Use rl.pos value to get the offset to go TO/FROM the CURRENT POSITION
|
||||||
lineToCursorPos := rl.promptLen + cPosLine
|
lineToCursorPos := rl.promptLen + cPosLine
|
||||||
offsetToCursor := lineToCursorPos / GetTermWidth()
|
offsetToCursor := lineToCursorPos / GetTermWidth()
|
||||||
|
@ -120,7 +116,7 @@ func (rl *Instance) renderHelpers() {
|
||||||
rl.getHintText()
|
rl.getHintText()
|
||||||
rl.writeHintText()
|
rl.writeHintText()
|
||||||
} else if !rl.compConfirmWait {
|
} else if !rl.compConfirmWait {
|
||||||
// for the same reason above of wanting it below user input, do nothing here
|
// for the same reason above, do nothing here
|
||||||
} else {
|
} else {
|
||||||
rl.writeHintText()
|
rl.writeHintText()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue