~adnano/astronaut

c26254bf6968bc77479feecfb054e4a5ec01b8e7 — Adnan Maolood 24 days ago 8e623d1
tab: Minor cleanup
1 files changed, 3 insertions(+), 6 deletions(-)

M tab.go
M tab.go => tab.go +3 -6
@@ 313,7 313,6 @@ func (t *Tab) Error(err error) {
	var buf bytes.Buffer
	templates.ExecuteTemplate(&buf, "error.tmpl", err)
	t.setText(NewParsedGemText(t.view, t, io.NopCloser(&buf)))
	t.view.Invalidate()
}

func (t *Tab) ResolveReference(rawurl string) (*url.URL, error) {


@@ 377,7 376,6 @@ func (t *Tab) do(ctx context.Context, req *gemini.Request, via []*gemini.Request
	if err != nil {
		if err == ErrNotTrusted {
			// Ignore error
			t.setText(nil)
			return nil
		}
		return err


@@ 431,7 429,6 @@ func (t *Tab) do(ctx context.Context, req *gemini.Request, via []*gemini.Request
		if t.shouldRedirect(&redirect, via) {
			return t.do(ctx, &redirect, via)
		}
		t.setText(nil)
		return nil

	case gemini.StatusSuccess:


@@ 558,6 555,7 @@ func (t *Tab) trustCertificate(hostname string, cert *x509.Certificate) error {
			}
		}
		t.setText(gem)
		defer t.setText(nil)
	}

	select {


@@ 607,6 605,7 @@ func (t *Tab) shouldRedirect(req *gemini.Request, via []*gemini.Request) bool {
			}
		}
		t.setText(gem)
		defer t.setText(nil)
	}

	select {


@@ 700,11 699,9 @@ func (t *Tab) handleDownload(req *gemini.Request, resp *gemini.Response, mediaty
			}
		}
		t.setText(gem)
		t.view.Invalidate()
		defer t.setText(nil)
	}

	defer t.setText(nil)

	select {
	case choice := <-ch:
		switch choice {