     @decorateMarker()
     @disposables.add @marker.onDidChange (e) => @checkMarker e
 
-  updateWidth: ->
-    elRect = @editor.editorElement.getBoundingClientRect()
-    if not @view.parentElement? then return
-    w = elRect.width + elRect.left - 40 -
-        @view.parentElement.getBoundingClientRect().left
+  updateWidth: (el) ->
+    elRect = el.getBoundingClientRect()
+    if not @view.offsetParent? then return
+    w = elRect.width + elRect.left - 40 - @view.offsetParent.offsetLeft
     if w < 100 then w = 100
     @view.style.maxWidth = w + 'px'
 

# TODO: better scrolling behaviour
{throttle} = require 'underscore-plus'
{$, $$} = require 'atom-space-pen-views'
{CompositeDisposable, Emitter} = require 'atom'
trees = require '../tree'

metrics = throttle metrics, 60*60*1000

resizer = ResizeDetector strategy: "scroll"

debouncedUpdateWidth = (res, el) -> debounce(((res, el) -> res.updateWidth(el)), 200)

module.exports =
class Result
