mirror of https://github.com/Hilbis/Hilbish
fix: revert "fix: multiline cursor redraw"
This reverts commit 1339dc4a2f
.
this caused a few issues, including
history search messing up previous lines
what this commit was trying to fix is unimportant anyway
runner-prompt
parent
1339dc4a2f
commit
f9a2a981b4
|
@ -45,7 +45,6 @@ func (rl *Instance) echo() {
|
||||||
print(seqClearScreenBelow)
|
print(seqClearScreenBelow)
|
||||||
|
|
||||||
// Print the prompt
|
// Print the prompt
|
||||||
rl.promptInPlace("")
|
|
||||||
print(string(rl.realPrompt))
|
print(string(rl.realPrompt))
|
||||||
|
|
||||||
// Assemble the line, taking virtual completions into account
|
// Assemble the line, taking virtual completions into account
|
||||||
|
|
|
@ -73,7 +73,8 @@ func (rl *Instance) RefreshPromptLog(log string) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rl *Instance) promptInPlace(prompt string) {
|
// RefreshPromptInPlace - Refreshes the prompt in the very same place he is.
|
||||||
|
func (rl *Instance) RefreshPromptInPlace(prompt string) (err error) {
|
||||||
// We adjust cursor movement, depending on which mode we're currently in.
|
// We adjust cursor movement, depending on which mode we're currently in.
|
||||||
// Prompt data intependent
|
// Prompt data intependent
|
||||||
if !rl.modeTabCompletion {
|
if !rl.modeTabCompletion {
|
||||||
|
@ -90,11 +91,15 @@ func (rl *Instance) promptInPlace(prompt string) {
|
||||||
rl.SetPrompt(prompt)
|
rl.SetPrompt(prompt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rl.Multiline {
|
||||||
|
rl.tcUsedY += 1
|
||||||
|
}
|
||||||
|
|
||||||
// Clear the input line and everything below
|
// Clear the input line and everything below
|
||||||
print(seqClearLine)
|
print(seqClearLine)
|
||||||
moveCursorUp(rl.infoY + rl.tcUsedY)
|
moveCursorUp(rl.infoY + rl.tcUsedY)
|
||||||
moveCursorBackwards(GetTermWidth())
|
moveCursorBackwards(GetTermWidth())
|
||||||
print("\r" + seqClearScreenBelow)
|
print("\r\n" + seqClearScreenBelow)
|
||||||
|
|
||||||
// Add a new line if needed
|
// Add a new line if needed
|
||||||
if rl.Multiline {
|
if rl.Multiline {
|
||||||
|
@ -103,11 +108,8 @@ func (rl *Instance) promptInPlace(prompt string) {
|
||||||
} else {
|
} else {
|
||||||
fmt.Print(rl.mainPrompt)
|
fmt.Print(rl.mainPrompt)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// RefreshPromptInPlace - Refreshes the prompt in the very same place he is.
|
// Refresh the line
|
||||||
func (rl *Instance) RefreshPromptInPlace(prompt string) (err error) {
|
|
||||||
rl.promptInPlace(prompt)
|
|
||||||
rl.updateHelpers()
|
rl.updateHelpers()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue