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

pull/143/head
TorchedSammy 2022-04-18 22:42:27 -04:00
parent 48cb62282d
commit bee8d6e9e6
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 5 additions and 1 deletions

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