Get Selected File Path from Fuzzy Finder? (In Atom 1.16+)


#1

I’ve been using the following function in my init.coffee to get the selected file path from the Fuzzy Finder:

getSelectedFilePathFromFuzzyFinderAndCloseIt = (e) ->

  { $ } = window.require 'atom-space-pen-views'

  view = $(e.target).closest('.fuzzy-finder').view()

  { filePath } = view.getSelectedItem()
  view.cancel()

  filePath

However, since upgrading to Atom 1.16 beta, it is no longer working. Of course, this is because atom-space-pen-views has been replaced with atom-select-list.

So my question is: does anyone know how I could accomplish the same thing in the newer version of the Fuzzy Finder?