     @decorateMarker()
     @disposables.add @marker.onDidChange (e) => @checkMarker e
 
+  lastRect: {width: -1}
+
   isInViewport: (edRect) ->
     @isVisible = false
     @left = 0
+    @shouldUpdate = false
     if @view.parentElement?
       rect = @view.getBoundingClientRect()
       @isVisible = rect.top < edRect.bottom && rect.bottom > edRect.top
       @left = parseInt @view.parentElement.style.left
+      @shouldUpdate = edRect.width != @lastRect.width
 
   updateWidth: (elRect = @editor.editorElement.getBoundingClientRect()) ->
-    if @isVisible
+    if @isVisible and @shouldUpdate
+      console.log 'updating'
       w = elRect.width + elRect.left - 40 - @left
       if w < 100 then w = 100
       @view.style.maxWidth = w + 'px'
+      @lastRect = elRect
 
   toggleTree: ->
     trees.toggle $(@view).find('> .tree')

      ed = @editor
      edView = atom.views.getView(@editor)
      if not resultEditorRegistry.has ed.id
        resultEditorRegistry.add ed.id
        # create new editor specific result animation method
        listener = -> setTimeout (->

            rect = edView.getBoundingClientRect()
            res.forEach (m) -> m.isInViewport(rect)


          # writes
          fastdom.mutate ->
            #if shouldUpdate
            res.forEach (m) -> m.updateWidth(rect)
            last = []

          # batching updates:
          process.nextTick -> requestAnimationFrame listener
          ), 15*1000/60
        window.requestAnimationFrame listener

  initMarker: ->
