 
   populateList: ->
     super
-    @removeClass 'add remove'
-    @addClass @action
+    @removeClass('add remove')
+    @addClass(@action)
 
   # @action should be 'add' or 'remove'
   start: (@action) ->
     @storeFocusedElement()
-    @setItems @getItems()
+    @setItems(@getItems())
     @panel.show()
     @focusFilterEditor()
 
   confirmAndContinue: ->
     selectedItem = @getSelectedItem()
     return unless selectedItem?
-    this[@action](fs.normalize(selectedItem))
+    this[@action](selectedItem.itemPath)
 
     selectedItemView = @getSelectedItemView()
     @selectNextItemView()
     selectedItemView.remove()
     @items = (item for item in @items when item isnt selectedItem)
 
-  confirmed: (item) ->
-    this[@action] fs.normalize(item)
+  confirmed: ({itemPath}) ->
+    this[@action](itemPath)
     @cancel()
 
   cancelled: ->

    this

  viewForItem: (item) ->
    matches  = match(item, @getFilterQuery())
    basename = _path.basename(item)
    $$ ->
      baseOffset = item.length - basename.length
      @li class: 'two-lines', =>
        @div {class: "primary-line file icon icon-repo", 'data-name': basename, 'data-path': item}, =>
          View.highlightMatches(this, basename, matches, baseOffset)
        @div {class: 'secondary-line path no-icon'}, =>
          View.highlightMatches(this, item, matches)

  getItems: ->
    loadedPaths = atom.project.getPaths()

isGitRepository = (path) ->
  fs.isDirectorySync _path.join(path, '.git')

highlightMatches = (context, path, matches, offsetIndex=0) ->
  lastIndex = 0
  matchedChars = [] # Build up a set of matched chars to be more semantic

  for matchIndex in matches
    matchIndex -= offsetIndex
    continue if matchIndex < 0 # If marking up the basename, omit path matches
    unmatched = path.substring(lastIndex, matchIndex)
    if unmatched
      context.span matchedChars.join(''), class: 'character-match' if matchedChars.length
      matchedChars = []
      context.text unmatched
    matchedChars.push(path[matchIndex])
    lastIndex = matchIndex + 1

  context.span matchedChars.join(''), class: 'character-match' if matchedChars.length
  # Remaining characters are plain text
  context.text path.substring(lastIndex)

class View extends SelectListView
  # Copied from FuzzzyFinder's and modified a little.
  initialize: ->
    super
    @addClass('project-folder')
