       @vmpActivateInsertMode() if @vmpIsNormalMode()
 
   observeStopChangingActivePaneItem: ->
+    needToSync = (item) =>
+      isTextEditor(item) and not isNarrowEditor(item) and paneForItem(item) isnt @getPane()
+
     atom.workspace.onDidStopChangingActivePaneItem (item) =>
       @syncSubcriptions?.dispose()
       return if item is @editor
 
       @rowMarker?.destroy()
-      # Only sync to text-editor which meet following conditions
-      # - Not narrow-editor
-      # - Contained in different pane from narrow-editor is contained.
-      if (not isTextEditor(item)) or isNarrowEditor(item) or (paneForItem(item) is @getPane())
-        return
+      return unless needToSync(item)
 
       if @provider.boundToEditor
         if @provider.editor is item

        @preview() if @autoPreview

  findClosestItemForEditor: (editor) ->
    # Detect item
    # - cursor position is equal or greather than that item.
    cursorPosition = editor.getCursorBufferPosition()
    if @provider.boundToEditor
      items = _.reject(@items, (item) -> item.skip)
    else
      # Item must support filePath
      filePath = editor.getPath()
      items = @items.filter((item) -> not item.skip and (item.filePath is filePath))

    for item in items by -1 when @isNormalItem(item)
      # It have only point(no filePath field in each item)
      if item.point.isLessThanOrEqual(cursorPosition)
        break
    return item # return items[0] as fallback

  syncToEditor: (editor) ->
    return if @preventSyncToEditor

    else
      # move to current item
      @editor.setCursorBufferPosition([row, 0])

  getRowForSelectedItem: ->
    @getRowForItem(@getSelectedItem())
