mirror of
https://github.com/atom/atom.git
synced 2026-02-15 17:15:24 -05:00
Load fuzzy finder paths in web worker at startup
Previously the paths were first loaded when the fuzzy finder view was first attached. Now a web worker is started when the package activates that sets the paths on the fuzzy finder view the first time it displays if the worker has completed by the time an event occurs that displays the view.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
||||
Subscriber = require 'subscriber'
|
||||
GitRepository = require 'git-repository'
|
||||
@@ -6,9 +5,9 @@ GitRepository = require 'git-repository'
|
||||
module.exports =
|
||||
class Git
|
||||
|
||||
@open: (path) ->
|
||||
@open: (path, options) ->
|
||||
try
|
||||
new Git(path)
|
||||
new Git(path, options)
|
||||
catch e
|
||||
null
|
||||
|
||||
@@ -24,9 +23,12 @@ class Git
|
||||
working_dir_typechange: 1 << 10
|
||||
ignore: 1 << 14
|
||||
|
||||
constructor: (path) ->
|
||||
constructor: (path, options={}) ->
|
||||
@repo = new GitRepository(path)
|
||||
@subscribe $(window), 'focus', => @refreshIndex()
|
||||
refreshIndexOnFocus = options.refreshIndexOnFocus ? true
|
||||
if refreshIndexOnFocus
|
||||
$ = require 'jquery'
|
||||
@subscribe $(window), 'focus', => @refreshIndex()
|
||||
|
||||
getRepo: ->
|
||||
unless @repo?
|
||||
|
||||
Reference in New Issue
Block a user