mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Merge branch 'master' into config
Conflicts: spec/app/project-spec.coffee src/extensions/wrap-guide/src/wrap-guide.coffee
This commit is contained in:
@@ -2,4 +2,3 @@ window.keymap.bindKeys ".select-list .mini.editor input",
|
||||
'enter': 'core:confirm',
|
||||
'escape': 'core:cancel'
|
||||
'meta-w': 'core:cancel'
|
||||
|
||||
|
||||
@@ -52,20 +52,14 @@ class Project
|
||||
|
||||
getFilePaths: ->
|
||||
deferred = $.Deferred()
|
||||
fs.getAllPathsAsync @getPath(), (paths) =>
|
||||
fs.getAllFilePathsAsync @getPath(), (paths) =>
|
||||
paths = paths.filter (path) => not @isPathIgnored(path)
|
||||
deferred.resolve(paths)
|
||||
deferred.promise()
|
||||
|
||||
isPathIgnored: (path) ->
|
||||
lastSlash = path.lastIndexOf('/')
|
||||
if lastSlash isnt -1
|
||||
name = path.substring(lastSlash + 1)
|
||||
else
|
||||
name = path
|
||||
|
||||
for ignored in @ignoredNames
|
||||
return true if name is ignored
|
||||
for segment in path.split("/")
|
||||
return true if _.contains(@ignoredNames, segment)
|
||||
|
||||
@ignoreRepositoryPath(path)
|
||||
|
||||
|
||||
@@ -15,13 +15,15 @@ class SelectList extends View
|
||||
@viewClass: -> 'select-list'
|
||||
|
||||
maxItems: Infinity
|
||||
scheduleTimeout: null
|
||||
inputThrottle: 200
|
||||
filteredArray: null
|
||||
cancelling: false
|
||||
|
||||
initialize: ->
|
||||
requireStylesheet 'select-list.css'
|
||||
|
||||
@miniEditor.getBuffer().on 'change', => @populateList()
|
||||
@miniEditor.getBuffer().on 'change', => @schedulePopulateList()
|
||||
@miniEditor.on 'focusout', => @cancel() unless @cancelling
|
||||
@on 'core:move-up', => @selectPreviousItem()
|
||||
@on 'core:move-down', => @selectNextItem()
|
||||
@@ -36,6 +38,10 @@ class SelectList extends View
|
||||
@confirmSelection() if $(e.target).closest('li').hasClass('selected')
|
||||
e.preventDefault()
|
||||
|
||||
schedulePopulateList: ->
|
||||
clearTimeout(@scheduleTimeout)
|
||||
@scheduleTimeout = setTimeout((=> @populateList()), @inputThrottle)
|
||||
|
||||
setArray: (@array) ->
|
||||
@populateList()
|
||||
@selectItem(@list.find('li:first'))
|
||||
@@ -43,12 +49,11 @@ class SelectList extends View
|
||||
|
||||
setError: (message) ->
|
||||
if not message or message.length == ""
|
||||
@error.text("")
|
||||
@error.hide()
|
||||
@error.text("").hide()
|
||||
@removeClass("error")
|
||||
else
|
||||
@error.text(message)
|
||||
@error.show()
|
||||
@setLoading()
|
||||
@error.text(message).show()
|
||||
@addClass("error")
|
||||
|
||||
setLoading: (message) ->
|
||||
@@ -113,8 +118,9 @@ class SelectList extends View
|
||||
@confirmed(element) if element?
|
||||
|
||||
cancel: ->
|
||||
@list.empty()
|
||||
@cancelling = true
|
||||
@cancelled()
|
||||
@detach()
|
||||
@cancelling = false
|
||||
|
||||
clearTimeout(@scheduleTimeout)
|
||||
|
||||
Reference in New Issue
Block a user