Merge pull request 'Alternative way of rendering when bookmarks are not open' (#167) from rendering-fix into release-2.3.1

Since this has been reviewed as functional I am merging into the release branch. There will be another opportunity to review, if need be, for the release branch when a PR is made into `develop`.
This commit is contained in:
Sloom Sloum Sluom IV 2020-05-28 00:50:47 -04:00
commit b8721366a2
1 changed files with 3 additions and 7 deletions

View File

@ -122,15 +122,11 @@ func (c *client) Draw() {
} else {
for i := 0; i < c.Height-3; i++ {
if i < len(pageContent) {
extra := 0
escapes := re.FindAllString(pageContent[i], -1)
for _, esc := range escapes {
extra += len(esc)
}
screen.WriteString(fmt.Sprintf("%-*.*s", c.Width+extra, c.Width+extra, pageContent[i]))
screen.WriteString(pageContent[i])
screen.WriteString("\033[0K")
screen.WriteString("\n")
} else {
screen.WriteString(fmt.Sprintf("%-*.*s", c.Width, c.Width, " "))
screen.WriteString("\033[0K")
screen.WriteString("\n")
}
}