code: func lineSelection(text []byte) Selection {
  	i, j := 0, 0
  	return func() (seg []int) {
  		// find next newline, if any
  		for j < len(text) {
  			j++
  			if text[j-1] == '\n' {
  				break
  			}
  		}
  		if i < j {
  			// text[i:j] constitutes a line
  			seg = []int{i, j}
  			i = j
  		}
  		return
  	}
  }
docs: // ----------------------------------------------------------------------------
  // Implementation of FormatText
  // lineSelection returns the line segments for text as a Selection.