Merge pull request #45 from georgijd/reset-cursors-on-new-req

Reset cursors before each request
This commit is contained in:
Adam Tauber 2017-02-10 02:25:39 +01:00 committed by GitHub
commit 672d90209d

View File

@ -414,6 +414,9 @@ func (a *App) SubmitRequest(g *gocui.Gui, _ *gocui.View) error {
header_str += fmt.Sprintf("\x1b[0;33m%v:\x1b[0;0m %v\n", hname, strings.Join(response.Header[hname], ","))
}
fmt.Fprint(vrh, header_str)
if _, err := vrh.Line(0); err != nil {
vrh.SetOrigin(0, 0)
}
r.ResponseHeaders = header_str
return nil
})
@ -444,8 +447,12 @@ func (a *App) PrintBody(g *gocui.Gui) {
} else {
vrb.Write(req.RawResponseBody)
}
if _, err := vrb.Line(0); err != nil {
vrb.SetOrigin(0, 0)
}
return nil
}
vrb.SetOrigin(0, 0)
search_re, err := regexp.Compile(search_text)
if err != nil {
fmt.Fprint(vrb, "Error: invalid search regexp")