mirror of https://github.com/Hilbis/Hilbish
Compare commits
4 Commits
1e48a3e03d
...
9d69b63a0f
Author | SHA1 | Date |
---|---|---|
TorchedSammy | 9d69b63a0f | |
TorchedSammy | b83c09a2b3 | |
TorchedSammy | bee8d6e9e6 | |
TorchedSammy | 48cb62282d |
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 github.com/arnodel/golua => github.com/Rosettea/golua v0.0.0-20220406024702-f447a8095170
|
||||
replace github.com/arnodel/golua => github.com/Rosettea/golua v0.0.0-20220419183026-6d22d6fec5ac
|
||||
|
|
2
go.sum
2
go.sum
|
@ -1,5 +1,7 @@
|
|||
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-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/go.mod h1:R09vh/04ILvP2Gj8/Z9Jd0Dh0ZIvaucowMEs6abQpWs=
|
||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8=
|
||||
|
|
|
@ -2,6 +2,7 @@ package readline
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
|
@ -78,9 +79,7 @@ func (rl *Instance) Readline() (string, error) {
|
|||
var err error
|
||||
i, err = os.Stdin.Read(b)
|
||||
if err != nil {
|
||||
// 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" {
|
||||
if errors.Is(err, syscall.EAGAIN) {
|
||||
err = syscall.SetNonblock(syscall.Stdin, false)
|
||||
if err == nil {
|
||||
continue
|
||||
|
@ -868,6 +867,8 @@ func (rl *Instance) escapeSeq(r []rune) {
|
|||
}
|
||||
|
||||
func (rl *Instance) carridgeReturn() {
|
||||
rl.moveCursorByAdjust(len(rl.line))
|
||||
rl.updateHelpers()
|
||||
rl.clearHelpers()
|
||||
print("\r\n")
|
||||
if rl.HistoryAutoWrite {
|
||||
|
|
|
@ -47,6 +47,10 @@ func (rl *Instance) updateReferences() {
|
|||
fullRest := toEndLine % GetTermWidth()
|
||||
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
|
||||
lineToCursorPos := rl.promptLen + cPosLine
|
||||
offsetToCursor := lineToCursorPos / GetTermWidth()
|
||||
|
@ -116,7 +120,7 @@ func (rl *Instance) renderHelpers() {
|
|||
rl.getHintText()
|
||||
rl.writeHintText()
|
||||
} else if !rl.compConfirmWait {
|
||||
// for the same reason above, do nothing here
|
||||
// for the same reason above of wanting it below user input, do nothing here
|
||||
} else {
|
||||
rl.writeHintText()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue