 
   genBounds: (location) ->
     bounds = {
-      start: @positions[location.startOffset]
-      end: @positions[location.endOffset]
+      start: @positions[location.start]
+      end: @positions[location.end]
     }
 
     return bounds

          i++

  fixBounds: (node) ->
    console.log "__location: #{JSON.stringify(node.__location)}"

    if not node
      return


  trimText: (node) ->
    location = node.__location
    location.endOffset = Math.min location.endOffset, @getEndPoint node
    text = @text[location.startOffset...location.endOffset].split '\n'
    i = 0
    while text[i].trim().length is 0
      location.startOffset += text[i].length + 1
