forked from sloum/bombadillo
Alternative way of rendering when bookmarks are not open
This commit is contained in:
parent
f793bdd806
commit
c9d634499b
10
client.go
10
client.go
|
@ -121,15 +121,11 @@ func (c *client) Draw() {
|
||||||
} else {
|
} else {
|
||||||
for i := 0; i < c.Height-3; i++ {
|
for i := 0; i < c.Height-3; i++ {
|
||||||
if i < len(pageContent) {
|
if i < len(pageContent) {
|
||||||
extra := 0
|
screen.WriteString(pageContent[i])
|
||||||
escapes := re.FindAllString(pageContent[i], -1)
|
screen.WriteString("\033[0K")
|
||||||
for _, esc := range escapes {
|
|
||||||
extra += len(esc)
|
|
||||||
}
|
|
||||||
screen.WriteString(fmt.Sprintf("%-*.*s", c.Width+extra, c.Width+extra, pageContent[i]))
|
|
||||||
screen.WriteString("\n")
|
screen.WriteString("\n")
|
||||||
} else {
|
} else {
|
||||||
screen.WriteString(fmt.Sprintf("%-*.*s", c.Width, c.Width, " "))
|
screen.WriteString("\033[0K")
|
||||||
screen.WriteString("\n")
|
screen.WriteString("\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue