C-j fix; tool doc upd
This commit is contained in:
@@ -1598,7 +1598,10 @@ func (e *editor) draw() {
|
||||
er, _ := textPos(P, W, s, len([]rune(s)))
|
||||
pr, pc := textPos(P, W, s, e.pos)
|
||||
if e.crow > 0 { fmt.Printf("\033[%dA", e.crow) }
|
||||
fmt.Print("\r\033[J" + e.prompt + s)
|
||||
// In raw mode OPOST is off, so a bare \n only moves down without
|
||||
// returning to column 0. Emit \r\n so each logical line starts at
|
||||
// column 0, matching the column-reset assumption in textPos().
|
||||
fmt.Print("\r\033[J" + e.prompt + strings.ReplaceAll(s, "\n", "\r\n"))
|
||||
if up := er - pr; up > 0 { fmt.Printf("\033[%dA", up) }
|
||||
fmt.Print("\r")
|
||||
if pc > 0 { fmt.Printf("\033[%dC", pc) }
|
||||
|
||||
Reference in New Issue
Block a user