 
     parent.attach targetView  # Attach again.
 
-    @updateLayoutMap_ splitView, targetView.parent
+    @updateLayoutMap_ splitView, targetView
 
     # I'm not sure about the usage of private method. I had to...
     # Is it the best way for view resizing?

  moveTab: (direction) ->

    tabView = @activeTabView
    return unless tabView.parent?

    panel = tabView.parent.parent
    return  unless panel instanceof KDSplitViewPanel

  ###*
   * Update `@layoutMap` for move tab with keyboard shortcuts.
   *
   * @param {KDSplitView|IDEView} parent
  ###
  updateLayoutMap_: (splitView, targetView) ->

    return  if targetView instanceof KDSplitViewPanel

    @mergeLayoutMap_ splitView

    if targetView instanceof IDEView
      @mergeLayoutMap_ targetView.parent
    else
      targetView.panels.forEach (panel) =>
        @mergeLayoutMap_ panel


  ###*
   *
   * @param {KDSplitViewPanel} view
  ###
  mergeLayoutMap_: (view) ->

    return  unless view instanceof KDSplitViewPanel

    view._layout.leafs?.forEach (leaf) =>
      @layoutMap[leaf.data.offset] = null

    view._layout.merge()

    @layoutMap[view._layout.data.offset] = view
