2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-01 11:13:24 +00:00

fix(readline): input going to next line if its longer than terminal width

This commit is contained in:
TorchedSammy 2022-04-18 22:42:27 -04:00
parent 48cb62282d
commit bee8d6e9e6
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -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()
}