fix(prompt): only pad on positive count

This commit is contained in:
Jan De Dobbeleer 2023-08-06 10:02:11 +02:00 committed by Jan De Dobbeleer
parent c4a1a55f9d
commit 744b1f042c

View file

@ -244,7 +244,13 @@ func (e *Engine) renderBlock(block *Block, cancelNewline bool) {
return
}
prompt := strings.Repeat(" ", space-length)
var prompt string
space -= length
if space > 0 {
prompt += strings.Repeat(" ", space-length)
}
prompt += text
e.write(prompt)
case RPrompt: