chore: merge from master

lua5.4
TorchedSammy 2022-03-29 13:10:27 -04:00
commit e775e5646f
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 6 additions and 6 deletions

View File

@ -57,9 +57,9 @@ const (
seqPosSave = "\x1b[s"
seqPosRestore = "\x1b[u"
seqClearLineAfer = "\x1b[0k"
seqClearLineBefore = "\x1b[1k"
seqClearLine = "\x1b[2k"
seqClearLineAfer = "\x1b[0K"
seqClearLineBefore = "\x1b[1K"
seqClearLine = "\x1b[2K"
seqClearScreenBelow = "\x1b[0J"
seqClearScreen = "\x1b[2J" // Clears screen fully
seqCursorTopLeft = "\x1b[H" // Clears screen and places cursor on top-left

View File

@ -11,6 +11,7 @@ import (
// It also calculates the runes in the string as well as any non-printable escape codes.
func (rl *Instance) SetPrompt(s string) {
rl.mainPrompt = s
rl.computePrompt()
}
// RefreshPromptLog - A simple function to print a string message (a log, or more broadly,
@ -68,7 +69,6 @@ func (rl *Instance) RefreshPromptLog(log string) (err error) {
// 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.
// Prompt data intependent
if !rl.modeTabCompletion {
@ -82,7 +82,7 @@ func (rl *Instance) RefreshPromptInPlace(prompt string) (err error) {
// Update the prompt if a special has been passed.
if prompt != "" {
rl.mainPrompt = prompt
rl.SetPrompt(prompt)
}
if rl.Multiline {
@ -137,7 +137,7 @@ func (rl *Instance) RefreshPromptCustom(prompt string, offset int, clearLine boo
// Update the prompt if a special has been passed.
if prompt != "" {
rl.mainPrompt = prompt
rl.SetPrompt(prompt)
}
// Add a new line if needed