Added clarifying comments

This commit is contained in:
sloumdrone 2019-09-10 20:23:44 -07:00
parent 84631a38da
commit a6d1f45be8
2 changed files with 8 additions and 0 deletions

View File

@ -449,6 +449,8 @@ func (c *client) goToLink(l string) {
} }
func (c *client) Visit(url string) { func (c *client) Visit(url string) {
// TODO both gemini and gopher should return a string
// The wrap lines function in cui needs to be rewritten
u, err := MakeUrl(url) u, err := MakeUrl(url)
if err != nil { if err != nil {
c.SetMessage(err.Error(), true) c.SetMessage(err.Error(), true)

View File

@ -85,6 +85,12 @@ func Clear(dir string) {
// than the specified console width, splitting them over two lines. returns the // than the specified console width, splitting them over two lines. returns the
// amended document content as a slice. // amended document content as a slice.
func wrapLines(s []string, consolewidth int) []string { func wrapLines(s []string, consolewidth int) []string {
// TODO redo this so that it returns a string and can hard and
// soft wrap. It will use parsing to go char by char. CUI should
// set tabs to 4 on screen init. Multispace chars should be detected
// tab spacing should be detected using % to see where the next tab stop
// is. Use a counter as building the sub buffer. len returns num of bytes
// be sure to get num of chars instead: len([]rune("a")).
indent := " " //11 spaces indent := " " //11 spaces
out := []string{} out := []string{}
for _, ln := range s { for _, ln := range s {