|
|
|
@ -73,7 +73,8 @@ func (c *client) Draw() {
|
|
|
|
|
screen.WriteString("\033[0m")
|
|
|
|
|
screen.WriteString(c.TopBar.Render(c.Width, c.Options["theme"]))
|
|
|
|
|
screen.WriteString("\n")
|
|
|
|
|
pageContent := c.PageState.Render(c.Height, c.Width-1, (c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
pageContent := c.PageState.Render(c.Height, c.Width-1, maxWidth, (c.Options["theme"] == "color"))
|
|
|
|
|
var re *regexp.Regexp
|
|
|
|
|
if c.Options["theme"] == "inverse" {
|
|
|
|
|
screen.WriteString("\033[7m")
|
|
|
|
@ -258,7 +259,8 @@ func (c *client) TakeControlInput() {
|
|
|
|
|
}
|
|
|
|
|
err = c.NextSearchItem(0)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.PageState.History[c.PageState.Position].WrapContent(c.Width-1,(c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
c.PageState.History[c.PageState.Position].WrapContent(c.Width-1,maxWidth,(c.Options["theme"] == "color"))
|
|
|
|
|
c.Draw()
|
|
|
|
|
}
|
|
|
|
|
case ':', ' ':
|
|
|
|
@ -988,7 +990,8 @@ func (c *client) handleGopher(u Url) {
|
|
|
|
|
} else {
|
|
|
|
|
pg.FileType = "text"
|
|
|
|
|
}
|
|
|
|
|
pg.WrapContent(c.Width-1, (c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
pg.WrapContent(c.Width-1, maxWidth, (c.Options["theme"] == "color"))
|
|
|
|
|
c.PageState.Add(pg)
|
|
|
|
|
c.SetPercentRead()
|
|
|
|
|
c.ClearMessage()
|
|
|
|
@ -1015,7 +1018,8 @@ func (c *client) handleGemini(u Url) {
|
|
|
|
|
u.Mime = capsule.MimeMin
|
|
|
|
|
pg := MakePage(u, capsule.Content, capsule.Links)
|
|
|
|
|
pg.FileType = capsule.MimeMaj
|
|
|
|
|
pg.WrapContent(c.Width-1, (c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
pg.WrapContent(c.Width-1, maxWidth, (c.Options["theme"] == "color"))
|
|
|
|
|
c.PageState.Add(pg)
|
|
|
|
|
c.SetPercentRead()
|
|
|
|
|
c.ClearMessage()
|
|
|
|
@ -1081,7 +1085,8 @@ func (c *client) handleLocal(u Url) {
|
|
|
|
|
if ext == ".jpg" || ext == ".jpeg" || ext == ".gif" || ext == ".png" {
|
|
|
|
|
pg.FileType = "image"
|
|
|
|
|
}
|
|
|
|
|
pg.WrapContent(c.Width-1, (c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
pg.WrapContent(c.Width-1, maxWidth, (c.Options["theme"] == "color"))
|
|
|
|
|
c.PageState.Add(pg)
|
|
|
|
|
c.SetPercentRead()
|
|
|
|
|
c.ClearMessage()
|
|
|
|
@ -1097,7 +1102,8 @@ func (c *client) handleFinger(u Url) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
pg := MakePage(u, content, []string{})
|
|
|
|
|
pg.WrapContent(c.Width-1, (c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
pg.WrapContent(c.Width-1, maxWidth, (c.Options["theme"] == "color"))
|
|
|
|
|
c.PageState.Add(pg)
|
|
|
|
|
c.SetPercentRead()
|
|
|
|
|
c.ClearMessage()
|
|
|
|
@ -1117,7 +1123,8 @@ func (c *client) handleWeb(u Url) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
pg := MakePage(u, page.Content, page.Links)
|
|
|
|
|
pg.WrapContent(c.Width-1, (c.Options["theme"] == "color"))
|
|
|
|
|
maxWidth, _ := strconv.Atoi(c.Options["maxwidth"])
|
|
|
|
|
pg.WrapContent(c.Width-1, maxWidth, (c.Options["theme"] == "color"))
|
|
|
|
|
c.PageState.Add(pg)
|
|
|
|
|
c.SetPercentRead()
|
|
|
|
|
c.ClearMessage()
|
|
|
|
|